sentrywiz
S
sentrywiz
This is my attempt to make a straight-line projectile. I've used this from somewhere, already pre-made by someone but have forgotten how it was made. So I tried to figure it out on my own, and got it to work for the most part, however:
1) It casts only once. After that one cast, the dummy just appears and stands in place.
2) The missile is moving pretty slowly. Is it either the time but I doubt it (0.05 sec) or the offset value.
Triggers:
EDIT: Nvm I figured it out myself
Close this thread.
1) It casts only once. After that one cast, the dummy just appears and stands in place.
2) The missile is moving pretty slowly. Is it either the time but I doubt it (0.05 sec) or the offset value.
Triggers:
-
Spear Launch
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Spear Throw (A)
-
Actions
- Set spear_thrower = (Casting unit)
- Set loc_start = (Position of spear_thrower)
- Set loc_end = (Target point of ability being cast)
- Unit - Create 1 The Spear for (Owner of spear_thrower) at loc_start facing (Facing of spear_thrower) degrees
- Set the_spear = (Last created unit)
- Unit Group - Add the_spear to spear_group
- Set total_spears = (total_spears + 1)
- Custom script: call RemoveLocation ( udg_loc_start )
- Custom script: call RemoveLocation ( udg_loc_end )
-
Events
-
Move Spear
-
Events
- Time - Every 0.05 seconds of game time
- Conditions
-
Actions
-
Unit Group - Pick every unit in spear_group and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in spear_group) Greater than 0
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- spear_range_ctr Less than 500
-
Then - Actions
- Set moving_spear = (Picked unit)
- Set loc_move = (Position of moving_spear)
- Set spear_hit = (Units within 130.00 of loc_move matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of moving_spear)) Equal to True)))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in spear_hit) Greater than 0
-
Then - Actions
- Unit - Cause moving_spear to damage (Random unit from spear_hit), dealing 100.00 damage of attack type Pierce and damage type Normal
- Unit Group - Remove moving_spear from spear_group
- Set total_spears = (total_spears - 1)
- Unit - Kill moving_spear
-
Else - Actions
- Set spear_range_ctr = (spear_range_ctr + 25)
- Unit - Move moving_spear instantly to (loc_move offset by 25.00 towards (Facing of moving_spear) degrees), facing (Facing of moving_spear) degrees
-
If - Conditions
- Custom script: call RemoveLocation ( udg_loc_move )
- Custom script: call DestroyGroup ( udg_spear_hit )
-
Else - Actions
- Unit Group - Remove moving_spear from spear_group
- Set total_spears = (total_spears - 1)
- Unit - Kill moving_spear
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Unit Group - Pick every unit in spear_group and do (Actions)
-
Events
EDIT: Nvm I figured it out myself
Close this thread.
Last edited by a moderator: