HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Rally Point with triggers

07-29-2003, 11:18 PM#1
Panto
Does anyone know of a way to refer to a Rally Point with triggers?

I searched the triggers for "rally" and found nothing.

I want to order a unit to move to the rally point of a building.
07-29-2003, 11:23 PM#2
Pesmerga
You could always order trained unit to attack-move to point. Or if thats not what you meant, all buildings come with rally points.
07-30-2003, 12:46 AM#3
Newhydra
The rallypoint is an attachment point on some models...see if changing the rallypoint is an order? If it is you could store the rallypoint and order movement based on the stored variable...
07-30-2003, 05:43 AM#4
Panto
Quote:
You could always order trained unit to attack-move to point.
Exactly so. But, how do I get the location of the Rally Point, to tell a unit to attack-move there?
Newhydra, I don't understand how the attachment point you mentioned fits in to this. I'm not specifically planning to have the rally point attached to a unit, nor would the location of the effect on the model be pertinent, I think. I want to have units move to wherever it is on the map.
I already used the trigger search function for "rally" and didn't find anything.
07-30-2003, 05:46 AM#5
Newhydra
I thought maybe you could tell where on the map an attachment point was.

But even if you can't, you can just detect the change rallypoint order and get the location of the order's target and store it...(smart/setrally)
07-30-2003, 04:22 PM#6
birdfoot
hi panto, i don't really understand your problem... maybe you could better explain what you really want to happen? cos i figured there's a few scenarios:

1. you have a structure which you manually issue a train unit order and you want the unit to move to the rally point when it's done training
2. you're trying to track the rally point of a particular player's (whom is not under your control) structure's rally point and when something happen's you want to send your unit(s) to attack-move to that position

for pt. 1, you can just issue order targeting a point, set the rally point at the desired position and start training the units... they'll auto rally at the point specified after training... (this i guess is probably not wat you are thinking and you probably already knew... :))

for pt. 2, my guess is that you do need to attach the rally point to the unit that you wanna track... however, i tink this can be done dynamically... i have not tried it but i hope you can try it out and see if it works... :)

beforehand, create 2 integer arrays (say rally_x[] and rally_y[], gonna use it to store all the rally points x,y attached to the structures) and integer variable (say count_custom, default value = 1, using this to index the arrays and set custom values of the structures)

1. make a trigger,
--------------------------------------
Event - map initialize
Action - pick all the structures on map and do multiple actions... (*unit group - pick all... multiple actions)
--------------------------------------
2. under multiple actions, loop,
Action - set custom value of picked units = count_custom (*set variable)
Action - set count_custom = count_custom + 1 (*set variable)
=======================================
3. make another trigger
Event - unit is issued an order targeting a point (*generic unit event)
Condition - issued order equal to order(setrally) (*order comparison)
Action - set rally_x[custom value of triggering unit] = integer(X of target point of issued order) (*set variable, conversion - real to integer, X of point)
Action - set rally_y[custom value of triggering unit] = integer(Y of target point of issued order) (*set variable, conversion - real to integer, Y of point)

that should handle the storing of x,y of rally points automatically, i hope... :P the only prob i see is that the co-ordinates will not be exact, but close enough (due to conversion between real to integer)... and you won't be able to refer to that unit's rally point on your own (cos you wouldn't know the sequence it was set, of cos this has a workaround but it's rather long for me to explain) unless you can pick that unit or if it triggers the event... however, due to the lack of understanding of your problem, i cant really go on further...

in short, becos the custom values are unique for each structure and the custom values is used to index the rally point arrays, you can find out the x and y co-ordinates of the rally points pertaining to a structure, by conversion of integer to real, the value of the rally arrays indexed by the custom value of the TRIGGERING or PICKED unit...

not sure if this really works, but its the only method that i can really think of right now... i hope it works for ya... good luck! :) oh... n sorry for the long and bad writing (not good at writing)... :P
07-30-2003, 04:58 PM#7
dataangel
Rally point changes are orders, they an take the form of "rally" (left click button then ground) or "smart" (right click on ground). If a building gets either order, store the target of the order in an array. Then order whatever unit you want to that point. Use either the building's flying height or custom value to index the array.
07-31-2003, 05:45 PM#8
Panto
Thank you both. I will be experimenting with this.
08-01-2003, 06:32 AM#9
Panto
Do we have a way to refer to the target of an Order?

EDIT: As a condition?
08-01-2003, 06:41 AM#10
Newhydra
yes...event response targetted point (something close to that)
08-01-2003, 06:43 AM#11
Panto
Yea, I found it as an Action, but not as a Condition.
08-01-2003, 06:48 AM#12
element_5
Real Comparison - X of Point
Real Comparison - Y of Point
08-01-2003, 07:04 AM#13
Panto
element_5, I need to be able to refer to the point to get the coords of it. I haven't found a way to do that yet.
08-01-2003, 07:48 AM#14
element_5
I don't quite understand. When the setrally command is issued, set a variable of type Point to the Event Response - Target Point of Issued Order. Then you can use the "X of" and "Y of" the variable in a condition. You can also use the "X of" and "Y of" in a condition in conjunction with Event Response - Target Point of Issued Order.
08-01-2003, 08:21 AM#15
Panto
Well, yea.








Sheesh, duh, Panto.