When I call istouching()) doesn't that only checks if the zombie is touching the trigger once? I mean, I want so when the trigger spawns, it will check if the zombies are touching the trigger all the time until it deletes itself. But didn't istouching()) only checked if the zombies are touching the trigger only once?
If it does, then if the first zombie touches it the first time, they will get the effects. But if a second touches the trigger after an another zombie already have touched the trigger, then the second zombie will not get it effect if istouching()) only checks if the zombie is touching the trigger once?
Would distancesquered() work better in this case? Or does that do the same thing?
You would need to put the istouching() in a loop so it keeps checking, same goes for the distancesquared(). Then, for example, break the loop at some point when you want the effects to stop. There's multiple's ways of doing it i guess..
You would need to put the istouching() in a loop so it keeps checking, same goes for the distancesquared(). Then, for example, break the loop at some point when you want the effects to stop. There's multiple's ways of doing it i guess..
I was thinking of making a loop that checks if the zombies are touching it, but I didn't know that I could stop a loop in a script.
However, I tested to add the iprintln message like how you added it. And when I throw the grenade, the iprintln that says "killing zombie" showed up even if the zombies are not touching the trigger. And for some reason, the zombies doesn't die anymore. If the script says that it will dodamage() on the zombies, then why doesn't it do it then?
Hmm, things are getting even more wierd. What else can we do?
Prob somewhere you're code 'isn't working'.. Hard to say from here, you should just try some stuff where you think the problem might be. Otherwise you could post your script again to take a look perhaps.. Then post it exactly as it is in your file's..
ege it seems that yu're trying to do something like this
Code Snippet
Plaintext
touch_trig() { num = 1; flags = 0; //this is the same as spawnflags so check in radiant which spawnflags are needed for zombies to use the trigger radious = 30; //self explanatory height = 100; //self explanatory org = self.origin; trig = Spawn("trigger_radius", self.origin, flags, radious, height); trig thread timeout(); while(num == 1) { trig waittill("trigger");
ege it seems that yu're trying to do something like this
Code Snippet
Plaintext
touch_trig() { num = 1; flags = 0; //this is the same as spawnflags so check in radiant which spawnflags are needed for zombies to use the trigger radious = 30; //self explanatory height = 100; //self explanatory org = self.origin; trig = Spawn("trigger_radius", self.origin, flags, radious, height); trig thread timeout(); while(num == 1) { trig waittill("trigger");
here self is the ent where you want the trigger to spawn
, it works almost perfect now. Thank you! I looked in radiant in the options of what you can do with a trigger radius, apperently I needed to have 73 spawnflags to get it working properly.
Okey, now there is one more small change left. The zombies does take damage if they are touching the trigger now. But if only one zombie touches the trigger, then the zombies that are not touching the trigger dies as well. Do I maybe have to remove this loop?
Code Snippet
Plaintext
for(k=0;k<zombs.size;k++) {
Because this means that all the zombies take the damage? Am I wrong? Or do I have to use a loop for the zombies?
If I get this done as well. Then it will be tricky who I will give the best answer to. Bluntstuffy helped me so much corrected the script for me and it worked better.
jjbradman told me about the spawnflags that made the script to work better.
And JR-Imagine corrected the script a bit and it worked better also.
What should I do? Thank you so much for the help, all of those solution worked.