Problems with the _main.cfg recognizing the macros
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.
Problems with the _main.cfg recognizing the macros
Is incredible that always my biggest probelms are basic issues, but what can i say.
I have this lines in the _main.cfg
Maybe the problem is not there but see this
this is my general-macros.cfg
ok the problem is that if post exactly this
In the map.cfg the unit apears on the expected location.
But if instead i do this.
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?
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
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
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]
But if instead i do this.
Code: Select all
[event]
name=prestart
{PLACE_LIEUTENANT}
[/event]
You can see the mistake i'm not seeing?
Re: Problems with the _main.cfg recognizing the macros
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.
If I load the macro on the map it works as intended.
Re: Problems with the _main.cfg recognizing the macros
You can define the macro wherever you want. The only important thing is that you define it before you use it!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?)