Auto End Turn Event
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.
Auto End Turn Event
To me, it seems Wesnoth should be smart enough to know when my turn is done. Like, when my units don’t have any moves left.
So, I present to you, an auto end turn event. (Note… this is especially handy in many multiplayer scenarios.)
The event ends the turn if any units on the current side have no movement and cannot make any attacks. It’s designed to end a turn when it’s assumed there are no more moves to take. (If there are valid moves, then it’s still up to you to tell the game when you want to end your turn!) It also won’t allow undo on the last move.
I’d like to add recall and recruit support by checking the recall list, and if the current side’s leader is on a keep and can afford any units. I’d also like to add support for units who have a few moves but not enough to move to a new tile. (If you can think of any other cases where, in a standard game, you’d choose not end your turn right away, let me know.)
So, I present to you, an auto end turn event. (Note… this is especially handy in many multiplayer scenarios.)
The event ends the turn if any units on the current side have no movement and cannot make any attacks. It’s designed to end a turn when it’s assumed there are no more moves to take. (If there are valid moves, then it’s still up to you to tell the game when you want to end your turn!) It also won’t allow undo on the last move.
I’d like to add recall and recruit support by checking the recall list, and if the current side’s leader is on a keep and can afford any units. I’d also like to add support for units who have a few moves but not enough to move to a new tile. (If you can think of any other cases where, in a standard game, you’d choose not end your turn right away, let me know.)
Code: Select all
[event]
name=moveto,attack end
first_time_only=no
[filter_condition]
[not]
[have_unit]
side=$side_number
[and]
[not]
[filter_wml]
moves=0
[/filter_wml]
[/not]
[or]
[filter_adjacent]
is_enemy=yes
[/filter_adjacent]
[not]
[filter_wml]
attacks_left=0
[/filter_wml]
[/not]
[/or]
[/and]
[/have_unit]
[/not]
[/filter_condition]
[end_turn]
[/end_turn]
[/event]
Wesnoth Bestiary ( PREVIEW IT HERE )
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
Re: Auto End Turn Event
Turn time limit is for that..
- artisticdude
- Moderator Emeritus
- Posts: 2424
- Joined: December 15th, 2009, 12:37 pm
- Location: Somewhere in the middle of everything
Re: Auto End Turn Event

In MP, yes, but In SP campaigns there is no timer.Ravana wrote:Turn time limit is for that..

"I'm never wrong. One time I thought I was wrong, but I was mistaken."
Re: Auto End Turn Event
What if I recruit last
?

Re: Auto End Turn Event
i guess you'd have to check the undo stack as well which i'm pretty sure you'd need engine support for this...
Re: Auto End Turn Event
The real problem (for me) is that a big part about wesnoth, or SP and hotseat any way, is that it's alot about thinking. What happens if the player wants to undo, or is chatting advice to the player after him? Methinks a lot more problems will arise from having the turns timed than it appears. Yeah, this cleans up the "Where the dickens has Boldek gone to? is he AFK?" chats, I think the timer does it best.
Guys I never thought I'd come back to this forum after 8 years this is wild