Log error message

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.
User avatar
Spannerbag
Posts: 760
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: Log error message

Post by Spannerbag »

gfgtdf wrote: October 27th, 2024, 2:26 pm yes that correct, only the "orignal" action is put on the unit stack

(actually i see little reason why it shoul dbe that way, i think we could drather easily make for examle [move_unit] call [on_undo] internally to add itself to the undo stack)
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
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.18, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
User avatar
Celtic_Minstrel
Developer
Posts: 2371
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: Log error message

Post by Celtic_Minstrel »

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.
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 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].
Presumably there was a good reason to remove [on_redo], so I don't see reinstating it as something likely to happen.
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?
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.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
User avatar
Spannerbag
Posts: 760
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: Log error message

Post by Spannerbag »

Celtic_Minstrel wrote: October 28th, 2024, 1:50 pm
Spannerbag wrote: October 28th, 2024, 11:10 am I can kinda see why recruitment is not undoable...
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.
Just tried this and yes, that is so!

Celtic_Minstrel wrote: October 28th, 2024, 1:50 pm
Spannerbag wrote: October 28th, 2024, 11:10 am As I see it if recruitment was made undoable then redo ...
Presumably there was a good reason to remove [on_redo], so I don't see reinstating it as something likely to happen.
Oops, didn't realise [on_redo] had been binned. Never used it.

Celtic_Minstrel wrote: October 28th, 2024, 1:50 pm
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?
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.
That is a much more elegant method! :)

Thanks very much for clarifying and explaining all of this, it helped. A lot.
Cheers!
-- Spannerbag
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.18, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
gfgtdf
Developer
Posts: 1452
Joined: February 10th, 2013, 2:25 pm

Re: Log error message

Post by gfgtdf »

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.
User avatar
beetlenaut
Developer
Posts: 2867
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Log error message

Post by beetlenaut »

Celtic_Minstrel wrote: October 28th, 2024, 1:50 pmIf the generator were rewound, you would get the exact same unit when you redo anyway.
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.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
User avatar
Celtic_Minstrel
Developer
Posts: 2371
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: Log error message

Post by Celtic_Minstrel »

But that's not redo.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
Post Reply