Code: Select all
defineObject{
name = "indus_wall_biodome_log_console_lock",
components = {
{
class = "Socket",
offset = vec(-0.005, .895, -0.1),
rotation = vec(0, 18, 0),
-- debugDraw = true,
onAcceptItem = function(self, item)
local disks = { ["disklog_1"]= {"Drakes have destroyed the Biodome Sector 1 with most repair droids in it!",
"Things are getting worse, where is our goddam fleet?","Colonel Rangson."},
["disklog_2"]= {"A long list of things to do, repairing console N29, Security Door 18 malfunction,",
"Changing access codes to the command center and alpha center, current 97887,",
"leak in the cooling system sector 5..."},
["disklog_3"] = {"This pie is rotten!"},
}
if disks[item.go.id] then
playSound("ogre_rush_begin")
-- Place your own events here.|
-- If you don't want the hudPrinted text, you can remove the hudPrint statements and loops.
-- If you like, you could make each disklog_x value [in 'disks'] be a function() instead of a string;
-- and call them like this:
-- disks[item.go.id]()
-- Each disklog inserted would call its own function in disks.
-- Example:
--|-------------------------------------------------------------|--
disks["disklog_3"] = function(self)
my_door.door:open()
for line = 1, 5 do hudPrint("") end --clears hud text
hudPrint("Security Door is "..iff(my_door.door:isOpening(),"","already ").."Unlocked!")
end
if item.go.id == "disklog_3" then
disks[item.go.id]()
return
end
--|-------------------------------------------------------------|--
--
--
--hudPrint code
for line = 1, 5 do hudPrint("") end
for line = 1, #disks[item.go.id] do
hudPrint(disks[item.go.id][line])
end
-- ========================================|
end
return item.go.name == "disklog" and self.go.socket:count() == 0
end,
},
{
class = "Clickable",
offset = vec(0, 1, 0),
size = vec(0.3, 0.3, 0.4),
-- debugDraw = true,
},
{
class = "Model",
model = "assets/models/env/wall_lock.fbx",
offset = vec(0, 1, 0),
staticShadow = true,
enabled = true,
},
{
class = "Occluder",
model = "assets/models/env/dungeon_wall_01_occluder.fbx",
}
},
replacesWall = false,
placement = "wall",
editorIcon = 8,
}