Scripts / a little mission and spawning a winzone

Author
Message
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 15th Sep 2015 21:28
hi there! can you help me with this? i would like to have the following actions. when i start the game the player gets a mission (in the script i want to use i take the phone call script) and then there is "find the explosive". the player has to find a bomb and collect it. i have an idea to change the hostage script for this but i don't know how to make the collected item disappear. when i got the explosive i want to start a new mission "Blow up the radio antenna" or omething like this. the player has to get up the roof and when he did so he hs to "press E to plant explosive" but ONLY when he has the explosive. for this i could use the bomb script. but now the main problem. when i have destroyed the radio antenna i want to get the message "leave this place, get to your boat!" adn then the winzone for this level has to be spawned near the boat. the same place i start this level so the winzone should not be active in the beginning because the staring point is right next to it. can you help me a little there? when i have the first scripts i will show but i have no idea if this plot is even possible?
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 16th Sep 2015 08:02 Edited at: 18th Sep 2015 17:02
When hiding an entity you can either use Hide(e) or Destroy(e). For the winzone, there are different ways to do this. You can try the SpawnIfUsed(e) in the boat entity script and then in the boat entity property 'Ifused' set to the name of the winzone Entity. Modify the winzone.lua (copy the original first and rename) and add Hide(e) as there is not option available in the default winzone properties (because they are hidden by default in-game). You will still have to place the winzone near the boat, it just will be hidden and not activated and then do a Show(e) if the winzone is activated. OR you could get the x,y,z co-ords of the boat, place the winzone away from the boat (and hide it maybe) and then reposition the winzone to the same co-ords as the boat (and show it). I haven't tested this but in theory it could work GG allowing. Give both ways a try. I may also test this out as well as I am now curious if it can be done. Haven't played around with winzone much yet but it's just an entity like any other.
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.

Attachments

Login to view attachments
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 3rd Dec 2015 08:10 Edited at: 3rd Dec 2015 08:12
I've found a good way to do this without all the hiding and spawning (which is a pain with markers).

In the script for whatever your last action was put flag_winzone_finished = 1

Then place the winzone and use the following script:

winzone2.lua


What this does is basically makes it so the winzone checks to see if the winzone flag is active and if it isn't do nothing, but if it is it runs the normal winzone functions.

Login to post a reply

Server time is: 2024-12-22 10:22:06
Your offset time is: 2024-12-22 10:22:06