I try to create a cost by energy or resources of unit move, but cant find out any way to do so. I want, that if unit moves it decreases the amount of unit energy or player resources for each tile it passes or time moves. Any ideas?
You'd need two behaviors and validators for each. One validator is unit energy or player resources < (movement cost), and the other is "Unit is moving"
Add one validator to one behavior, the other to the other. (Field: "Validator (disable)")
In the behavior with the cost, go on modifications +, and go through the tabs and disable movement wherever you see it.
Create an effect of "modify unit" or "modify player" (depending whether you want resources or energy), have it reduce energy or resources = cost of 1 second of movement (use math to get "per square" in the end)
Add that as the periodic effect for your "Unit is moving" behavior. Set it's period to 1 and number of periods to -1
Set the duration of both behaviors to -1
i THINK this should work. You might wanna mess around with the periods and energy/resource reduction, make it be smoother than only every second
You can also simply reduce the energy regeneration of units through the behavior if you're not having a delayed energy regen and not use the periodic effect, it'll be a lot smoother.
Edit: Bleh, vexal posted while i was afk before i got to finish my post. Anyway, same thing, more details
I've done as you said and it looks good: 1 periodical caster Behavior, set of effects Issue Order Stop and Cost with validators. But there is a bug: if you click with 0 energy unit still bit move. I repair it with a Stop trigger to move ability and condition 0 energy. Now it looks better.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi all!
I try to create a cost by energy or resources of unit move, but cant find out any way to do so. I want, that if unit moves it decreases the amount of unit energy or player resources for each tile it passes or time moves. Any ideas?
Try this. Give the unit a behavior of type buff. Give it a set effect that subtracts the vitals and makes the unit stop for the periodic effect.
There is a validator called "isnotmoving" or similar. Give the effect that subtracts vitals the inverse of this validator.
Give a validator to the effect that stops the unit which checks if the unit has energy.
You'd need two behaviors and validators for each. One validator is unit energy or player resources < (movement cost), and the other is "Unit is moving"
Add one validator to one behavior, the other to the other. (Field: "Validator (disable)")
In the behavior with the cost, go on modifications +, and go through the tabs and disable movement wherever you see it.
Create an effect of "modify unit" or "modify player" (depending whether you want resources or energy), have it reduce energy or resources = cost of 1 second of movement (use math to get "per square" in the end)
Add that as the periodic effect for your "Unit is moving" behavior. Set it's period to 1 and number of periods to -1
Set the duration of both behaviors to -1
i THINK this should work. You might wanna mess around with the periods and energy/resource reduction, make it be smoother than only every second
You can also simply reduce the energy regeneration of units through the behavior if you're not having a delayed energy regen and not use the periodic effect, it'll be a lot smoother.
Edit: Bleh, vexal posted while i was afk before i got to finish my post. Anyway, same thing, more details
Thank you very much!
I've done as you said and it looks good: 1 periodical caster Behavior, set of effects Issue Order Stop and Cost with validators. But there is a bug: if you click with 0 energy unit still bit move. I repair it with a Stop trigger to move ability and condition 0 energy. Now it looks better.