Another problem...

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
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Another problem...

Post by toms »

The attached scenario ends after the second turn. (and that´s wrong) :(

(You will need the utils files to understand)
First read, then think. Read again, think again. And then post!
scott
Posts: 5248
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

The human player doesn't have any sides with canrecruit=1
Hope springs eternal.
Wesnoth acronym guide.
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

There is still nothing.
Also the {ENEMIES_APPEAR} doesn´t work. :cry:
First read, then think. Read again, think again. And then post!
scott
Posts: 5248
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

Does this scenario end in victory or defeat? Besides not having a side 1 leader, you don't have an enemy leader either. Try adding victory_when_enemies_defeated=no.

In ENEMIES_APPEAR, although I didn't see them defined anywhere, xx and yy need $ in these lines:

Code: Select all

			 		[unit]
			 		type=Wolf
			 		x=xx
			 		y=yy
			 		[/unit] 
In the scenario, try using numerical_equals in this statement:

Code: Select all

	[event]
	name=new turn
		[if]
		{VAR missing equals 0}
			[then]
			{RANDOM_NEXT_SCENARIO no}
			[/then]
		[/if]
	[/event]
In STARTING_SCENE_BEG, the {VAR} macro has a spurious underscore and looks like this: {VAR_ }

In LASTLEVEL_MAP_CHG, I don't think the x and y variables are going to be expressed: {TERRAIN ($tmp_caveloc[$i].x) ($tmp_caveloc[$i].y) m}
Try using a format statement to put them into temp variables first. I could be wrong.

There may be some more bugs, but this is what I saw upon second look.
Hope springs eternal.
Wesnoth acronym guide.
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

Thank you for all, but what do you mean with a format statement?
I can imagine what it is about, but I don´t know what i should do. :o

I already have done the other things, but I still win on the first turn.

And do I need numerical_equals whenever the value of a variable is a number? :?:
First read, then think. Read again, think again. And then post!
scott
Posts: 5248
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

With regards to the format statement, sometimes variable expression with $ doesn't work. The exact details are in the wiki, which I recommend you read. My take on the matter may be wrong, but it does err on the side of caution.

If you have a key

Code: Select all

x=$tmp_caveloc[$i].x
That may not work - not all of the $'s are expressed. Instead, do this:

Code: Select all

{VARIABLE_OP x_temp format $tmp_caveloc[$i].x}
then use the temp variable in the key:

Code: Select all

x=$x_temp
The VARIABLE_OP macro above is expanded to this (FYI):

Code: Select all

[set_variable]
name=x_temp
format=$tmp_caveloc[$i].x
[/set_variable]
At this point, I would start cutting out all your events and getting the bare-bones scenario to work. Once it does, add the events back slowly to isolate which one is causing the problems. Could you post an updated scenario file? Perhaps you overlooked something that you thought you fixed.

Edit: yes, you should use numerical_equals whenever it's a number.

Edit 2: I fixed the mistake pointed out below
Last edited by scott on March 20th, 2006, 1:41 pm, edited 1 time in total.
Hope springs eternal.
Wesnoth acronym guide.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

scott wrote:then use the temp variable in the key:

Code: Select all

x=x_temp
Otherwise correct, but x=$x_temp would be a bit better. :wink:
scott
Posts: 5248
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

zookeeper wrote:
scott wrote:then use the temp variable in the key:

Code: Select all

x=x_temp
Otherwise correct, but x=$x_temp would be a bit better. :wink:
Whoops! Right.
Hope springs eternal.
Wesnoth acronym guide.
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

Thank you for all, but In noticed another problem:
This stuff doesn´t work:

Code: Select all

[recall]
description=Tith
[/recall]
[recall]
description=Illanin
[/recall]
And it does in another scenario.
First read, then think. Read again, think again. And then post!
scott
Posts: 5248
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

Check to make sure they are in your recall list, either by attempting to recall them or examining the saved game. You probably killed them in another scenario, cleared their storage variable somewhere, or forgot to unstore them if stored.
Hope springs eternal.
Wesnoth acronym guide.
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

The end of the scenario on the first turn is now fixed.

:oops: ...I forgot the evil victory_when_enemies_defeated=no.

Remaining problems:
:arrow: No unit is unstored correctly. (the leader was already on level 2 when playtesting, now he´s back on level 1)
:arrow: The map overlay is not working.
I posted the actual scenario and the corrected macros here.
First read, then think. Read again, think again. And then post!
scott
Posts: 5248
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

For the map overlay, try making the path relative to userdata/data, that is, try {@campaigns/campaignname/maps/variations/landing1}

It may not be necessary, but it can't hurt (especially if it works).


Next, I couldn't find any instance of [unstore_unit] or [store_unit] in these files. Without an [unstore_unit] tag, a unit can't be unstored.
Hope springs eternal.
Wesnoth acronym guide.
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

Yes, you will have to try hard because they are unstored 2 levels before. :wink:

And about the overlay stuff: Unfortunately, your suggestion does not work. :(
First read, then think. Read again, think again. And then post!
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

The overlay works now. It was something wrong with the path, because I temporarily inserted the terrain letter block.

The only remaining problem is the macro {ENEMIES_APPEAR}, then it should basically go.
First read, then think. Read again, think again. And then post!
Post Reply