UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Spawning a trigger radius.

HOT
broken avatar :(
Created 12 years ago
by Ege115
0 Members and 1 Guest are viewing this topic.
11,979 views
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Before I test this, I want to know.

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?

I hope this explonation wasn't confusing xD.
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 2 years ago
Posts
1,186
Respect
1,332Add +1
Forum Rank
Zombie Colossus
Primary Group
Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntStuffyBluntstuffy@BluntZombieStuffyZombie
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..
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
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..
:o 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?
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 2 years ago
Posts
1,186
Respect
1,332Add +1
Forum Rank
Zombie Colossus
Primary Group
Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntStuffyBluntstuffy@BluntZombieStuffyZombie
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..
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Well, first of. Could you show me how to stop a loop as you said before? :D
broken avatar :(
×
broken avatar :(
Location: usYork, SC
Date Registered: 15 March 2014
Last active: 7 years ago
Posts
214
Respect
Forum Rank
Mr. Elemental
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
WaW Scriptor
Signature
WaW Scriptor
×
PROxFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
PROxFTW's Contact & Social LinksPROxFTWPROxFTWPROxFTWPROxFTW
Code Snippet
Plaintext
for(;;)
{
      if(Something == Something)
            break;
}
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 6 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Scripter Elite
My Groups
More
×
YaPh1l's Groups
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
Or even just a simple while loop with a condition...

- Phil.
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 7 years ago
Posts
941
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
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");

self delete();
trig delete();
        //do more stuff
wait 0.1;
    }
}

timeout()
{
wait 15;
self delete();
}

here self is the ent where you want the trigger to spawn ;)

Last Edit: April 20, 2014, 05:52:25 pm by jjbradman
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
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");

self delete();
trig delete();
        //do more stuff
wait 0.1;
    }
}

timeout()
{
wait 15;
self delete();
}

here self is the ent where you want the trigger to spawn ;)


:o, 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.
Last Edit: April 20, 2014, 07:00:10 pm by Ege115
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 7 years ago
Posts
941
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
inside that for loop just check if the zombs distance is inside the range where you want them to die
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
I have now decided who will get the best answer. The main answer was at bluntstuffy's first post. lol, I just didn't do the script the right way.

But as all of you helped me and made the script to work better and better all the time, I will give you each +1. Thank you :).

 
Loading ...