Another problem...
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.
Another problem...
The attached scenario ends after the second turn. (and that´s wrong)
(You will need the utils files to understand)

(You will need the utils files to understand)
First read, then think. Read again, think again. And then post!
The human player doesn't have any sides with canrecruit=1
Hope springs eternal.
Wesnoth acronym guide.
Wesnoth acronym guide.
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:
In the scenario, try using numerical_equals in this statement:
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.
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]
Code: Select all
[event]
name=new turn
[if]
{VAR missing equals 0}
[then]
{RANDOM_NEXT_SCENARIO no}
[/then]
[/if]
[/event]
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.
Wesnoth acronym guide.
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.
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?
I can imagine what it is about, but I don´t know what i should do.

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!
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
That may not work - not all of the $'s are expressed. Instead, do this:
then use the temp variable in the key:
The VARIABLE_OP macro above is expanded to this (FYI):
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
If you have a key
Code: Select all
x=$tmp_caveloc[$i].x
Code: Select all
{VARIABLE_OP x_temp format $tmp_caveloc[$i].x}
Code: Select all
x=$x_temp
Code: Select all
[set_variable]
name=x_temp
format=$tmp_caveloc[$i].x
[/set_variable]
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.
Wesnoth acronym guide.
Otherwise correct, but x=$x_temp would be a bit better.scott wrote:then use the temp variable in the key:Code: Select all
x=x_temp

Whoops! Right.zookeeper wrote:Otherwise correct, but x=$x_temp would be a bit better.scott wrote:then use the temp variable in the key:Code: Select all
x=x_temp
Hope springs eternal.
Wesnoth acronym guide.
Wesnoth acronym guide.
Thank you for all, but In noticed another problem:
This stuff doesn´t work:
And it does in another scenario.
This stuff doesn´t work:
Code: Select all
[recall]
description=Tith
[/recall]
[recall]
description=Illanin
[/recall]
First read, then think. Read again, think again. And then post!
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.
Wesnoth acronym guide.
The end of the scenario on the first turn is now fixed.
...I forgot the evil victory_when_enemies_defeated=no.
Remaining problems:
No unit is unstored correctly. (the leader was already on level 2 when playtesting, now he´s back on level 1)
The map overlay is not working.
I posted the actual scenario and the corrected macros here.

Remaining problems:


I posted the actual scenario and the corrected macros here.
First read, then think. Read again, think again. And then post!
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.
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.
Wesnoth acronym guide.