How do I code the event return to village before upgrading?
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.
-
- Posts: 5
- Joined: May 2nd, 2017, 1:21 pm
How do I code single move turns?
Can anyone code single move turns, so that you can play Wesnoth like chess?
-
- Posts: 5
- Joined: May 2nd, 2017, 1:21 pm
How do I code the event return to village before upgrading?
Can anyone code the event of returning to a village as a condition for upgrading a unit?
Re: How do I code the event return to village before upgradi
Chess-type movement has already been done. You can download those addons and see how it is done there.
Re: How do I code the event return to village before upgradi
Coding advancement after moving to a village would be complicated.
You probably could create a pre advance event that makes a unit advance to nothing but meanwhile stores what it advances to.
Then it wouldn't advance even though it has plenty of experience.
Then when it moves to a village you could reset it's advancement with the variable you stored.
You probably could create a pre advance event that makes a unit advance to nothing but meanwhile stores what it advances to.
Then it wouldn't advance even though it has plenty of experience.
Then when it moves to a village you could reset it's advancement with the variable you stored.
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: How do I code the event return to village before upgradi
I don't think it has to be that hard. I'm pretty sure this would work just fine: You could make an pre_advance event that stored and killed the unit (except in castles and villages), which would prevent the advancement from taking place. Then you could unstore the unit using "advance=no," and the XP would be left over the maximum. You would also need an event that would store and unstore any unit that moved into a village or castle using "advance=yes." Most of the time it wouldn't have any effect, but if the unit had XP over the maximum, it would level.The_Gnat wrote:Coding advancement after moving to a village would be complicated.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: How do I code the event return to village before upgradi
Yes good idea!
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
-
- Posts: 5
- Joined: May 2nd, 2017, 1:21 pm
Re: How do I code the event return to village before upgradi
Thanks for your reply. Is there actually an add-on that would work for random maps or even campaigns? What's it called? I have only found one chess add-on, but I think it only works for the corresponding chess-like map.Ravana wrote:Chess-type movement has already been done. You can download those addons and see how it is done there.
Re: How do I code the event return to village before upgradi
The one that only works on single map is good enough to get the events that control such movement.