UGX-Mods

Call of Duty 5: World at War => Tutorial Desk => Scripting => Topic started by: jei9363 on October 29, 2014, 05:29:17 pm

Title: [Tutorial] Buried Zone Activation
Post by: jei9363 on October 29, 2014, 05:29:17 pm
In buried the first zone outside the start zone is activated by falling into it.

note this requires a path to the next zone still

if you want this place as many trigger_multiples in your map where you know, if the player is here, they ARE falling into
this zone.

give it

targetname
Code Snippet
Plaintext
activate_by_touch

script_flag
(enter_zone_YOURZONE)

in mapname.gsc at the bottom of main()

Code Snippet
Plaintext
	activate_by_touch_trigs = getEntArray("activate_by_touch","targetname"); 

for(i=0;i<activate_by_touch_trigs.size;i++)
activate_by_touch_trigs[i] thread activate_by_touch();

bottom of file

Code Snippet
Plaintext
activate_by_touch()
{

flag_wait( "all_players_connected" );

flag_init(self.script_flag);

activated = false;

while(!activated)
{
players = get_players();

for (i = 0; i < players.size; i++)
if(players[i] isTouching(self))
{
flag_set(self.script_flag);
players[i] iprintln("activated: " + self.script_flag);  //REMOVE when done debugging
activated = true;
}
wait .1;
}
}

(https://www.ugx-mods.com/forum/proxy.php?request=http%3A%2F%2Fi60.tinypic.com%2Feb8t1d.jpg&hash=804ef2a4274f4d6a37a5ece822340a290a375ab5)

(https://www.ugx-mods.com/forum/proxy.php?request=http%3A%2F%2Fi57.tinypic.com%2Fwaqzxv.jpg&hash=79d6408a8c8aeaefa14324755771b59a505eaae8)
Title: Re: [Tutorial] Buried Zone Activation
Post by: Harry Bo21 on October 30, 2014, 07:04:55 am
awesome, thanks Jei

+1 from me ;)
Title: Re: [Tutorial] Buried Zone Activation
Post by: MZslayer11 on October 30, 2014, 08:32:06 pm
Thanks for this. It will definitely come in handy!
Title: Re: [Tutorial] Buried Zone Activation
Post by: MZslayer11 on November 05, 2014, 01:33:47 am
I want to add this in my map and I have a few questions on setup. I'm assuming I still have to add the 'adjacent zone' thing in nazi_zombie_MAPNAME.gsc. Correct me if i'm wrong. I also want to have more than one zone that is activated by touch. Would I keep the targetname the same and just change the 'script_flag' for each specific zone? Sorry if these questions are nooby :-\ Haven't really dealt with zones before.
Title: Re: [Tutorial] Buried Zone Activation
Post by: mentality on November 30, 2014, 11:25:16 pm
I want to add this in my map and I have a few questions on setup. I'm assuming I still have to add the 'adjacent zone' thing in nazi_zombie_MAPNAME.gsc. Correct me if i'm wrong. I also want to have more than one zone that is activated by touch. Would I keep the targetname the same and just change the 'script_flag' for each specific zone? Sorry if these questions are nooby :-\ Haven't really dealt with zones before.

yes to both of those, you will need to add adjacent zones etc. as normal and you just need to change the script flag