Wolf advancement not happening after scenario 1

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.
Post Reply
User avatar
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Wolf advancement not happening after scenario 1

Post by Helmet »

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.
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Wolf advancement not happening after scenario 1

Post by gfgtdf »

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

Re: Wolf advancement not happening after scenario 1

Post by Helmet »

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
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
User avatar
Ravana
Forum Moderator
Posts: 2949
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Wolf advancement not happening after scenario 1

Post by Ravana »

You can [base_unit] new wolf type with advancements.
User avatar
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: Wolf advancement not happening after scenario 1

Post by Helmet »

Thanks, Ravana; that was the solution I needed.

And thanks Shield for your help with coding a new wolf type with advancements off-forum.
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
User avatar
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: Wolf advancement not happening after scenario 1

Post by Helmet »

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
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
User avatar
Celtic_Minstrel
Developer
Posts: 2166
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: Wolf advancement not happening after scenario 1

Post by Celtic_Minstrel »

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.
Former maintainer of Steelhive.
Post Reply