Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: jjbradman on April 18, 2014, 04:54:47 am
Title: "is touching" help
Post by: jjbradman on April 18, 2014, 04:54:47 am
i am trying to use istouching to wait until an ent is being touched by the player can someone say me a better way of doing this as my while and for loops keep acting as if the player would be touching the ent while it's not D:
Title: Re: "is touching" help
Post by: MakeCents on April 18, 2014, 05:09:07 am
i am trying to use istouching to wait until an ent is being touched by the player can someone say me a better way of doing this as my while and for loops keep acting as if the player would be touching the ent while it's not D:
I use something like this:
Title: Re: "is touching" help
Post by: jjbradman on April 18, 2014, 05:26:33 am
Title: Re: \"is touching\" help
Post by: jjbradman on April 18, 2014, 04:00:37 pm
no i dont want it for the car ride and i cant use a trigger cause the thing that player is supposed to touch spawns when a zombie dies. so i cant spawn a trigger or put one in the specific place where it died Post Merge: April 18, 2014, 04:01:47 pmand makecents, i dont think that trigger link to is posible cause yesterday i tried to use movez with a trigger and everything moved fine except for the trigger :/
Title: Re: "is touching" help
Post by: YaPh1l on April 18, 2014, 05:01:35 pm
It is possbile, you have to EnableLinkTo(). Also, you can spawn a trigger_radius via script. But if it is something powerup-like (where there might be more), it would indeed be better to use IsTouching() or even just a proximity check (DistanceSquared()) like the powerups do.
- Phil.
Title: Re: "is touching" help
Post by: MakeCents on April 18, 2014, 06:16:42 pm
It is possbile, you have to EnableLinkTo(). Also, you can spawn a trigger_radius via script. But if it is something powerup-like (where there might be more), it would indeed be better to use IsTouching() or even just a proximity check (DistanceSquared()) like the powerups do.
- Phil.
Wow, you're AWESOME. :rainbow: :gusta: Can't believe that was the answer. Thanks so much. Now I can get rid of those nested loops and just thread a loop once.
Title: Re: "is touching" help
Post by: jjbradman on April 18, 2014, 06:20:54 pm
It is possbile, you have to EnableLinkTo(). Also, you can spawn a trigger_radius via script. But if it is something powerup-like (where there might be more), it would indeed be better to use IsTouching() or even just a proximity check (DistanceSquared()) like the powerups do.
- Phil.
actually the trigger radious idea i think is better o.O that way the script could wait till the trigger has been touched? o.O
Title: Re: "is touching" help
Post by: YaPh1l on April 18, 2014, 08:39:53 pm
It depends on how many you have. A trigger_radius is an entity just like anything else that is scriptable. It will count towards the entity limit.
- Phil.
Title: Re: "is touching" help
Post by: jjbradman on April 18, 2014, 09:01:13 pm
but the trigger radious would be deleted within 15 seconds of being spawned anywas and only 1 zombie in every 10 zombies would need the radious to be spawned
Title: Re: "is touching" help
Post by: YaPh1l on April 18, 2014, 10:51:00 pm
I'm not stopping you from anything, I'm just stating facts.
- Phil.
Title: Re: "is touching" help
Post by: jjbradman on April 18, 2014, 10:53:51 pm
oh, lol then how would i spawn a trigger radious? also what is the entity limit? and what goes to that count?
Title: Re: "is touching" help
Post by: YaPh1l on April 18, 2014, 10:58:05 pm
As I said, all entities, basically any game object that can be accessed by script in any way, except script_structs.
- Phil.
Title: Re: "is touching" help
Post by: jjbradman on April 18, 2014, 11:04:06 pm
thanks man :D and btw using the spawn funt can i spawn another type of trigger like a trigger multiple? o.o ok thanks man i think im staying way below that limit cause i delete all ents after being used :)
and just one final question: do trigger radius work like trigger_multiples so they are activated when touched or player has to press f?
Title: Re: "is touching" help
Post by: YaPh1l on April 18, 2014, 11:06:47 pm