Macros don´t work! Aaargh!
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.
Macros don´t work! Aaargh!
I made a scenario without own-built macros and then I replaced some things with macros.
All of sudden, it doesn´t work any more.
Another thing is that I already had a macro in another scenario and it worked except for the macro.
Help please!
(the attachment is the file wich suddenly didn´t work because of inserting macros)
All of sudden, it doesn´t work any more.
Another thing is that I already had a macro in another scenario and it worked except for the macro.
Help please!

(the attachment is the file wich suddenly didn´t work because of inserting macros)
First read, then think. Read again, think again. And then post!
Code: Select all
{@data/campaigns/Scout/utils/utils.cfg}
Also...
Code: Select all
[side]
no_leader=yes
[/side]
Could you post all the relevant WML files (campaign file, utils.cfg)? Also, I wouldn't call the "{} includes" binary paths, since a [binary_path] is something very different. With the "{} includes" you can only include WML code from a file into that location, whereas with [binary_path] you add paths from which external files (like images given in an profile= key) are searched.toms wrote:I´ve changed the binary path the way you told. But there is still the same error msg.
Code: Select all
[campaign]
id=campaign_scout
...
#ifdef CAMPAIGN_SCOUT

EDIT: Sorry, my bad. I confused id with define. Nevermind the above.
I´ve made your change. I´ve just seen so many .cfg-s without this.zookeeper wrote:As the WML reference says, you need to give it the coordinates from which to remove the items.toms wrote:This is fixed now, but I have another problem: the [removeitem] tag doesn´t work.

Result: The animation doesn´t work anyway now

First read, then think. Read again, think again. And then post!
My guess is that if it works on those scenarios, it works without the coordinates when used in a moveto event. So if you don't give the exact coordinates, items at the target hex of the moveto event get removed. Just a guess.toms wrote:I´ve made your change. I´ve just seen so many .cfg-s without this.zookeeper wrote:As the WML reference says, you need to give it the coordinates from which to remove the items.
Make sure that when you try to animate by using items, you [redraw][/redraw] after placing an item and put a sufficient delay after that. Then you can remove the previous item, place the next, redraw, delay, etc. I think I once had some problems with such animations because I didn't redraw at the right spots.toms wrote:Result: The animation doesn´t work anyway now
BTW, if you intend your campaign to be 1.1 compatible, you can use the [extra_anim] and [animate_unit] tags for any custom unit animations you want. It'll probably be much more convenient.
Ok, the campaign goes again but this doesn´t work:
Code: Select all
#define CHG_GOLD SIDE AMOUNT
[gold]
side={SIDE}
amount={AMOUNT}
[/gold]
#enddef
First read, then think. Read again, think again. And then post!
I don't really know why that wouldn't work, provided the macro is used correctly (the definition has no errors). The only way I can think of how it could be used wrong would be to try to use it outside an event. But in any case, you could use [modify_side] instead if [gold] really doesn't want to work. You just need to [store_gold], increment the variable by {AMOUNT} and set the new gold amount with [modify_side].toms wrote:Ok, the campaign goes again but this doesn´t work: