to transport you to another level after say 10 seconds (anywhere within the terrain) you can use this lua script, just attach it to an entity that has the 'ifused' parameter (type in the name of the level that you want the player to be transported to e.g. transportlevel2 and don't forget to save the levels as standalone). Also try the jumptolevel command, there are probably a few ways to do this. As an option you could even attach a .wav file in the first soundset slot of the entity so that when the 10 seconds have passed it plays, well a sound (to play the sound move the playsound command to somewhere more appropriate- have a play around- coding can be fun)
function transportdelay_init(e)
end
function transportdelay_main(e)
if g_Entity[e]['health'] ~=0 then
SetEntityHealth(e,0)
StartTimer(e)
PlaySound(e,0)
end
if g_Entity[e]['health'] == 0 then
tp=math.floor(GetTimer(e) / 1000)
-- prompt for debugging/fine tuning
PromptLocal(e,'time passed..: '..tp)
if tp >= 10 then
JumpToLevelIfUsed(e)
Destroy(e)
ActivateIfUsed(e)
--JumpToLevel("testlevel2")
end
end
end
This may get moved to the scripts section.
If you need a demo vid, let me know and I will "knock" one up quickly.
[UPDATE-code below also works]
-- LUA Script - precede every function and global member with
--lowercase name of script + '_main'
-- transportdelay.lua
-- allows player to transport to another level
-- after specified time elapsed
-- e.g. tp >=10 -> after 10 seconds, tp>=60 -> 1 minute etc
function transportdelay_init(e)
end
function transportdelay_main(e)
if g_Entity[e]['health'] ~=0 then
SetEntityHealth(e,0)
StartTimer(e)
end
if g_Entity[e]['health'] == 0 then
tp=math.floor(GetTimer(e) / 1000)
-- prompt for debugging/fine tuning
PromptLocal(e,'time passed..: '..tp)
if tp >= 10 then
PlaySound(e,0)
JumpToLevel("transportlevel2")
Destroy(e)
end
end
end
Video below (note: tje zombies didn't show because I forgot to copy the files from level2 to level1 area):
Professional Programmer: Languages- SAS, C++, SQL, PL-SQL, JavaScript, HTML, Darkbasic Pro, Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; LG TFT monitor (widescreen).
Interests: Drumming, Saxophone, Art, Theatre, Music.