- Joined
- Aug 19, 2007
- Messages
- 109
Here is an ability i'm working on:
-There is no need for "Do nothing" at end but i like to put it there.. make me feel better.
-EC is a unit variable which is the same throughout the entire game.
-There only is 1 EC.
-the order clusterrockets is basically the same as saying "ability being cast is equal to Scatter Arrows"- as i put the order string to "clusterrockets"
-Archers have 2400 range, so they should never be out of range as ability has a casting range of 1750.
---Everthing works fine EXCEPT:
-I noticed only 1 of the 6/12/18/24 archers actually attacks ground like their meant to, the rest just attack center of playable map area(meaning something is wrong)
-Ability is meant to:
=Create 6/12/18/24 archers at random spots behind the hero (50 degrees left+right offset by 100-350 or something)
=Then order each archer to attack ground in a random spot where the order(ability) has been targetted (casted)
=Also expiration timer stops the archers from firing twice
This may seem a bit complicated D:. Please help and explain why archers arent ALL attacking ground in random spots around targetted order area.


Edit:I theorise that the problem lies in "set Temp_Point2" coz thats where i want archers to fire at which only 1 fires at D:.
-
Scatter Arrows
-
Events
-
Unit - A unit Is issued an order targeting a point
-
-
Conditions
-
(Issued order) Equal to (Order(clusterrockets))
-
(Ordered unit) Equal to EC
-
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of Scatter Arrows (Dummy Cluster Rockets) for EC) Equal to 1
-
-
Then - Actions
-
For each (Integer A) from 1 to 6, do (Actions)
-
Loop - Actions
-
Set Temp_Point = ((Position of EC) offset by (Random real number between 100.00 and 350.00) towards (Random real number between (((Facing of EC) - 180.00) + 50.00) and (((Facing of EC) - 180.00) - 50.00)) degrees)
-
Set Temp_Point2 = ((Target point of issued order) offset by (Random real number between 0.00 and 400.00) towards (Random angle) degrees)
-
Unit - Create 1 Archer (Elven Cmdr) for (Owner of EC) at Temp_Point facing (Facing of EC) degrees
-
Unit - Order (Last created unit) to Attack Ground Temp_Point2
-
Unit - Add a 1.80 second Generic expiration timer to (Last created unit)
-
Custom script: call RemoveLocation (udg_Temp_Point)
-
Custom script: call RemoveLocation (udg_Temp_Point2)
-
-
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of Scatter Arrows (Dummy Cluster Rockets) for EC) Equal to 2
-
-
Then - Actions
-
For each (Integer A) from 1 to 12, do (Actions)
-
Loop - Actions
-
Set Temp_Point = ((Position of EC) offset by (Random real number between 100.00 and 350.00) towards (Random real number between (((Facing of EC) - 180.00) + 50.00) and (((Facing of EC) - 180.00) - 50.00)) degrees)
-
Set Temp_Point2 = ((Target point of issued order) offset by 400.00 towards (Random angle) degrees)
-
Unit - Create 1 Archer (Elven Cmdr) for (Owner of EC) at Temp_Point facing (Facing of EC) degrees
-
Unit - Order (Last created unit) to Attack Ground Temp_Point2
-
Unit - Add a 1.80 second Generic expiration timer to (Last created unit)
-
Custom script: call RemoveLocation (udg_Temp_Point)
-
Custom script: call RemoveLocation (udg_Temp_Point2)
-
-
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of Scatter Arrows (Dummy Cluster Rockets) for EC) Equal to 3
-
-
Then - Actions
-
For each (Integer A) from 1 to 18, do (Actions)
-
Loop - Actions
-
Set Temp_Point = ((Position of EC) offset by (Random real number between 100.00 and 350.00) towards (Random real number between (((Facing of EC) - 180.00) + 50.00) and (((Facing of EC) - 180.00) - 50.00)) degrees)
-
Set Temp_Point2 = ((Target point of issued order) offset by 400.00 towards (Random angle) degrees)
-
Unit - Create 1 Archer (Elven Cmdr) for (Owner of EC) at Temp_Point facing (Facing of EC) degrees
-
Unit - Order (Last created unit) to Attack Ground Temp_Point2
-
Unit - Add a 1.80 second Generic expiration timer to (Last created unit)
-
Custom script: call RemoveLocation (udg_Temp_Point)
-
Custom script: call RemoveLocation (udg_Temp_Point2)
-
-
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of Scatter Arrows (Dummy Cluster Rockets) for EC) Equal to 4
-
-
Then - Actions
-
For each (Integer A) from 1 to 24, do (Actions)
-
Loop - Actions
-
Set Temp_Point = ((Position of EC) offset by (Random real number between 100.00 and 350.00) towards (Random real number between (((Facing of EC) - 180.00) + 50.00) and (((Facing of EC) - 180.00) - 50.00)) degrees)
-
Set Temp_Point2 = ((Target point of issued order) offset by 400.00 towards (Random angle) degrees)
-
Unit - Create 1 Archer (Elven Cmdr) for (Owner of EC) at Temp_Point facing (Facing of EC) degrees
-
Unit - Order (Last created unit) to Attack Ground Temp_Point2
-
Unit - Add a 1.80 second Generic expiration timer to (Last created unit)
-
Custom script: call RemoveLocation (udg_Temp_Point)
-
Custom script: call RemoveLocation (udg_Temp_Point2)
-
-
-
-
Else - Actions
-
Do nothing
-
-
-
-
-
-
-
-
-
-
-There is no need for "Do nothing" at end but i like to put it there.. make me feel better.
-EC is a unit variable which is the same throughout the entire game.
-There only is 1 EC.
-the order clusterrockets is basically the same as saying "ability being cast is equal to Scatter Arrows"- as i put the order string to "clusterrockets"
-Archers have 2400 range, so they should never be out of range as ability has a casting range of 1750.
---Everthing works fine EXCEPT:
-I noticed only 1 of the 6/12/18/24 archers actually attacks ground like their meant to, the rest just attack center of playable map area(meaning something is wrong)
-Ability is meant to:
=Create 6/12/18/24 archers at random spots behind the hero (50 degrees left+right offset by 100-350 or something)
=Then order each archer to attack ground in a random spot where the order(ability) has been targetted (casted)
=Also expiration timer stops the archers from firing twice
This may seem a bit complicated D:. Please help and explain why archers arent ALL attacking ground in random spots around targetted order area.



Edit:I theorise that the problem lies in "set Temp_Point2" coz thats where i want archers to fire at which only 1 fires at D:.