Hi! I'm sorry if the title wasn't so understandable or something. I'm not really good at English.
So. I have this simple spell idea where a hawk follows the Hero wherever it goes, the problem is the "move to " command is issued every x periodic time which makes the hawk slower and it looks bad - the hawk just repeating the walk animation every time.
I'm just new to this kind of stuff and just taught myself how to do it by looking at sample triggers so i don't know much of it
I'm very willing to learn something new every day to improve myself
That's all thanks
So here is the code:
learn:
walk command loop
as you may noticed, Regal_walkcommand is unused, because I've tried something like this :
failed try:
obviously, it just made things worse
Thanks for the help.
So. I have this simple spell idea where a hawk follows the Hero wherever it goes, the problem is the "move to " command is issued every x periodic time which makes the hawk slower and it looks bad - the hawk just repeating the walk animation every time.
I'm just new to this kind of stuff and just taught myself how to do it by looking at sample triggers so i don't know much of it
So here is the code:
learn:
-
Regal hawk learn
-
Events
-
Unit - A unit Learns a skill
-
-
Conditions
-
(Learned Hero Skill) Equal to Regal Hawk
-
-
Actions
-
Set Ranger_hawk_max = (Ranger_hawk_max + 1)
-
Set Regal_hawk_unit[Ranger_hawk_max] = (Learning Hero)
-
-------- creating the hawk --------
-
Unit - Create 1 Hawk for (Owner of Regal_hawk_unit[Ranger_hawk_loop]) at (Position of Regal_hawk_unit[Ranger_hawk_loop]) facing Default building facing degrees
-
Set Ranger_hawk[Ranger_hawk_loop] = (Last created unit)
-
-------- setting the bools --------
-
Set Regal_hawk_free[Ranger_hawk_max] = True
-
Set Regal_hawk_walking[Ranger_hawk_max] = False
-
Set Regal_walkcommand[Ranger_hawk_max] = 0.00
-
-
-
Regal hawk walk
-
Events
-
Time - Every 0.05 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer Ranger_hawk_loop) from 1 to Ranger_hawk_max, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Regal_hawk_free[Ranger_hawk_loop] Equal to True
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Regal_hawk_unit[Ranger_hawk_max] is alive) Equal to True
-
-
Then - Actions
-
Set Regal_hawk_unitloc[Ranger_hawk_loop] = (Position of Regal_hawk_unit[Ranger_hawk_loop])
-
Set Regal_hawkloc[Ranger_hawk_loop] = (Position of Ranger_hawk[Ranger_hawk_loop])
-
Set Regal_hawkdistance[Ranger_hawk_loop] = (Distance between Regal_hawk_unitloc[Ranger_hawk_loop] and Regal_hawkloc[Ranger_hawk_loop])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
Regal_hawkdistance[Ranger_hawk_loop] Less than or equal to Regal_hawk_walkvar
-
-
-
-
Then - Actions
-
Set Regal_hawk_walking[Ranger_hawk_loop] = False
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
And - All (Conditions) are true
-
Conditions
-
Regal_hawkdistance[Ranger_hawk_loop] Greater than Regal_hawk_walkvar
-
-
-
-
Then - Actions
-
Set Regal_hawk_walking[Ranger_hawk_loop] = True
-
Unit - Order Ranger_hawk[Ranger_hawk_loop] to Move To Regal_hawk_unitloc[Ranger_hawk_loop]
-
-
Else - Actions
-
-
-
-
Custom script: call RemoveLocation(udg_Regal_hawk_unitloc[udg_Ranger_hawk_loop])
-
Custom script: call RemoveLocation(udg_Regal_hawkloc[udg_Ranger_hawk_loop])
-
-
Else - Actions
-
-
-
Else - Actions
-
-
-
-
-
as you may noticed, Regal_walkcommand is unused, because I've tried something like this :
failed try:
-
Actions
-
For each (Integer Ranger_hawk_loop) from 1 to Ranger_hawk_max, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Regal_hawk_free[Ranger_hawk_loop] Equal to True
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Regal_hawk_unit[Ranger_hawk_max] is alive) Equal to True
-
-
Then - Actions
-
Set Regal_hawk_unitloc[Ranger_hawk_loop] = (Position of Regal_hawk_unit[Ranger_hawk_loop])
-
Set Regal_hawkloc[Ranger_hawk_loop] = (Position of Ranger_hawk[Ranger_hawk_loop])
-
Set Regal_hawkdistance[Ranger_hawk_loop] = (Distance between Regal_hawk_unitloc[Ranger_hawk_loop] and Regal_hawkloc[Ranger_hawk_loop])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
Regal_hawkdistance[Ranger_hawk_loop] Less than or equal to Regal_hawk_walkvar
-
-
-
-
Then - Actions
-
Set Regal_hawk_walking[Ranger_hawk_loop] = False
-
Set Regal_walkcommand[Ranger_hawk_loop] = 0.00
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
And - All (Conditions) are true
-
Conditions
-
Regal_hawkdistance[Ranger_hawk_loop] Greater than Regal_hawk_walkvar
-
Regal_walkcommand[Ranger_hawk_loop] Less than 2.00
-
-
-
-
Then - Actions
-
Set Regal_hawk_walking[Ranger_hawk_loop] = True
-
Unit - Order Ranger_hawk[Ranger_hawk_loop] to Move To Regal_hawk_unitloc[Ranger_hawk_loop]
-
Set Regal_walkcommand[Ranger_hawk_loop] = 2.00
-
-
Else - Actions
-
-
-
-
Custom script: call RemoveLocation(udg_Regal_hawk_unitloc[udg_Ranger_hawk_loop])
-
Custom script: call RemoveLocation(udg_Regal_hawkloc[udg_Ranger_hawk_loop])
-
-
Else - Actions
-
-
-
Else - Actions
-
-
-
-
obviously, it just made things worse
Thanks for the help.