I'm trying to create a "fuel" stat for certain units that is consumed when the unit is moving. When fuel hits zero, the unit should no longer be able to move. What's the best way to go about implementing this in Data? I've made a Fuel attribute behavior, as well as an Out of Fuel one that suppresses movement. Unfortunately, I don't know how to change the initial value of the Fuel attribute (it always starts at zero, at the moment) and I don't know how to decrement it only while moving.
Any suggestions on what steps I should take to produce this effect would be much appreciated!
Have a hidden stackable Buff add the attribute. Have a second buff apply x stacks of the fuel buff initially and add a third out of fuel buff and a fourth consume fuel buff. The third buff is disabled if there are any stacks of the first buff and when active it supresses movement/disables move ability/sets speed to 0 like the fungal growth behaviour. There is a validator called Caster Is Stationary, put a modified version of that in the fourth buff which periodically uses a Remove Behavior effect to remove a stack of the fuel buff.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
This isn't working very well for me, and I know I'm obviously doing it wrong but I'm not sure what's causing problems. The unit spawns with 0 fuel (Out of Fuel is disabled for the time being), but gains 1 Fuel when moving; when it stops moving, the fuel returns to 0. This suggests that Consume Fuel is indeed working but is adding instead of decrementing fuel, despite setting a negative number in attribute changes.
I think I'm unclear on the concept of stacking buffs, or how I should go about doing that. I thought it was done in the attribute changes window under modifications, but now I'm not sure.
I'm sure I'm making a few novice mistakes here, I'm sorry! This is my first time really using the data editor for this kind of thing; in the past I've always done it through triggers. I really want to learn how to do things in data, though, as it seems much faster and more efficient.
Could just create a Text actor when the fuel behaviour is off. Also you need a caster is moving validator which can easily be based on the is stationary one. The fuel buff gives the attribute points so they follow the number of stacks of the fuel buff. The consume fuel periodically removes a stack of the fuel buff when the caster is moving (not stationary). There is another buff that is disabled by a Unit Compare Behavior Count validator that disables movement if there are 0 stacks of the fuel buff. You then just need to get some other buff to give a starting amount of fuel buff stacks.
Read the wiki articles on this site about buffs and the apply and remove behavior effects.
For one final question, I'm trying to make a data validator that returns true the exact moment a unit fires its weapon and false immediately afterwards, until it fires it again, such that, in the case of a marine, it returns true the exact frame the marine deals damage, and false for the rest of the shooting animation. I've tried using the "Caster Is Firing Weapon" validator with my desired effect in the Effect: Effect - Initial field, but it doesn't work.
If you have any suggestions on how to do this, I'd really be indebted. If not, that's fine, and I'll probably figure it out eventually or try some other approach. You've already helped a ton with the fuel problem, and I'm extremely grateful for your assistance!
A buff with a damage response on attacker might work but it depends why you want to validate it like that. The Unit Weapon Firing and Unit Weapon Animating type validators might work but I have never used them.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
Unit Weapon Firing returns true as long as the weapon is, well, firing, and Unit Weapon Animating unsurprisingly does the same for animation. This isn't quite the desired effect though, as I'd like it to only return true the exact frame(s) when damage is dealt.
However, I found an alternate solution to the problem by just timing the period of buff using the validator to exactly the period of the unit's weapon.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'm trying to create a "fuel" stat for certain units that is consumed when the unit is moving. When fuel hits zero, the unit should no longer be able to move. What's the best way to go about implementing this in Data? I've made a Fuel attribute behavior, as well as an Out of Fuel one that suppresses movement. Unfortunately, I don't know how to change the initial value of the Fuel attribute (it always starts at zero, at the moment) and I don't know how to decrement it only while moving.
Any suggestions on what steps I should take to produce this effect would be much appreciated!
edit: typo
Have a hidden stackable Buff add the attribute. Have a second buff apply x stacks of the fuel buff initially and add a third out of fuel buff and a fourth consume fuel buff. The third buff is disabled if there are any stacks of the first buff and when active it supresses movement/disables move ability/sets speed to 0 like the fungal growth behaviour. There is a validator called Caster Is Stationary, put a modified version of that in the fourth buff which periodically uses a Remove Behavior effect to remove a stack of the fuel buff.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
Thanks for the reply! I really appreciate someone taking the time to clear things up.
I've been trying what you said and I'm a bit confused at how I should organize this.
From what I understand, I need the following behaviors:
This isn't working very well for me, and I know I'm obviously doing it wrong but I'm not sure what's causing problems. The unit spawns with 0 fuel (Out of Fuel is disabled for the time being), but gains 1 Fuel when moving; when it stops moving, the fuel returns to 0. This suggests that Consume Fuel is indeed working but is adding instead of decrementing fuel, despite setting a negative number in attribute changes.
I think I'm unclear on the concept of stacking buffs, or how I should go about doing that. I thought it was done in the attribute changes window under modifications, but now I'm not sure.
I'm sure I'm making a few novice mistakes here, I'm sorry! This is my first time really using the data editor for this kind of thing; in the past I've always done it through triggers. I really want to learn how to do things in data, though, as it seems much faster and more efficient.
Could just create a Text actor when the fuel behaviour is off. Also you need a caster is moving validator which can easily be based on the is stationary one. The fuel buff gives the attribute points so they follow the number of stacks of the fuel buff. The consume fuel periodically removes a stack of the fuel buff when the caster is moving (not stationary). There is another buff that is disabled by a Unit Compare Behavior Count validator that disables movement if there are 0 stacks of the fuel buff. You then just need to get some other buff to give a starting amount of fuel buff stacks.
Read the wiki articles on this site about buffs and the apply and remove behavior effects.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
Thanks for the help, I got it working!
I used this structure:
Behaviors
Fuel -> Attribute
FuelB -> Buff (stacks to 100, each one modifies Fuel attribute by 1)
Consume Fuel -> Buff (Periodic Effect: Fuel Movement Consumption, period of 0.75, Validator to disable is Caster Is Moving)
Out Of Fuel -> Buff (modification suppresses movement, Validator to disable is Has No Fuel)
Replenishing Fuel -> Buff (Periodic Effect: Give Fuel, Period Count is 100, Validator to remove is Needs Fuel)
Effects
Fuel Movement Consumption -> Remove Behavior (Removes FuelB)
Give Fuel -> Apply Behavior (Applies FuelB)
Validators
Caster Is Moving -> Unit Compare Speed (Checks if caster's speed is not equal to 0)
Has No Fuel -> Unit Compare Behavior Type (Checks if FuelB is 0)
Needs Fuel -> Unit Compare Behavior Type (Checks if FuelB is less than 100)
I hope this helps anyone trying to do the same thing in the future. I really appreciate the support!
For one final question, I'm trying to make a data validator that returns true the exact moment a unit fires its weapon and false immediately afterwards, until it fires it again, such that, in the case of a marine, it returns true the exact frame the marine deals damage, and false for the rest of the shooting animation. I've tried using the "Caster Is Firing Weapon" validator with my desired effect in the Effect: Effect - Initial field, but it doesn't work.
If you have any suggestions on how to do this, I'd really be indebted. If not, that's fine, and I'll probably figure it out eventually or try some other approach. You've already helped a ton with the fuel problem, and I'm extremely grateful for your assistance!
A buff with a damage response on attacker might work but it depends why you want to validate it like that. The Unit Weapon Firing and Unit Weapon Animating type validators might work but I have never used them.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
Unit Weapon Firing returns true as long as the weapon is, well, firing, and Unit Weapon Animating unsurprisingly does the same for animation. This isn't quite the desired effect though, as I'd like it to only return true the exact frame(s) when damage is dealt.
However, I found an alternate solution to the problem by just timing the period of buff using the validator to exactly the period of the unit's weapon.