rpg-x2/testingstuff/scripts/lua/borg2test/borg2test.lua
Harry Young 19dc95e05d fx_borg_bolt
*basically finished it, but I need the current origin of my targets, not the original. Don't know how to get that.
*added a new folder 'testingstuff' for anything we generate for testing various things and put the folder 'maps in there'
*also in there is a test-version of borg2 with a hardcoded fx_borg_bolt at the binary lift (somehow lua will class it as noclass...)
*minor mod to game-makefile that prevented me from compiling

Signed-off-by: Harry Young <hendrik.gerritzen@googlemail.com>
2011-12-17 15:50:02 +01:00

122 lines
No EOL
3.6 KiB
Lua

-- Startup
function InitGame(levelTime, randomSeed, restart)
game.Print("--Lift D...");
game.Print("---Segment reclassification ...");
ent = entity.FindBModel(52)
ent:SetClassname("func_static");
--ent:SetTargetname("dual_lift_upper");
ent:SetLuaReached("liftdreachedsound");
entity.CallSpawn(ent);
ent = entity.FindBModel(54)
ent:SetClassname("func_static");
--ent:SetTargetname("dual_lift_lower");
ent:SetLuaReached("liftdreachedsound");
entity.CallSpawn(ent);
game.Print("---Metascripts ...");
game.Print("---down1 ...");
ent = entity.Spawn();
ent:SetClassname("target_relay");
ent:SetTargetname("down1");
ent:SetLuaUse("liftddown1");
entity.CallSpawn(ent);
ent = entity.Spawn();
ent:SetClassname("target_delay");
ent:SetTargetname("down1");
ent:SetTarget("down2");
ent:SetWait(5);
entity.CallSpawn(ent);
game.Print("---down2 ...");
ent = entity.Spawn();
ent:SetClassname("target_relay");
ent:SetTargetname("down2");
ent:SetLuaUse("liftddown2");
entity.CallSpawn(ent);
ent = entity.Spawn();
ent:SetClassname("target_delay");
ent:SetTargetname("down2");
ent:SetTarget("up2");
ent:SetWait(5);
entity.CallSpawn(ent);
game.Print("---up2 ...");
ent = entity.Spawn();
ent:SetClassname("target_relay");
ent:SetTargetname("up2");
ent:SetLuaUse("liftdup2");
entity.CallSpawn(ent);
ent = entity.Spawn();
ent:SetClassname("target_delay");
ent:SetTargetname("up2");
ent:SetTarget("up1");
ent:SetWait(5);
entity.CallSpawn(ent);
game.Print("---up1 ...");
ent = entity.Spawn();
ent:SetClassname("target_relay");
ent:SetTargetname("up1");
ent:SetLuaUse("liftdup1");
entity.CallSpawn(ent);
ent = entity.Spawn();
ent:SetClassname("target_delay");
ent:SetTargetname("up1");
ent:SetTarget("down1");
ent:SetWait(5);
entity.CallSpawn(ent);
game.Print("---init ...");
ent = entity.Spawn();
ent:SetClassname("target_relay");
ent:SetTarget("down1");
entity.CallSpawn(ent);
entity.Use(ent)
game.Print("---fx-startspawn ...");
--ent = entity.Spawn();
--ent:SetClassname("fx_borg_bolt");
--ent:SetMessage("dual_lift_upper");
--ent:SetTarget("dual_lift_lower");
--entity.CallSpawn(ent);
end
-- Functions Lift D
function liftddown1(ent, other, activator)
ent = entity.FindBModel(52);
mover.ToPosition(ent, 12, 768, -1984, 224);
sound.PlaySound(ent, "sound/movers/doors/largedoorstart.mp3", 0);
end
function liftddown2(ent, other, activator)
ent = entity.FindBModel(52);
mover.ToPosition(ent, 30, 768, -1984, 104);
sound.PlaySound(ent, "sound/movers/doors/largedoorstart.mp3", 0);
ent = entity.FindBModel(54);
mover.ToPosition(ent, 30, 768, -1984, 104);
sound.PlaySound(ent, "sound/movers/doors/largedoorstart.mp3", 0);
end
function liftdup2(ent, other, activator)
ent = entity.FindBModel(52);
mover.ToPosition(ent, 30, 768, -1984, 224);
sound.PlaySound(ent, "sound/movers/doors/largedoorstart.mp3", 0);
ent = entity.FindBModel(54);
mover.ToPosition(ent, 30, 768, -1984, 224);
sound.PlaySound(ent, "sound/movers/doors/largedoorstart.mp3", 0);
end
function liftdup1(ent, other, activator)
ent = entity.FindBModel(52);
mover.ToPosition(ent, 12, 768, -1984, 272);
sound.PlaySound(ent, "sound/movers/doors/largedoorstart.mp3", 0);
end
function liftdreachedsound(ent, other, activator)
sound.PlaySound(entity.FindBModel(52), "sound/movers/doors/largedoorstop.mp3", 0);
end