HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Placement with offset

04-28-2006, 09:22 AM#1
Hemlock
I can't seem to fix this little issue I have

I made a trigger in which units spawn every 0.5 seconds on a different location with this action.
Trigger:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Number_tempcasterpoint Less than 7
Collapse Then - Actions
Unit - Create 1 Peasant for Player 1 (Red) at TempCasterpoint[Number_tempcasterpoint] facing Default building facing degrees
Set Number_tempcasterpoint = (Number_tempcasterpoint + 1)
Else - Actions

The temppoint look like this
Trigger:
Set TempCasterpoint[0] = (((Position of Casterunit1) offset by 128.00 towards 270.00 degrees) offset by Distance_eyefromcenter[0] towards Angle_eye[0] degrees)
Set TempCasterpoint[1] = (((Position of Casterunit1) offset by 128.00 towards 270.00 degrees) offset by Distance_eyefromcenter[0] towards Angle_eye[1] degrees)
(these are set in a trigger with Map initialization)

Now is my problem that they are placed in the middle of the map instead of on my temppoint.

anyone see the problem?
04-28-2006, 09:51 AM#2
iNfraNe
CasterUnit1 is prolly not set to a unit.
04-28-2006, 10:00 AM#3
Hemlock
This is a piece of the variable set trigger
Trigger:
Variable set
Collapse Events
Map initialization
Conditions
Collapse Actions
Set Casterunit1 = Demon Hunter 0000 <gen>
Set Distance_eyefromcenter[1] = 256.00
04-28-2006, 10:11 AM#4
vile
i cant see you setting Angle_eye[0] and Angle_eye[1]
04-28-2006, 10:17 AM#5
Hemlock
sorry, forgot to post the whole trigger
Trigger:
Variable set
Collapse Events
Map initialization
Conditions
Collapse Actions
Set Casterunit1 = Demon Hunter 0000 <gen>
Set Casterunit2 = Demon Hunter 0001 <gen>
Set Angle_eye[0] = 0.00
Set Angle_eye[1] = 90.00
Set Angle_eye[2] = 180.00
Set Angle_eye[3] = 270.00
Set Angle_eye[4] = 0.00
Set Angle_eye[5] = 90.00
Set Angle_eye[6] = 180.00
Set Angle_eye[7] = 270.00
Set Distance_eyefromcenter[0] = 256.00
Set Distance_eyefromcenter[1] = 256.00
04-28-2006, 11:19 AM#6
MaD[Lion]
u can try to create a unit in the CasterUnit1's position without offset first, if this position doesn't work then the problem is the casterunit1's position, else its the wrong calculation of the offset.

This is how i debug stuff
04-28-2006, 11:57 AM#7
Hemlock
got it working now.

guess I made an error when putting the caster unit variable and the temppoint variable in different melee inits triggers.
04-28-2006, 04:50 PM#8
Captain Griffen
In GUI do arrays start from 0 or 1 (if it is from 0, then the variable size is actually one more than it says)?

For future refence, it's best not to use more than one melee initialisation trigger, unless they are completely independant, so you can be sure they run properly and in the right order. No point in having more than one anyway, really.
04-28-2006, 07:58 PM#9
Hemlock
Its common sense to not have more than one melee inits triggers cause you can simply turn on a trigger without an event, in the melee inits trigger.
That way you can organize your actions and triggers but still have them activated in the early start of the game.

I just forgot it, well kinda overlooked.

to answer your variable question, it jumps of with 0 as default, but I can pre set it to 1 if I like.
I mainly keep it to the default since I do not really find it troublesome to work from zero.
04-28-2006, 09:39 PM#10
Captain Griffen
Just wondering, as I know player IDs use 1-16, even though they use 0-15 for the numbers. Also because I've had no trouble going up to 5 on an array of size 5, even though that would be 0-4 if it started at 0.