Problems with the _main.cfg recognizing the macros

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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
Fosprey
Posts: 254
Joined: January 25th, 2008, 8:13 am

Problems with the _main.cfg recognizing the macros

Post by Fosprey »

Is incredible that always my biggest probelms are basic issues, but what can i say.

I have this lines in the _main.cfg

Code: Select all

#ifdef MULTIPLAYER
{~add-ons/CE_Era/eras/CE_era.cfg}
{~add-ons/CE_era/maps}
{~add-ons/CE_era/macros/general-macros.cfg}
[+units]
    {~add-ons/CE_Era/units/buildings/Empire}
	{~add-ons/CE_Era/units/leader}
	{~add-ons/CE_Era/units/Empire}
	{~add-ons/CE_Era/macros/movement.cfg}
	{~add-ons/CE_Era/macros/traits.cfg}
	{~add-ons/CE_era/macros/general-movetypes.cfg}
	{~add-ons/CE_era/macros/general-macros.cfg}
 [/units]
#endif 
Maybe the problem is not there but see this

this is my general-macros.cfg

Code: Select all

#define PLACE_LIEUTENANT
  [unit]
 type=Peasant
 side=1
 role=settler
 name="Settler"
 unit_description= _ "None."
 canrecruit=0
 x=18
 y=5
 random_traits=no
  [/unit]
 
  #enddef

ok the problem is that if post exactly this

Code: Select all


[event]
name=prestart
[unit]
 type=Peasant
 side=1
 role=settler
 name="Settler"
 unit_description= _ "None."
 canrecruit=0
 x=18
 y=5
 random_traits=no
  [/unit]
[/event]
In the map.cfg the unit apears on the expected location.
But if instead i do this.

Code: Select all

[event]
name=prestart
{PLACE_LIEUTENANT}
[/event]
The unit do not appear, i'm lost i checked 2 hours for things and for some reason it doesn't recognize my macro. The script in the macro seems fine since it works if i post it directly in the map.cfg, but it seems to miss completly if i put it in a macro and refer to it.
You can see the mistake i'm not seeing?

Fosprey
Posts: 254
Joined: January 25th, 2008, 8:13 am

Re: Problems with the _main.cfg recognizing the macros

Post by Fosprey »

Sorry i should delete this, i realizeed that for prestart events i should define macros on the map.cfg (or is there a way to define them in the _main.cfg?)
If I load the macro on the map it works as intended.

silene
Posts: 1109
Joined: August 28th, 2004, 10:02 pm

Re: Problems with the _main.cfg recognizing the macros

Post by silene »

Fosprey wrote:i realizeed that for prestart events i should define macros on the map.cfg (or is there a way to define them in the _main.cfg?)
You can define the macro wherever you want. The only important thing is that you define it before you use it!

Post Reply