- Joined
- Dec 22, 2008
- Messages
- 207
Okay, so it's pretty basic. I'm using a missile system by Kingz and I wanted to implement terrain height detection. I'm probably over-thinking things, but I can't seem to get it to work properly.
Breakdown: I'm trying to get missiles that don't have a parabola (since one can choose if a missile will have a parabola or not), to descend or ascend according to the z-height of the target point terrain.
Right now however, the projectiles are handled through ONLY their flying height (so not according to terrain height).
Note: The missiles have to be flying in a straight line towards the z height of the target terrain. In the test map they can be seen 'hopping' over ditches and slightly ascending as they reach hills. This is obviously not what I meant to do.
EDIT:
Added triggers
Take note; the only thing I changed in the "Initialize" and "Loop" triggers are anything 'z height' related.
Please help. Anyone. <3
Breakdown: I'm trying to get missiles that don't have a parabola (since one can choose if a missile will have a parabola or not), to descend or ascend according to the z-height of the target point terrain.
Right now however, the projectiles are handled through ONLY their flying height (so not according to terrain height).
Note: The missiles have to be flying in a straight line towards the z height of the target terrain. In the test map they can be seen 'hopping' over ditches and slightly ascending as they reach hills. This is obviously not what I meant to do.
EDIT:
Added triggers
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Fire
-
-
Actions
-
Set MS_dmg_source = (Casting unit)
-
Set MS_owner = (Owner of (Casting unit))
-
Set MS_create_point = (Position of (Casting unit))
-
Set MS_target_point = (MS_create_point offset by 4000.00 towards (Angle from MS_create_point to (Target point of ability being cast)) degrees)
-
Set MS_damage = 30.00
-
Set MS_seconds_to_reach = 2.50
-
Set MS_angle = (Angle from MS_create_point to MS_target_point)
-
Set MS_distance = (Distance between MS_create_point and MS_target_point)
-
Set MS_missile_gfx = war3mapImported\HighSpeedProjectile_ByEpsilon.mdl
-
Set MS_impact_gfx = Abilities\Weapons\Rifle\RifleImpact.mdl
-
Set MS_unit_hit_eff = Abilities\Weapons\HydraliskImpact\HydraliskImpact.mdl
-
Set MS_effect = 1
-
Set MS_arcs = False
-
-------- If MS_arc = true aply the following settings --------
-
Set MS_arc_dist = 200.00
-
Set MS_arc_type = (Integer A)
-
-------- --- --------
-
Set MS_parabola = False
-
-------- If MS_parabola = true aply the following settings --------
-
Set MS_parabola_height = 650.00
-
-------- --- --------
-
Trigger - Run MS init <gen> (ignoring conditions)
-
Custom script: call RemoveLocation(udg_MS_create_point)
-
Custom script: call RemoveLocation(udg_MS_target_point)
-
-
Events
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MS_index[1] Equal to 0
-
-
Then - Actions
-
Set MS_dyn_index = 0
-
Trigger - Turn on MS loop <gen>
-
-
Else - Actions
-
-
Set MS_index[1] = (MS_index[1] + 1)
-
Set MS_index_selected = False
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MS_dyn_index Less than MS_index[2]
-
MS_dyn_index Not equal to 0
-
MS_empty_index[MS_dyn_index] Equal to True
-
-
Then - Actions
-
Set MS_index_selected = True
-
-
Else - Actions
-
For each (Integer MS_index[0]) from 1 to MS_index[2], do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MS_empty_index[MS_index[0]] Equal to True
-
MS_index_selected Equal to False
-
-
Then - Actions
-
Set MS_dyn_index = MS_index[0]
-
Set MS_index_selected = True
-
-
Else - Actions
-
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MS_index_selected Equal to False
-
-
Then - Actions
-
Set MS_index[2] = (MS_index[2] + 1)
-
Set MS_dyn_index = MS_index[2]
-
-
Else - Actions
-
-
-
-
Set MS_empty_index[MS_dyn_index] = False
-
Unit - Create 1 Dummy/Missile for MS_owner at MS_create_point facing MS_angle degrees
-
Unit - Add Storm Crow Form to (Last created unit)
-
Unit - Remove Storm Crow Form from (Last created unit)
-
Unit - Turn collision for (Last created unit) Off
-
Unit - Move (Last created unit) instantly to MS_create_point
-
Special Effect - Create a special effect attached to the chest of (Last created unit) using MS_missile_gfx
-
Set MS_missile_eff[MS_dyn_index] = (Last created special effect)
-
Set MS_missile[MS_dyn_index] = (Last created unit)
-
Set MS_dmg_source_ex[MS_dyn_index] = MS_dmg_source
-
Set MS_distance_max[MS_dyn_index] = MS_distance
-
Set MS_angle_ex[MS_dyn_index] = MS_angle
-
Set MS_speed_ex[MS_dyn_index] = ((MS_distance_max[MS_dyn_index] / MS_seconds_to_reach) x 0.03)
-
Set MS_player_check[MS_dyn_index] = MS_owner
-
Set MS_damage_ex[MS_dyn_index] = MS_damage
-
Set MS_arcs_ex[MS_dyn_index] = MS_arcs
-
Set MS_parabola_ex[MS_dyn_index] = MS_parabola
-
Set MS_impact_gfx_ex[MS_dyn_index] = MS_impact_gfx
-
Set MS_unit_hit_eff_ex[MS_dyn_index] = MS_unit_hit_eff
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MS_effect Equal to 1
-
-
Then - Actions
-
Set MS_effect_ex[MS_dyn_index] = MS_effect
-
Animation - Change (Last created unit)'s size to (20.00%, 20.00%, 20.00%) of its original size
-
Custom script: set udg_MS_calc_real[1] = GetLocationZ(udg_MS_create_point)
-
Animation - Change (Last created unit) flying height to (MS_calc_real[1] + 45.00) at 0.00
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MS_arc_type Equal to 1
-
-
Then - Actions
-
Set MS_arc_core_angle[MS_dyn_index] = (MS_angle_ex[MS_dyn_index] + 90.00)
-
Set MS_arc_distance_ex[MS_dyn_index] = MS_arc_dist
-
-
Else - Actions
-
Set MS_arc_core_angle[MS_dyn_index] = (MS_angle_ex[MS_dyn_index] - 90.00)
-
Set MS_arc_distance_ex[MS_dyn_index] = MS_arc_dist
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MS_parabola Equal to True
-
-
Then - Actions
-
Set MS_parabola_height_ex[MS_dyn_index] = MS_parabola_height
-
-
Else - Actions
-
Set MS_parabola_height_ex[MS_dyn_index] = (Current flying height of MS_missile[MS_dyn_index])
-
-
-
Set MS_distance_current[MS_dyn_index] = 0.00
-
Set MS_calc_real[1] = (X of MS_create_point)
-
Set MS_calc_real[2] = (Y of MS_create_point)
-
Set MS_calc_real[3] = (X of MS_target_point)
-
Set MS_calc_real[4] = (Y of MS_target_point)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MS_calc_real[1] Equal to MS_calc_real[3]
-
MS_calc_real[2] Equal to MS_calc_real[4]
-
-
Then - Actions
-
Set MS_speed_ex[MS_dyn_index] = 10.00
-
Set MS_distance_max[MS_dyn_index] = MS_speed_ex[MS_dyn_index]
-
-
Else - Actions
-
-
Set MS_build_point[MS_dyn_index] = (Position of MS_missile[MS_dyn_index])
-
Set MS_get_X[MS_dyn_index] = (X of MS_build_point[MS_dyn_index])
-
Set MS_get_Y[MS_dyn_index] = (Y of MS_build_point[MS_dyn_index])
-
Custom script: call RemoveLocation(udg_MS_build_point[udg_MS_dyn_index])
-
-
Events
-
Time - Every 0.03 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer MS_index[3]) from 1 to MS_index[2], do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MS_missile[MS_index[3]] Not equal to No unit
-
-
Then - Actions
-
Set MS_temp_point[0] = (Point(MS_get_X[MS_index[3]], MS_get_Y[MS_index[3]]))
-
Set MS_temp_point[1] = (Position of MS_missile[MS_index[3]])
-
Set MS_distance_current[MS_index[3]] = (MS_distance_current[MS_index[3]] + MS_speed_ex[MS_index[3]])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MS_arcs_ex[MS_index[3]] Equal to True
-
-
Then - Actions
-
Set MS_calc_real[1] = MS_arc_distance_ex[MS_index[3]]
-
Set MS_calc_real[2] = MS_distance_max[MS_index[3]]
-
Set MS_calc_real[3] = MS_distance_current[MS_index[3]]
-
Custom script: set udg_MS_calc_real[4] = ( 4 * udg_MS_calc_real[1] / udg_MS_calc_real[2] ) * ( udg_MS_calc_real[2] - udg_MS_calc_real[3] ) * ( udg_MS_calc_real[3] / udg_MS_calc_real[2] )
-
Set MS_temp_point[2] = (MS_temp_point[0] offset by MS_speed_ex[MS_index[3]] towards MS_angle_ex[MS_index[3]] degrees)
-
Set MS_temp_point[3] = (MS_temp_point[2] offset by MS_calc_real[4] towards MS_arc_core_angle[MS_index[3]] degrees)
-
Set MS_calc_real[5] = (Angle from MS_temp_point[1] to MS_temp_point[3])
-
Unit - Move MS_missile[MS_index[3]] instantly to MS_temp_point[3], facing MS_calc_real[5] degrees
-
Set MS_build_point[MS_index[3]] = (MS_temp_point[0] offset by MS_speed_ex[MS_index[3]] towards MS_angle_ex[MS_index[3]] degrees)
-
Set MS_get_X[MS_index[3]] = (X of MS_build_point[MS_index[3]])
-
Set MS_get_Y[MS_index[3]] = (Y of MS_build_point[MS_index[3]])
-
Custom script: call RemoveLocation(udg_MS_temp_point[2])
-
Custom script: call RemoveLocation(udg_MS_temp_point[3])
-
Custom script: call RemoveLocation(udg_MS_build_point[udg_MS_index[3]])
-
-
Else - Actions
-
Set MS_temp_point[2] = (MS_temp_point[1] offset by MS_speed_ex[MS_index[3]] towards MS_angle_ex[MS_index[3]] degrees)
-
Unit - Move MS_missile[MS_index[3]] instantly to MS_temp_point[2], facing MS_angle_ex[MS_index[3]] degrees
-
Custom script: call RemoveLocation(udg_MS_temp_point[2])
-
-
-
Custom script: set udg_MS_calc_real[1] = GetLocationZ(udg_MS_temp_point[1])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MS_calc_real[1] Greater than MS_last_zheight_ex[MS_index[3]]
-
-
Then - Actions
-
Set MS_calc_real[2] = (MS_calc_real[1] - MS_last_zheight_ex[MS_index[3]])
-
Animation - Change MS_missile[MS_index[3]] flying height to ((Current flying height of MS_missile[MS_index[3]]) - MS_calc_real[2]) at 0.00
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MS_calc_real[1] Less than MS_last_zheight_ex[MS_index[3]]
-
-
Then - Actions
-
Set MS_calc_real[2] = (MS_last_zheight_ex[MS_index[3]] - MS_calc_real[1])
-
Animation - Change MS_missile[MS_index[3]] flying height to ((Current flying height of MS_missile[MS_index[3]]) + MS_calc_real[2]) at 0.00
-
-
Else - Actions
-
-
Custom script: set udg_MS_last_zheight_ex[udg_MS_index[3]] = GetLocationZ(udg_MS_temp_point[1])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MS_parabola_ex[MS_index[3]] Equal to True
-
-
Then - Actions
-
Set MS_calc_real[1] = MS_parabola_height_ex[MS_index[3]]
-
Set MS_calc_real[2] = MS_distance_max[MS_index[3]]
-
Set MS_calc_real[3] = MS_distance_current[MS_index[3]]
-
Custom script: set udg_MS_calc_real[4] = ( 4 * udg_MS_calc_real[1] / udg_MS_calc_real[2] ) * ( udg_MS_calc_real[2] - udg_MS_calc_real[3] ) * ( udg_MS_calc_real[3] / udg_MS_calc_real[2] )
-
Animation - Change MS_missile[MS_index[3]] flying height to MS_calc_real[4] at 0.00
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Current flying height of MS_missile[MS_index[3]]) Less than or equal to 2.00
-
-
Then - Actions
-
Set MS_distance_current[MS_index[3]] = MS_distance_max[MS_index[3]]
-
-
Else - Actions
-
-
Set MS_temp_point[4] = (Position of MS_missile[MS_index[3]])
-
Custom script: if udg_MS_temp_group[udg_MS_index[3]] == null then
-
Custom script: set udg_MS_temp_group[udg_MS_index[3]] = CreateGroup()
-
Custom script: endif
-
Set MS_temp_group[MS_index[3]] = (Units within 40.00 of MS_temp_point[4] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of MS_player_
-
Unit Group - Pick every unit in MS_temp_group[MS_index[3]] and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Current flying height of MS_missile[MS_index[3]]) - (Current flying height of (Picked unit))) Less than 50.00
-
((Current flying height of MS_missile[MS_index[3]]) - (Current flying height of (Picked unit))) Greater than -50.00
-
-
Then - Actions
-
Unit - Cause MS_dmg_source_ex[MS_index[3]] to damage (Picked unit), dealing MS_damage_ex[MS_index[3]] damage of attack type Spells and damage type Normal
-
Special Effect - Create a special effect attached to the chest of (Picked unit) using MS_unit_hit_eff_ex[MS_index[3]]
-
Special Effect - Destroy (Last created special effect)
-
-
Else - Actions
-
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(MS_temp_group[MS_index[3]] is empty) Equal to False
-
-
Then - Actions
-
Set MS_distance_current[MS_index[3]] = MS_distance_max[MS_index[3]]
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MS_distance_current[MS_index[3]] Greater than or equal to MS_distance_max[MS_index[3]]
-
-
Then - Actions
-
Custom script: set udg_MS_last_zheight_ex[udg_MS_index[3]] = 0.0
-
Special Effect - Destroy MS_missile_eff[MS_index[3]]
-
Special Effect - Create a special effect at MS_temp_point[4] using MS_impact_gfx_ex[MS_index[3]]
-
Special Effect - Destroy (Last created special effect)
-
Unit - Remove MS_missile[MS_index[3]] from the game
-
Custom script: set udg_MS_missile[udg_MS_index[3]] = null
-
Set MS_index[1] = (MS_index[1] - 1)
-
Set MS_empty_index[MS_index[3]] = True
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MS_index_selected Equal to False
-
-
Then - Actions
-
Set MS_dyn_index = MS_index[3]
-
Set MS_index_selected = True
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MS_index[3] Equal to MS_index[2]
-
MS_index[1] Not equal to 0
-
-
Then - Actions
-
Set MS_index[2] = (MS_index[2] - 1)
-
-
Else - Actions
-
-
-
Else - Actions
-
-
Custom script: call DestroyGroup(udg_MS_temp_group[udg_MS_index[3]])
-
Custom script: set udg_MS_temp_group[udg_MS_index[3]] = null
-
Custom script: call RemoveLocation(udg_MS_temp_point[0])
-
Custom script: call RemoveLocation(udg_MS_temp_point[1])
-
Custom script: call RemoveLocation(udg_MS_temp_point[4])
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MS_index[3] Equal to MS_index[2]
-
MS_index[1] Not equal to 0
-
-
Then - Actions
-
Set MS_index[2] = (MS_index[2] - 1)
-
-
Else - Actions
-
-
-
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MS_index[1] Equal to 0
-
-
Then - Actions
-
Set MS_index[2] = 0
-
Set MS_dyn_index = 0
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
-
Take note; the only thing I changed in the "Initialize" and "Loop" triggers are anything 'z height' related.
Please help. Anyone. <3
Attachments
Last edited: