Scripts / Multi Level Teleport with Time Limit

Author
Message
js
9
Years of Service
User Offline
Joined: 24th Sep 2015
Location:
Posted: 30th Sep 2015 14:29
How can i make my character to teleport from level 1 map to a level 2 after a certain time limit ends?
PM
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 30th Sep 2015 14:50
This would involve LUA scripting and using the timer functions, please can you give more details. Eg do you just want to teleport while you are anywhere on the terrain or is there something more specific you want to do?
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.
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 30th Sep 2015 18:07 Edited at: 30th Sep 2015 22:16
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)



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]


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.
js
9
Years of Service
User Offline
Joined: 24th Sep 2015
Location:
Posted: 1st Oct 2015 06:27
thank you for your response and for this tutorial, i really appreciate it.

By the way, do you have an idea on how can i put a timer text at the top of my screen that shows a timer countdown , let's say upto 1 min, then after that, a win zone will appear that will teleport me to a new level from map1 to map2 ,, or a winzone will appear after you have destroyed all the entity (example you destroyed all the target in a target shooting sport) in that level, then a win zone will appear that will teleport you to the next map
PM
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 1st Oct 2015 06:41 Edited at: 1st Oct 2015 07:18
Yes I do , maybe try having a go yourself and see what u can come up with a small hint would!d be with every second gone by decrease the value of the countdown timer and display each loop. You will need global variable to store number of entities that need to be killed or destroyed before activating a winzone or spawning an entity. I recommend placing a light entity to get the text to the top of the screen or use a panel with text in it and position it. Hopefully, that should be enough info to get you started. Have fun.
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.
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 1st Oct 2015 14:38
I am going to move this thread to scripting.

Thanks
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit

Login to post a reply

Server time is: 2024-12-22 06:59:28
Your offset time is: 2024-12-22 06:59:28