Cannot find macro/file ... [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.
Locked
User avatar
SpoOkyMagician
Posts: 281
Joined: September 5th, 2008, 8:04 am
Location: I have no idea...

Cannot find macro/file ... [Solved]

Post by SpoOkyMagician »

I generally can find problems when I make a mistake... However, I cannot find the problem at all with this... I would like to point out a few things before I post though...

1: This campaign works perfectly fine when I comment out this macro I made. So, WML wise, it should be fine...
2: I'm trying to not post the code as much as possible because, I want to the concept to myself for now... However, if it comes to it, I will post more as needed...
3: I am currently using "Untitled_Campaign" for now. I will change it in the future but, I made sure it was correctly used in the campaign tag.

With that being said, I will now post my problem...

While trying to use a macro I defined (#define VANISH_TRICK X Y WML) in the directory/file utils/common.cfg, wesnoth 1.9.6 complains to me this:

error config: Macro/file 'VANISH_TRICK' is missing at ~add-ons/Untitled_Campaign/scenarios/01_title.cfg:405 included from ~add-ons/Untitled_Campaign/_main.cfg:34

Now, two things concern me about this error... (mostly one relevant)

1: {~add-ons/Untitled_Campaign/utils} (I am pointing to the directory in which it should find this macro/file...)
2: It says: line 34. It is actually line 35... (But, maybe that really isn't relevant... Line 34 is this... {~add-ons/Untitled_Campaign/scenarios} )

Now, without giving too much away, I will post my WML in parts that you need to see...

Code: Select all


[campaign]
...
define=UNTITLED_CAMPAIGN
...
[/campaign]

#ifdef UNTITLED_CAMPAIGN
	[binary_path]
		path="data/add-ons/Untitled_Campaign"
	[/binary_path]
	{~add-ons/Untitled_Campaign/scenarios}
	{~add-ons/Untitled_Campaign/utils}
#endif
That is my main.cfg (Most likely my mistake is there. I am not the best at making campaigns... But, it looks right to me...)

Now for when I call it in my scenario...

Code: Select all

...
					{VANISH_TRICK 10 1 (
						[message]
							speaker=narrator
							image=wesnoth-icon.png
							caption=_ "The Scary Path"
							message=_ "You encounter two goblins along the way. You decide the best action is to retreat. Although, the goblins follow you on the way back."
						[/message]
						{UNIT 2 ("Goblin Spearman") 9 2 (
							ai_special=guardian
						)}
						{UNIT 2 ("Goblin Spearman") 11 2 (
							ai_special=guardian
						)}
					)}
...
It's pretty straight forward to me... (yes, its in an event, I tested that... again, WML is not an issue... To my knowledge...)

I could probably easily fix this by just including the util in the scenario itself but, I want to do that as a last resort... I could use some fresh eyes please...
Last edited by SpoOkyMagician on May 18th, 2011, 1:51 am, edited 1 time in total.
"You don't have to understand me, I'm just there!" ~ SpoOkyMagician
Creator of: Unwelcome Guests Series, Modifiable Android Project, SpoOky's Survivals, and many more... (Most of my old stuff is gone.)
(User Page)
User avatar
Pentarctagon
Project Manager
Posts: 5533
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Cannot find macro/file ...

Post by Pentarctagon »

So would I be correct in assuming that there are other macros in the same file as the VANISH_TRICK macro that work fine?
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
SpoOkyMagician
Posts: 281
Joined: September 5th, 2008, 8:04 am
Location: I have no idea...

Re: Cannot find macro/file ...

Post by SpoOkyMagician »

Sadly no. I only have one macro atm... (It's a work in progress.) But, I'm assuming its not "finding" the directory "utils". That is my best guess atm... There is clearly a directory in the addon named "utils" though... I cannot understand why it's not being found at all...

edit: I will try making a simple macro real quick and call it... Let's see what happens...

edit: No... It doesn't like it either... Clearly something is wrong with this line...

{~add-ons/Untitled_Campaign/utils}

Although, I don't see the problem... :annoyed:
"You don't have to understand me, I'm just there!" ~ SpoOkyMagician
Creator of: Unwelcome Guests Series, Modifiable Android Project, SpoOky's Survivals, and many more... (Most of my old stuff is gone.)
(User Page)
monochromatic
Posts: 1549
Joined: June 18th, 2009, 1:45 am

Re: Cannot find macro/file ...

Post by monochromatic »

In your _main.cfg, utils is 'processed' after scenarios, so naturally the engine won't know about the utils when it is reading the scenarios.
Place the utils before the scenarios and it should work.
User avatar
SpoOkyMagician
Posts: 281
Joined: September 5th, 2008, 8:04 am
Location: I have no idea...

Re: Cannot find macro/file ...

Post by SpoOkyMagician »

Son of a... :evil: I should of known that... Thanks... That fixed it. :geek: Thank you. (I just needed some fresh eyes.)

[Solved]
"You don't have to understand me, I'm just there!" ~ SpoOkyMagician
Creator of: Unwelcome Guests Series, Modifiable Android Project, SpoOky's Survivals, and many more... (Most of my old stuff is gone.)
(User Page)
Locked