Wolf advancement not happening after scenario 1

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
Helmet
Posts: 61
Joined: December 19th, 2006, 5:28 pm
Location: Missouri, USA

Wolf advancement not happening after scenario 1

Post by Helmet » December 4th, 2019, 3:40 pm

Hi, I've been working on a three scenario campaign and I have a problem.
By default, a Wolf can't advance to Lvl 2 Great Wolf, so I implemented the following code to allow Wolf advancement:

extra_defines=ENABLE_WOLF_ADVANCEMENT

I placed the code within [campaign] in the main.cfg, and it works, but only on the first scenario.

I tried a work-around. I added a macro that allows a recruited Wolf to advance to Great Wolf, but that solution led to other problems, so I'm now wondering why I needed a work-around in the first place. Shouldn't extra_defines=ENABLE_WOLF_ADVANCEMENT work on all scenarios, not just the first one? How can I make it work on all scenarios?

Thanks.

gfgtdf
Developer
Posts: 1203
Joined: February 10th, 2013, 2:25 pm

Re: Wolf advancement not happening after scenario 1

Post by gfgtdf » December 4th, 2019, 7:50 pm

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.

Helmet
Posts: 61
Joined: December 19th, 2006, 5:28 pm
Location: Missouri, USA

Re: Wolf advancement not happening after scenario 1

Post by Helmet » December 4th, 2019, 10:07 pm

Thank you, I didn't know about that unfortunate problem.

I wonder, should I abandon the idea of using wolves who can advance in level? Wolves play an important role in the campaign, though.

I have a work-around for wolf advancement but it has four problems.
1) It only works on recruited wolves, so application is limited.
2) The "Leader" who is a wolf (so not recruited) is unable to use the macro so he can't advance in level, which is bad.
3) A Great Wolf doesn't advance to Dire Wolf (not sure why, probably fixable).
4) The XPs needed for advancing to Great Wolf are wrong. They should be 30, not 50.

Here is the macro. I'm not sure how to proceed at this point. Ideas?

Code: Select all

#define RECRUITED_WOLF_MAY_ADVANCE
	[event] #  Macro allows a recruited Wolf to advance to Great Wolf
		name=prerecruit
		first_time_only=no #  			Note: by default, a Wolf cannot advance in level
		[filter] #							  and needs 50 XP to AMLA
			type=Wolf #				Note: a Wolf that can advance to Great Wolf
		[/filter] #							  needs 30 XPs to advance
		[modify_unit]
			[filter]
				id=$unit.id
			[/filter]
			[modifications]
				[object]
					[effect]
						[filter]
							type=Wolf
						[/filter]
						apply_to=new_advancement
						replace=yes
						types=Great Wolf
					[/effect]
				[/object]
				[object]
					[effect]
						[filter]
							type=Great Wolf
						[/filter]
						apply_to=new_advancement
						replace=yes
						types=Dire Wolf
					[/effect]
				[/object]
			[/modifications]
		[/modify_unit]
	[/event]
#enddef

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

Re: Wolf advancement not happening after scenario 1

Post by Ravana » December 4th, 2019, 10:20 pm

You can [base_unit] new wolf type with advancements.

Helmet
Posts: 61
Joined: December 19th, 2006, 5:28 pm
Location: Missouri, USA

Re: Wolf advancement not happening after scenario 1

Post by Helmet » December 5th, 2019, 12:44 am

Thanks, Ravana; that was the solution I needed.

And thanks Shield for your help with coding a new wolf type with advancements off-forum.

Helmet
Posts: 61
Joined: December 19th, 2006, 5:28 pm
Location: Missouri, USA

Re: Wolf advancement not happening after scenario 1

Post by Helmet » December 5th, 2019, 2:11 am

This is a new Wolf-related problem. I guess I'll add it rather than start a new thread, if that's okay.

This code is supposed to make a recruited Wolf have the Loyal trait -- which it does. However, it also seems to create a bug. An occasional Wolf's XP requirement will be lower as if it had the Intelligent trait, even though it doesn't. Or a Wolf does extra damage as if it had the Strong trait, yet it doesn't. It seems like the Loyal trait sometimes "replaces" a specific trait -- but in name only, as the effects of the displaced trait remain.

Code: Select all

 #define LOYAL_WOLVES
	[event] #				Makes a recruited Wolf unit have the Loyal trait
		name=prerecruit
		first_time_only=no
		[filter]
			type=Wolf
		[/filter]
		[modify_unit]
			[filter]
				id=$unit.id
			[/filter]
			[modifications]
				{TRAIT_LOYAL}
			[/modifications]
			{IS_LOYAL}
		[/modify_unit]
	[/event]
 #enddef

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

Re: Wolf advancement not happening after scenario 1

Post by Celtic_Minstrel » December 6th, 2019, 1:17 am

Your guess at the issue is roughly correct (though it's a little worse - it doesn't replace the trait entirely but ends up merging the loyal trait into it, which in principle could be different than actually replacing it if the trait has more [effect] tags than loyal does).

Remove the [modifications] tag and just place {TRAIT_LOYAL} directly in [modify_unit]. This will mean the wolf has three traits, though, so if you'll need to come up with another solution to get around that if it's a problem.
Helmet wrote:
December 5th, 2019, 2:11 am
This is a new Wolf-related problem. I guess I'll add it rather than start a new thread, if that's okay.
Just a note that I personally prefer to see a new thread for each new problem (especially when the two problems are unrelated).
Author of The Black Cross of Aleron campaign and Default++ era.
Maintainer of Steelhive.

Post Reply