Owl's WML (Currently: Solved)

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
UnwiseOwl
Posts: 516
Joined: April 9th, 2010, 4:58 am

Re: Owl's WML (Currently: Solved)

Post by UnwiseOwl »

Making a loss condition to trigger when a village in a certain area of the map is captured by the enemy, but it doesn't work. Any hints as to what I've done wrong in my filter?

Code: Select all

	#If the Marauders take a village in the city you lose.
    [event]
        name=moveto
        [filter]
            side=2,3,5
			terrain=*^V*
			[filter_location]
				x,y=20,20
				radius=10
			[/filter_location]
        [/filter]
        [message]
			speaker=unit
            message= _ "Plunder!"
        [/message]
		[endlevel]
            result=defeat
        [/endlevel]
    [/event]
Maintainer of the Imperial Era and the campaigns Dreams of Urduk, Epic of Vaniyera, Up from Slavery, Fall of Silvium, Alfhelm the Wise and Gali's Contract.
But perhaps 'maintainer' is too strong a word.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Owl's WML (Currently: Village Location Filters)

Post by zookeeper »

terrain= doesn't do anything in [filter] because it's not part of SUF, it's part of SLF.
User avatar
UnwiseOwl
Posts: 516
Joined: April 9th, 2010, 4:58 am

Re: Owl's WML (Currently: Village Location Filters)

Post by UnwiseOwl »

Ok, let's go with that being the only problem and ignore the infinitely more embarrassing problem of me having put these events outside the [/scenario] tag.... :oops:

The correct version, for anyone playing along at home, is:

Code: Select all

	#If the Marauders take a village in the city you lose.
    [event]
        name=moveto
		[filter]
			side=2,3,5
			[filter_location]
				x,y=15,27
				radius=7
			[/filter_location]
			[and]
				[filter_location]
					terrain=*^V*
				[/filter_location]
			[/and]
		[/filter]
        [message]
			speaker=unit
            message= _ "Plunder!"
        [/message]
		[endlevel]
            result=defeat
        [/endlevel]
    [/event]
Maintainer of the Imperial Era and the campaigns Dreams of Urduk, Epic of Vaniyera, Up from Slavery, Fall of Silvium, Alfhelm the Wise and Gali's Contract.
But perhaps 'maintainer' is too strong a word.
User avatar
UnwiseOwl
Posts: 516
Joined: April 9th, 2010, 4:58 am

Re: Owl's WML (Currently: Solved)

Post by UnwiseOwl »

Back after a long break, and I noticed a change from somewhere between 1.11 and the current dev version that is playing havoc with the old IE campaigns.

Once upon a time, after you defined a leader in the first scenario, you could start off follow up scenarios with something like:

Code: Select all

[side]
        side=1
        controller=human
        team_name=good
        id=Vaniyera
[/side]
and it would work fine. But that no longer works, and the side tags now require a valid 'type=' for the leader unit to be entered each scenario, even though the scenario is going to ignore it and recall the leader unit anyway. Assuming I've diagnosed the problem correctly (not always my strong suit!) I have to put a redundant line of code into every scenario that will just be ignored anyway.

This seems odd, but I'm assuming that it's intended behaviour. Could someone please explain the rationale for this change or point me in the direction of a thread discussing it?
Maintainer of the Imperial Era and the campaigns Dreams of Urduk, Epic of Vaniyera, Up from Slavery, Fall of Silvium, Alfhelm the Wise and Gali's Contract.
But perhaps 'maintainer' is too strong a word.
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Owl's WML (Currently: Solved)

Post by gfgtdf »

and the side tags now require a valid 'type=' for the leader unit
There were multiple changes to this code but from theose commit messages it seems like
1) previously the game refused to load when a type= was acidently forgotten and the game didnt print a useful error message.
2) previously you'd need to use no_leader=yes if you dont want a default generated leader in your scenario, now its enough to just omit type=

EDIT: I also think you dont need a valid type´= attribute type=yes might be sufficient
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
UnwiseOwl
Posts: 516
Joined: April 9th, 2010, 4:58 am

Re: Owl's WML (Currently: Solved)

Post by UnwiseOwl »

Thanks for that! Seem like pretty odd reasons given the consequences, but hey, I'm sure it solves a really annoying problem somewhere...
gfgtdf wrote:
EDIT: I also think you dont need a valid type´= attribute type=yes might be sufficient
Neither =yes or =true seem to work, seems to require a valid unittype.
Maintainer of the Imperial Era and the campaigns Dreams of Urduk, Epic of Vaniyera, Up from Slavery, Fall of Silvium, Alfhelm the Wise and Gali's Contract.
But perhaps 'maintainer' is too strong a word.
User avatar
UnwiseOwl
Posts: 516
Joined: April 9th, 2010, 4:58 am

Re: Owl's WML (Currently: Solved)

Post by UnwiseOwl »

Two questions, folks:

1) I'm getting these messages in the logs when running one of my scenarios.

What do they mean and what do I do to fix them?
log wrote:20170119 16:31:39 warning config: Terrain 'Wdt' has evaluated to 100 (cost), which is more than 99; resetting to 99.
20170119 16:31:39 warning config: Terrain 'Qt' has evaluated to 100 (cost), which is more than 99; resetting to 99.
20170119 16:31:39 warning config: Terrain 'Wdt' has evaluated to 100 (cost), which is more than 99; resetting to 99.
20170119 16:31:39 warning config: Terrain 'Xt' has evaluated to 100 (cost), which is more than 99; resetting to 99.
2. I have a macro that is supposed to have units say something selected at random from a list as they enter particular coordinates, but the characters are defiantly mute. What have I done wrong?

Event code:

Code: Select all

	# When civilians get to the signpost, they can leave
    [event]
        name=moveto
        first_time_only=no
        [filter]
            x,y=26,27
            type=IE Nobleman
        [/filter]
        [message]
            x,y=26,27
            message= $civescape[$rando].value
        [/message]
        [store_unit]
            [filter]
                x,y=26,27
            [/filter]
            kill=yes
            mode=append
        [/store_unit]
Macro:

Code: Select all

#define FOS_ESCAPE
	[set_variable]
		name=rando
		rand=0..8
	[/set_variable]
	[set_variables]
		name=civescape
		[literal]
			x=_"On to safety."
		[/literal]
		[literal]
			x=_"I'm getting out of here!"
		[/literal]
		[literal]
			x=_"Thank the Imperator!"
		[/literal]
		[literal]
			x=_"Still alive."
		[/literal]
		[literal]
			x=_"Come on, let's go!"
		[/literal]
		[literal]
			x=_"Good luck, Caius Regilius."
		[/literal]
		[literal]
			x=_"Thank you for your protection"
		[/literal]
		[literal]
			x=_"Uh, I hate Marauders..."
		[/literal]
		[literal]
			x=_"What about my precious things? Tribune, go get them for me."
		[/literal]
	[/set_variables]
#enddef
Can anybody help this perpetual n00b with either, please?
Maintainer of the Imperial Era and the campaigns Dreams of Urduk, Epic of Vaniyera, Up from Slavery, Fall of Silvium, Alfhelm the Wise and Gali's Contract.
But perhaps 'maintainer' is too strong a word.
User avatar
Ravana
Forum Moderator
Posts: 3004
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Owl's WML (Currently: set_variables malarkey)

Post by Ravana »

1) movement_costs has value over 99.

2) Might be from x->value.
User avatar
UnwiseOwl
Posts: 516
Joined: April 9th, 2010, 4:58 am

Re: Owl's WML (Currently: set_variables malarkey)

Post by UnwiseOwl »

Thanks Ravana.
Ravana wrote:1) movement_costs has value over 99.
Oh wow. I don't think that I want to know how long usage of 100 for that has been deprecated, if it was ever allowed...
Ravana wrote: 2) Might be from x->value.
Sorry, I don't understand this?
Maintainer of the Imperial Era and the campaigns Dreams of Urduk, Epic of Vaniyera, Up from Slavery, Fall of Silvium, Alfhelm the Wise and Gali's Contract.
But perhaps 'maintainer' is too strong a word.
User avatar
Ravana
Forum Moderator
Posts: 3004
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Owl's WML (Currently: set_variables malarkey)

Post by Ravana »

I mean you have $civescape[$rando].value and x=_"On to safety."
User avatar
UnwiseOwl
Posts: 516
Joined: April 9th, 2010, 4:58 am

Re: Owl's WML (Currently: set_variables malarkey)

Post by UnwiseOwl »

Ah, right. It should be value=_"On to safety". Thanks very much.
Maintainer of the Imperial Era and the campaigns Dreams of Urduk, Epic of Vaniyera, Up from Slavery, Fall of Silvium, Alfhelm the Wise and Gali's Contract.
But perhaps 'maintainer' is too strong a word.
User avatar
UnwiseOwl
Posts: 516
Joined: April 9th, 2010, 4:58 am

Re: Owl's WML (Currently: store_unit)

Post by UnwiseOwl »

Hey guys, I've run into a problem that I can't resolve using store/unstore unit, hoping you can help.

I have an event that stores an enemy leader at the end of scenario 1.

Code: Select all

				[store_unit]
					[filter]
						id=AldwylfW
					[/filter]
					varible=chaser
				[/store_unit]
And in the next scenario I have an unstore to recall him.

Code: Select all

	        [unstore_unit]
			variable=chaser
		[/unstore_unit]
But when it fires I get this funky error message:

Code: Select all

20170125 13:03:10 error scripting/lua: game_error: creating unit with an empty type field
stack traceback:
	[C]: in field 'create_unit'
	lua/wml-tags.lua:1027: in local 'cmd'
	lua/wml-utils.lua:137: in field 'handle_event_commands'
	lua/wml-flow.lua:6: in function <lua/wml-flow.lua:5>
What am I doing wrong?
Maintainer of the Imperial Era and the campaigns Dreams of Urduk, Epic of Vaniyera, Up from Slavery, Fall of Silvium, Alfhelm the Wise and Gali's Contract.
But perhaps 'maintainer' is too strong a word.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Owl's WML (Currently: store_unit)

Post by zookeeper »

Well... first you check what the variable actually contains, right before you unstore it. That leads you to see that the variable doesn't actually even exist. That leads you to take a closer look at where you think you're putting something into that variable, since that's where the mistake must lie (at least if/when you know you can't have possibly cleared that variable somewhere in between).
User avatar
Bitron
Developer
Posts: 453
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: Owl's WML (Currently: store_unit)

Post by Bitron »

It seems like you've written varible=chaser but it has to be variable=chaser
Thats why it acts like the variable doesnt exist. (:
User avatar
UnwiseOwl
Posts: 516
Joined: April 9th, 2010, 4:58 am

Re: Owl's WML (Currently: store_unit)

Post by UnwiseOwl »

Bitron wrote:It seems like you've written varible=chaser but it has to be variable=chaser
Thats why it acts like the variable doesnt exist. (:
No matter how many times you think you've proofread something...
Thanks, Bitron, that's the problem alright!
Maintainer of the Imperial Era and the campaigns Dreams of Urduk, Epic of Vaniyera, Up from Slavery, Fall of Silvium, Alfhelm the Wise and Gali's Contract.
But perhaps 'maintainer' is too strong a word.
Post Reply