So I am trying to create a trigger that will change the units 'Moveable' state when the ability is activated by an auto-cast. I have been reading and properly implementing lots of things but I seem to be stuck on this one.
Maybe there is another way to go about this but I don't want to have to morph the unit into another unit because I feel like it could be done simply with triggers. Any thoughts? (also I don't know how to extrat the text of my triggers so I took a screenshot).
i feel that it is your condition in the If Statement
Car Ignition is Enabled for (Triggering unit) == true
What are you testing?
is the ability toggle-able?
EDIT:
I usually do it like this
Global Variable:
IgnitionBoolean[15] = False
If (Conditions) then do (Actions) else do (Actions)
>If
>>IgnitionBoolean[(Owner of (Triggering Unit))] == False
>Then
>>Set Variable IgnitionBoolean[(Owner of (Triggering Unit))] == True
>>Other Actions
>Else
>>If (Conditions) then do (Actions) else do (Actions)
>>If
>>>IgnitionBoolean[(Owner of (Triggering Unit))] == True
>>Then
>>>Set Variable IgnitionBoolean[(Owner of (Triggering Unit))] == False
>>>Other Actions
>>Else
Yes, the ability is toggle-able if by that you mean it auto-casts on and off. I want when the auto-cast is turned on, that the car is set with a movable flag. When it's disabled it removes the removable flag. The function Ability Enabled does have presets for true and false so I thought it would work.
If I'm correct you want me to use a variable in the If statement instead of the ability itself, and have it check if the ability is enabled then turn it off and if off turn it on, as well as the other functions. I will try that as soon as I'm able too. Thanks again.
Edit your Car Ignition auto-cast ability to have a .5 second cool down
Have the car's movement speed set to 0 in the data editor
Create a behavior called "Car Ignition On", and change the field in the new behavior window from Attribute to Buff.
Max stack count to 3
Duration to .6 second
Movement: Movement Speed Bonus to <whatever you want the speed to be>
Now, in your trigger, when the auto cast ability is fired, Apply your "Car Ignition On" Behavior to your triggering unit. It will add a new .6 seconds to the car's ignition. When .6 seconds pass, that buff will be removed and the car will be unable to move. However, if the auto cast is still on, and was cast within the past .6 seconds, the Buff will have been renewed, and the car will continue on after even the old buff has been removed because of the new one that was applied in the meantime. If the Auto Cast is disabled, within anywhere from 0 to 0.6 seconds later, the car will stop.
This method will keep the car moving just as long as the ignition is cast within the past .5 seconds. You can make this time smaller to make the accuracy higher, the smaller it is, the more CPU it takes (but honestly, you can set it to 0.07, and the buff duration to 0.08 and it will work just the same, unless you have 600 cars at once).
Just remember to always have your buff duration a little longer than your Auto Cast cooldown. Otherwise, the buff will run out at the exact same time as the ability is cast, and it might make the vehicle stutter.
This way sounds like it could be done using the DATA editor which I do like. Since I only plan on giving the user one or two cars the most this should work out great. I am about to get some time to work on my map so I will try this one.
I just want to thank you again for your help and I'm sorry I took this long getting around to it. Everything seems to work fine except that when the behaviour is applied it interupts the units previous command. So if the car is moving and the buff wears off but then re-casts, the unit stops completely. I currently have the ability as Effect Instant with an Effect that Applies Behaviour. I have the cooldown of the ability set to 0 and the duration of the behaviour at 1 second.
I have tried messing with the flags of the ability like Allow Movement and Transient but it hasn't worked.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
So I am trying to create a trigger that will change the units 'Moveable' state when the ability is activated by an auto-cast. I have been reading and properly implementing lots of things but I seem to be stuck on this one.
Maybe there is another way to go about this but I don't want to have to morph the unit into another unit because I feel like it could be done simply with triggers. Any thoughts? (also I don't know how to extrat the text of my triggers so I took a screenshot).
Any help is very much appreciated.
i feel that it is your condition in the If Statement
Car Ignition is Enabled for (Triggering unit) == true
What are you testing?
is the ability toggle-able?
EDIT: I usually do it like this
Global Variable:
IgnitionBoolean[15] = False
If (Conditions) then do (Actions) else do (Actions)
>If
>>IgnitionBoolean[(Owner of (Triggering Unit))] == False
>Then
>>Set Variable IgnitionBoolean[(Owner of (Triggering Unit))] == True
>>Other Actions
>Else
>>If (Conditions) then do (Actions) else do (Actions)
>>If
>>>IgnitionBoolean[(Owner of (Triggering Unit))] == True
>>Then
>>>Set Variable IgnitionBoolean[(Owner of (Triggering Unit))] == False
>>>Other Actions
>>Else
@zaysite: Go
Hey thanks for your reply
Yes, the ability is toggle-able if by that you mean it auto-casts on and off. I want when the auto-cast is turned on, that the car is set with a movable flag. When it's disabled it removes the removable flag. The function Ability Enabled does have presets for true and false so I thought it would work.
If I'm correct you want me to use a variable in the If statement instead of the ability itself, and have it check if the ability is enabled then turn it off and if off turn it on, as well as the other functions. I will try that as soon as I'm able too. Thanks again.
Edit your Car Ignition auto-cast ability to have a .5 second cool down
Have the car's movement speed set to 0 in the data editor Create a behavior called "Car Ignition On", and change the field in the new behavior window from Attribute to Buff.
Now, in your trigger, when the auto cast ability is fired, Apply your "Car Ignition On" Behavior to your triggering unit. It will add a new .6 seconds to the car's ignition. When .6 seconds pass, that buff will be removed and the car will be unable to move. However, if the auto cast is still on, and was cast within the past .6 seconds, the Buff will have been renewed, and the car will continue on after even the old buff has been removed because of the new one that was applied in the meantime. If the Auto Cast is disabled, within anywhere from 0 to 0.6 seconds later, the car will stop.
This method will keep the car moving just as long as the ignition is cast within the past .5 seconds. You can make this time smaller to make the accuracy higher, the smaller it is, the more CPU it takes (but honestly, you can set it to 0.07, and the buff duration to 0.08 and it will work just the same, unless you have 600 cars at once).
Just remember to always have your buff duration a little longer than your Auto Cast cooldown. Otherwise, the buff will run out at the exact same time as the ability is cast, and it might make the vehicle stutter.
@gerudobombshell: Go
Hey thanks for your reply.
This way sounds like it could be done using the DATA editor which I do like. Since I only plan on giving the user one or two cars the most this should work out great. I am about to get some time to work on my map so I will try this one.
@Netro9: Go
Oh, whoops, don't forget to also set the "Movement Speed: Maximum" to the same as the Bonus field.
Or, for every buff the car gets, the car will go faster and faster! Make sure the car's Movement: Speed Maximum in the behavior is set too!
@gerudobombshell: Go
I just want to thank you again for your help and I'm sorry I took this long getting around to it. Everything seems to work fine except that when the behaviour is applied it interupts the units previous command. So if the car is moving and the buff wears off but then re-casts, the unit stops completely. I currently have the ability as Effect Instant with an Effect that Applies Behaviour. I have the cooldown of the ability set to 0 and the duration of the behaviour at 1 second.
I have tried messing with the flags of the ability like Allow Movement and Transient but it hasn't worked.