Log error message
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.
- Spannerbag
- Posts: 760
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: Log error message
Good idea; making all movement (that doesn't change gamestate) undoable would be more consistent for players (perhaps

No idea whether it'd be feasible to also include non-player originated
[teleport]
, [tunnel]
etc. as well as [move_unit]
.Heh, but then it wouldn't be me doing the coding, I'm great at generating work for other people.

I can kinda see why recruitment is not undoable, even if something like
[kill]
might do the job (assuming [kill]
syncs in multiplayer) as this would presumably also remove all the random number dependent data generated as part of the recruit action for this unit.As I see it if recruitment was made undoable then redo should, for consistency, also be available as a single simple action: i.e. implemented in the game engine without the need for
[on_redo]
.Generally, recruited units have various random elements; id, name, trait(s) etc. so there would be no way to redo that (i.e. reinstate the "un-recruited" unit exactly, as Celtic_Minstrel explained) unless the last recruited unit was automatically stored internally by the game engine?
My head's starting to hurt now...
Thanks ever so much for your help and patience, much appreciated.
Cheers!
-- Spannerbag
- Celtic_Minstrel
- Developer
- Posts: 2371
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Log error message
Actually, I'm pretty sure recruiting a skeleton is undoable in the absence of that random stuff. For example, if I'm not mistaken, I believe you can undo the recruit of a skeleton.Spannerbag wrote: ↑October 28th, 2024, 11:10 am I can kinda see why recruitment is not undoable, even if something like[kill]
might do the job (assuming[kill]
syncs in multiplayer) as this would presumably also remove all the random number dependent data generated as part of the recruit action for this unit.
Presumably there was a good reason to removeSpannerbag wrote: ↑October 28th, 2024, 11:10 am As I see it if recruitment was made undoable then redo should, for consistency, also be available as a single simple action: i.e. implemented in the game engine without the need for[on_redo]
.
[on_redo]
, so I don't see reinstating it as something likely to happen.No, this isn't really the case – storing the last recruited unit isn't necessary. I think the only thing you would need for fully undoable recruits is a way to rewind the random number generator. If the generator were rewound, you would get the exact same unit when you redo anyway.Spannerbag wrote: ↑October 28th, 2024, 11:10 am Generally, recruited units have various random elements; id, name, trait(s) etc. so there would be no way to redo that (i.e. reinstate the "un-recruited" unit exactly, as Celtic_Minstrel explained) unless the last recruited unit was automatically stored internally by the game engine?
- Spannerbag
- Posts: 760
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: Log error message
Just tried this and yes, that is so!Celtic_Minstrel wrote: ↑October 28th, 2024, 1:50 pmActually, I'm pretty sure recruiting a skeleton is undoable in the absence of that random stuff. For example, if I'm not mistaken, I believe you can undo the recruit of a skeleton.
Oops, didn't realiseCeltic_Minstrel wrote: ↑October 28th, 2024, 1:50 pmPresumably there was a good reason to removeSpannerbag wrote: ↑October 28th, 2024, 11:10 am As I see it if recruitment was made undoable then redo ...[on_redo]
, so I don't see reinstating it as something likely to happen.
[on_redo]
had been binned. Never used it.That is a much more elegant method!Celtic_Minstrel wrote: ↑October 28th, 2024, 1:50 pmNo, this isn't really the case – storing the last recruited unit isn't necessary. I think the only thing you would need for fully undoable recruits is a way to rewind the random number generator. If the generator were rewound, you would get the exact same unit when you redo anyway.Spannerbag wrote: ↑October 28th, 2024, 11:10 am ...recruited units have various random elements ... so there would be no way to redo that (... unless the last recruited unit was automatically stored internally by the game engine?

Thanks very much for clarifying and explaining all of this, it helped. A lot.
Cheers!
-- Spannerbag
Re: Log error message
i wonder why we even mention [on_redo] in the wiki, it wasn't supported in any stable release
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
- beetlenaut
- Developer
- Posts: 2867
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: Log error message
Not if you recruited your units in a different order to make sure that didn't happen. This would allow you to fish around for specific traits on at least some of your units.Celtic_Minstrel wrote: ↑October 28th, 2024, 1:50 pmIf the generator were rewound, you would get the exact same unit when you redo anyway.
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
- Celtic_Minstrel
- Developer
- Posts: 2371
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Log error message
But that's not redo.