Unit canrecruit=false

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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
enclave
Posts: 823
Joined: December 15th, 2007, 8:52 am

Unit canrecruit=false

Post by enclave » May 29th, 2018, 3:14 am

Sorry I have a very strange question...... (1.14.1)
Does [unit] NOT automatically set canrecruit=false if unspecified?
Looks like all my units created with [unit] tag completely don't have any canrecruit value...
It might be me being silly.. or not?
I was sure in 1.12 all units were having canrecruit value.. do I need a brain scan...? I feel like im stupid...

To say more, I tried to make unit with [unit] canrecruit=false and to the best of my knowledge the result was a unit without canrecruit variable.. only king has canrecruit and it is true obviously... but other units don't have canrecruit=false, they just don't have canrecruit at all...!?
Did I mess something up with my add-on codes or it's really happening and it's a new "feature"?

User avatar
Celtic_Minstrel
Developer
Posts: 1189
Joined: August 3rd, 2012, 11:26 pm
Contact:

Re: Compatibility-breaking changes between 1.12 and 1.13/1.14

Post by Celtic_Minstrel » May 29th, 2018, 4:08 am

Well, false and absent are essentially the same, aren't they? Though I'm not certain whether boolean_equals counts a missing key as false.

It sounds like this might be a result of the optimization for save files? I seem to recall someone did an optimization to leave redundant keys (keys that are set to their default value) out of the save files, and it affects [store_unit] too since they both use the same method to convert a unit to WML. I'm not sure though.
Author of The Black Cross of Aleron campaign and Default++ era.
Maintainer of Steelhive.

User avatar
vultraz
Community Manager
Posts: 927
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: Compatibility-breaking changes between 1.12 and 1.13/1.14

Post by vultraz » May 29th, 2018, 5:09 am

As celmin said, canrecruit=false and a missing canrecruit= key count as the same. It doesn't matter if the key is missing.
Creator of Shadows of Deception (for 1.12) and co-creator of the Era of Chaos (for 1.12/1.13).
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?

enclave
Posts: 823
Joined: December 15th, 2007, 8:52 am

Re: Compatibility-breaking changes between 1.12 and 1.13/1.14

Post by enclave » May 29th, 2018, 11:15 am

vultraz wrote:
May 29th, 2018, 5:09 am
As celmin said, canrecruit=false and a missing canrecruit= key count as the same. It doesn't matter if the key is missing.
so if i do [store_unit] canrecruit=false then I obviously get all units without canrecruit tag?

User avatar
vultraz
Community Manager
Posts: 927
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: Compatibility-breaking changes between 1.12 and 1.13/1.14

Post by vultraz » May 29th, 2018, 5:16 pm

Almost certainly. You can confirm pretty easily.
Creator of Shadows of Deception (for 1.12) and co-creator of the Era of Chaos (for 1.12/1.13).
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?

User avatar
Ravana
Moderator
Posts: 1816
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Unit canrecruit=false

Post by Ravana » May 29th, 2018, 5:34 pm

Confirmed, so this is not compatibility-breaking, so split.

Post Reply