zaqer50
TH.net Regular
- Reaction score
- 3
Here's my problem: I've got an integer (CopterNumber) that keeps track of how many times my spell has been cast so that it makes sure it's always giving the commands to the proper variables. All the variables are arrays that use CopterNumber as their Index(I think this is what I should be doing).
So it works for all the code, besides when it comes to the timers. It lets me use CopterNumber when I'm creating the timer, but not to detect when that timer expires(The lines of code are bolded). I have no idea. I tried making CopterNumber a Real variable, and then converting it to an integer, but it won't let me do that either.
Any help is much appreciated and I'll give some rep to anyone who manages to help me
So it works for all the code, besides when it comes to the timers. It lets me use CopterNumber when I'm creating the timer, but not to detect when that timer expires(The lines of code are bolded). I have no idea. I tried making CopterNumber a Real variable, and then converting it to an integer, but it won't let me do that either.
Any help is much appreciated and I'll give some rep to anyone who manages to help me
Code:
Fly In
Events
Time - Elapsed game time is 5.00 seconds
Conditions
Actions
-------- Setup Variables and Create Copter --------
Unit - Create 1 Flying Machine for CopterOwner[CopterNumber] at (Target[CopterNumber] offset by 1000.00 towards (Random real number between 0.00 and 360.00) degrees) facing Target[CopterNumber]
Set Copter[CopterNumber] = (Last created unit)
Unit - Turn collision for Copter[CopterNumber] Off
Set Angle[CopterNumber] = (Angle from Target[CopterNumber] to (Position of Copter[CopterNumber]))
Animation - Change Copter[CopterNumber] flying height to 1000.00 at 0.00
-------- Attack Run --------
Unit - Order Copter[CopterNumber] to Move To Target[CopterNumber]
Animation - Change Copter[CopterNumber] flying height to 280.00 at 500.00
[B]Countdown Timer - Start StartFlyOff as a One-shot timer that will expire in 1.50 seconds[/B]
Code:
Fly Out
Events
[B]Time - StartFlyOff[Index] expires[/B]
Conditions
Actions
Unit - Order Copter[CopterNumber] to Move To (Target[CopterNumber] offset by 1000.00 towards (Angle[CopterNumber] + 180.00) degrees)
Animation - Change Copter[CopterNumber] flying height to 1000.00 at 400.00