Jump to content
Sign in to follow this  
GenPattonX

Units from different bases help Tank if he gets destroyed closer to their base

Recommended Posts

Hi

I am trying to do the following exercise:

There are two bases, A and B. And one patrol unit (lets say Tank1) in the area between bases. I would like that if the tank gets destroyed closer to one of the bases, only units from that base would come for help. So if Tank1 gets destroyed closer to base A, only units from that base will be alerted, and none from base B.

I humbly tried like i explain below, it didn’t work but I am posting it anyway because maybe there is just something i need to add or something little i have to change, although i am open to script suggestions, i would like to avoid using any for now, i have been told its a better solution for most of situations, but plz if i can get it by using triggers or gamelogic it will be easier for me at the moment.

I used two triggers, each one covering half of the area between bases.

I set both triggers to meet this condition in order to activate:

Not alive Tank1

I grouped the triggers with Tank1 and syncronized one trigger with the starting waypoint of a unit in Base A and the other trigger with the starting waypoint of a unit in Base B.

I grouped the triggers with Tank1 and set them to be activated by “Presentâ€, because i was thinking this would mean the triggers would only activate if Tank1 was in the trigger area when destroyed. So the other trigger wouldn’t activate, simpy because Tank1 wasn’t destroyed in its area. And if Tank1 was destroyed not in both of the triggers area, then none would activate…

But i was wrong, both triggers activate when Tank1 gets destroyed, either when he is in or out of the triggers area.

So plz help and thx anyway

Share this post


Link to post
Share on other sites

I'd use a simple 'distance' script. Just something small that's triggered when the tank dies, then two variables are set with (Tank1 distance Base1) and (Tank1 distance Base2), and then that: if _distance1 > _distance2: goto "Base1Helps", and otherwise the second base comes in for assistance. I hope that made some sort of sense, it's 5 am here, already, and I had half a day of scripting...

Share this post


Link to post
Share on other sites

I have to say that script sounds great, but i don't know how to script... I'm not going to ask anyone to do it for me unless they don't mind and if it's fairly simple.

Otherwise i am just going to hope for suggestions based on triggers, while i search the forum and the web at the same time.

thx anyway

---------- Post added at 03:37 ---------- Previous post was at 03:24 ----------

I found a discussion about triggers activated by this code:

(player distance thistrigger) < viewDistance

So i decided to try it for my situation, combined with another code:

not alive Tank1 and (Tank1 distance this trigger) < 500

It works. Again, i knew it could be done with a simple code in a trigger, i guess i am creating very simple and noob missions because i just dont see the need for scripts XD

I am still open to suggestions by the way, anything smarter i am whilling to learn.

thx anyway

Edited by GenPattonX

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×