Wc3C.net

Wc3C.net (http://www.wc3c.net/forums.php)
-   Triggers & Scripts (http://www.wc3c.net/forumdisplay.php?f=8)
-   -   TempPoint with Array Removal (http://www.wc3c.net/showthread.php?t=101393)

SeruK 07-10-2008 01:51 PM

TempPoint with Array Removal
 
'sup. I'm making this "squad" system for my map which is just x units spawning at once. Now I want to make this trigger MUI, but there is a point involved and the trigger obviously runs quite frequently so I want to remove it. Just what should I write when it comes to removing it? udg_x_TempPointSpawn(Integer A)?

Here's the trigger.

Hidden information:
Trigger:
Punters
Collapse Events
Unit - A unit Finishes training a unit
Collapse Conditions
((Entering unit) is A structure) Equal to False
Collapse Actions
Collapse For each (Integer A) from 1 to 3, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Owner of (Trained unit)) Equal to inc_Players[(Integer A)]
Collapse Then - Actions
Set x_TempPointSpawn[(Integer A)] = (Position of (Trained unit))
Unit - Create ((Point-value of (Trained unit)) / 100) (Unit-type of (Trained unit)) for (Owner of (Trained unit)) at x_TempPointSpawn[(Integer A)] facing (Facing of (Trained unit)) degrees
Custom script: call RemoveLocation(udg_x_TempPointSquad) //?
Collapse Else - Actions
Do nothing

the-thingy 07-10-2008 02:04 PM

This:
call RemoveLocation (udg_x_TempPointSpawn[GetForLoopIndexA ()])
or

call RemoveLocation (udg_x_TempPointSpawn[bj_forLoopAIndex])
But, to be honest, you don't need an array. You are destroying the point after it's created/used without any delay, so an array just makes it longer and more awkward

SeruK 07-10-2008 02:17 PM

Quote:

Originally Posted by the-thingy
This:
call RemoveLocation (udg_x_TempPointSpawn[GetForLoopIndexA ()])
or

call RemoveLocation (udg_x_TempPointSpawn[bj_forLoopAIndex])
But, to be honest, you don't need an array. You are destroying the point after it's created/used without any delay, so an array just makes it longer and more awkward

Hey, thanks a bunch. But what are you saying? That all I have to do is remove (udg_x_TempPointSpawn) without specifying the array number thingO?

Or that I don't need an array for the trigger? Because that I do.

the-thingy 07-10-2008 02:20 PM

Quote:

Hey, thanks a bunch. But what are you saying? That all I have to do is remove (udg_x_TempPointSpawn) without specifying the array number thingO?

Or that I don't need an array for the trigger? Because that I do.

That you don't need an array. If that's your whole trigger, you sure as hell don't need an array.

You don't need that "Do nothing" either. Leaving the Else - Actions blank will have the same effect

SeruK 07-10-2008 02:31 PM

Quote:

Originally Posted by the-thingy
That you don't need an array. If that's your whole trigger, you sure as hell don't need an array.

You don't need that "Do nothing" either. Leaving the Else - Actions blank will have the same effect

Oh wait, maybe I don't. But is it really MUI then? It would suck if the peeps would end up in the enemies base.

And Do Nothing is purely aestethic. :P

ed: +rep for being pro.

the-thingy 07-10-2008 02:41 PM

Quote:

Oh wait, maybe I don't. But is it really MUI then? It would suck if the peeps would end up in the enemies base.

Ye, it'll be MUI. It'll have to go through all the loop actions for that particular value of integer A before moving onto the next value for integer A


All times are GMT. The time now is 03:29 AM.

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services