Set Movement Recovery per turn?

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
weewah
Posts: 101
Joined: October 31st, 2019, 7:11 pm

Set Movement Recovery per turn?

Post by weewah »

Is there a way to set a unit's movement point recovery per turn other than just setting max moves?

I want to make a Sprinter unit that can run long distances in a single turn, but requires rest to regain stamina. So something like 10 max moves, but it recovers only 4 moves per turn. Is there any way to do this?
User avatar
GForce0
Posts: 63
Joined: May 17th, 2020, 5:58 pm

Re: Set Movement Recovery per turn?

Post by GForce0 »

I don't know if there is a simple way to alter how the move recovery works.
But otherwise you could save the remaining moves of sprinters at each side turn end and at beginning of each side turn manually set the moves = remaining + 4
User avatar
beetlenaut
Developer
Posts: 2814
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Set Movement Recovery per turn?

Post by beetlenaut »

Yes, you have to use events. The best way to store the current max_moves would be in a unit variable. Then you would set the moves to the value of that variable in a turn refresh event then add 4 to the variable. (If you change the moves before the turn refresh, your changes will be reset during the refresh.)

However, the easiest thing to do would be to change each sprinter's max_moves in a side turn event. Increase it by 4, then reduce it to the maximum if it went over. That way you can do it to all the sprinters--you don't need to check them or store anything.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Post Reply