can someone please explain me that weird error?

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

can someone please explain me that weird error?

Post by toms »

Sorry that I need help that often, but now something I´d never find out.

I get following error message (in own words and translated, but true):

Code: Select all

missing tag close for [set_variable] in data/game.cfg:94 taken over from data/game.cfg taken over from scenarios/landing.cfg:9 taken over Scout.cfg:31, ...
There is left to say that line 31 in Scout.cfg is a path to the scenarios folder,
line 9 of the file landing.cfg is a use of the predefined macro {VARIABLE_OP VAR OP ARG}.
With '...' other places where it appears are meant
:?:
First read, then think. Read again, think again. And then post!
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Post by Sapient »

Look for an unclosed set_variable tag, or possibly an unclosed quote-string or missing paren.
Last edited by Sapient on April 20th, 2006, 4:25 pm, edited 1 time in total.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Disto
Posts: 2039
Joined: November 1st, 2004, 7:40 pm
Location: Cambridge, UK

Re: can someone please explain me that weird error?

Post by Disto »

toms wrote:Sorry that I need help that often, but now something I´d never find out.

I get following error message (in own words and translated, but true):

Code: Select all

missing tag close for [set_variable] in data/game.cfg:94 taken over from data/game.cfg taken over from scenarios/landing.cfg:9 taken over Scout.cfg:31, ...
There is left to say that line 31 in Scout.cfg is a path to the scenarios folder,
line 9 of the file landing.cfg is a use of the predefined macro {VARIABLE_OP VAR OP ARG}.
With '...' other places where it appears are meant
:?:
I think that's saying you've probably got a typo, where do you use [set_variable]?? Find it and then when you found it look to see the closing tag and apparently there's something wrong with it... Experiment, see if it still happens when you take that whole section out, see if it starts even if it doesn't work properly.
Creator of A Seed of Evil
Creator of the Marauders
Food or Wesnoth? I'll have Wesnoth
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

I think you did not understand. The game 'believes' that there is something wrong with the predefined macro.
First read, then think. Read again, think again. And then post!
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Post by Sapient »

Ah, I misunderstood earlier.

Likely, there is something wrong with the way you are using the predefined macro. It would be a lot easier to tell this if you post the relevant code from landing.cfg (around line 9)
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Disto
Posts: 2039
Joined: November 1st, 2004, 7:40 pm
Location: Cambridge, UK

Post by Disto »

toms wrote:I think you did not understand. The game 'believes' that there is something wrong with the predefined macro.
I don't think so, post the code here.
Creator of A Seed of Evil
Creator of the Marauders
Food or Wesnoth? I'll have Wesnoth
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

Alright, now it works. The reason were a forgotten quote mark, a wrong variable operation, and a few macro mistakes in indirect relation.
Thank you anyway.
First read, then think. Read again, think again. And then post!
Disto
Posts: 2039
Joined: November 1st, 2004, 7:40 pm
Location: Cambridge, UK

Post by Disto »

toms wrote:Alright, now it works. The reason were a forgotten quote mark, a wrong variable operation, and a few macro mistakes in indirect relation.
Thank you anyway.
Told you you had a typo, even though I didn't say the rest :P
Creator of A Seed of Evil
Creator of the Marauders
Food or Wesnoth? I'll have Wesnoth
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

Another thing appeared right now:
The following code doesn´t produce errors, even worse it does nothing. :(

Code: Select all

#define ENEMIES_APPEAR
[event]
name=moveto
first_time_only=no
[filter]
side=1
 [not]
 description=Tith
 [/not]
[/filter]
	{RANDOM 0..3}
	[if]
	{VAR random numerical_equals 0}
		[then]
		[store_locations]
		variable=enemyloc
		radius=4
		x=$x
		y=$y
		[/store_locations]
			{VARIABLE_OP length format ("$enemyloc.length")}
			{VARIABLE_OP randloc random (1..$length)}
			 {FOREACH enemyloc k}
			 [if]
			 {VAR randloc equals k}
			 	[then]
			 		{VARIABLE_OP xloc format $enemyloc[$k].x}
			 		{VARIABLE_OP yloc format $enemyloc[$k].y}
			 		{VARIABLE_OP unittp random (Wolf,Gryphon)}
			 		[unit]
			 		type=$unittp
			 		x=$xloc
			 		y=$yloc
			 		[/unit] 
			 		{CLEAR_VARIABLE unittp}
			 	[/then]
			 [/if]
			 {NEXT k}
			{CLEAR_VARIABLE xloc}
			{CLEAR_VARIABLE yloc}
			{CLEAR_VARIABLE k}
			{CLEAR_VARIABLE enemyloc}
			{CLEAR_VARIABLE randloc}
		[/then]
	[/if]
[/event]
#enddef
Please tell me even if there is a typo because I wouldn´t find it.
First read, then think. Read again, think again. And then post!
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Post by Sapient »

Did you try inserting some message statements to see how far it gets? Also, why is it inside a #define? Did you remember to call the macro after defining it?
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

Sapient wrote:Also, why is it inside a #define? Did you remember to call the macro after defining it?
I dont´t know what you mean. It is a macro for more than one levels where exactly the same thing appears, defined in an external file, if you mean that.

I will try that with the messages...
First read, then think. Read again, think again. And then post!
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

After you define a macro, you have to call it... Sapient is asking, did you remember to put

Code: Select all

{ENEMIES_APPEAR}
in the scenario file itself? If you just define the macro and don't call it, it doesn't do anything, because it never actually appears in your code.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

I did, and I even checked it again now.
Currently I try the messages. Something happens internally because the screen always stucks for a very little (but recognizeable) moment, but nothing in result.
First read, then think. Read again, think again. And then post!
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

Code: Select all

[store_locations]
variable=enemyloc
radius=4
x=$x
y=$y
[/store_locations]
Perhaps you meant to use $x1 and $y1? :wink:

Also, this...

Code: Select all

{VARIABLE_OP length format ("$enemyloc.length")}
{VARIABLE_OP randloc random (1..$length)} 
...I would rather write like this:

Code: Select all

{VARIABLE_OP length format "1..$enemyloc.length"}
{VARIABLE_OP randloc random $length} 
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

x1,y1: yes, I already cahnged, but missed to tell. Thanks, anyway.

The other code you suggested works. Thank you very much! :D
First read, then think. Read again, think again. And then post!
Post Reply