Add-on Help.
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.
-
- Posts: 35
- Joined: November 9th, 2016, 11:04 am
Re: I can't get my add-on to work!
Thanks Gnat! I think that is how I want to add my units. What are the steps? 

-
- Posts: 35
- Joined: November 9th, 2016, 11:04 am
Re: I can't get my add-on to work!
Hi all
Here is the add-on that I have so far.
Here is the add-on that I have so far.
- Attachments
-
Neanderthal_MP_Era.zip
- (4.43 KiB) Downloaded 238 times
Re: I can't get my add-on to work!
Hi FG_prince2000, Ok, so i have attached a fixed version of your era with all the changes i have listed below
I still recommend reading through what i have posted below so you know what i have done and know how to fix errors and create new eras if you have to!
Now about creating an era:
1. create a multiplayer side
Hopefully this helps!
Here is the archive with all the changes i have made:


Some problems with your code:

1. create a multiplayer side
It should look something like this:
UNIT_USAGE refers to the type of unit a unit is (scout,archer,mixed fighter)
TERRAIN refers to a type of ground (Hh,V,Kh)
PICTURE refers to the path to a picture from the images folder (units/elves/fighter.png)
put the side into a seperate file entitled the NAMEOFYOURSIDE_side.cfg
2. create a multiplayer era
Code: Select all
[multiplayer_side]
id=ID
name= _"NAME"
image="PICTURE"
{MAGENTA_IS_THE_TEAM_COLOR}
type=random
leader=UNIT
random_leader=UNIT
recruit=UNIT
terrain_liked=TERRAIN
[ai]
recruitment_pattern=UNIT_USAGE
[/ai]
[/multiplayer_side]
TERRAIN refers to a type of ground (Hh,V,Kh)
PICTURE refers to the path to a picture from the images folder (units/elves/fighter.png)
put the side into a seperate file entitled the NAMEOFYOURSIDE_side.cfg
it should look something like this:
This creates a new era with the name and description you specified and in that era it loads all the default sides and your side. I recommend putting this in another file called YOUR_NAME_era.cfg or something like that.
3. Load all this stuff
Code: Select all
[era]
id=ID
name= _ "NAME"
description= _ "DESCRIPTION"
{RANDOM_SIDE}
{PATH_TO_YOUR_SIDES_FILE} #put in here the path to the side you just created ex: {~add-ons/Death_era/utils/death_side.cfg}
{multiplayer/factions/khalifate-default.cfg}
{multiplayer/factions/rebels-default.cfg}
{multiplayer/factions/loyalists-default.cfg}
{multiplayer/factions/northerners-default.cfg}
{multiplayer/factions/knalgans-default.cfg}
{multiplayer/factions/drakes-default.cfg}
{multiplayer/factions/undead-default.cfg}
[/era]
Put these two files into a folder (called "utils" or "era" or "macros")
Add a line loading that folder in your _main.cfg file:
{~add-ons/Neanderthal_MP_Era/utils}
4. Create movetype and race
Add a line loading that folder in your _main.cfg file:
{~add-ons/Neanderthal_MP_Era/utils}
I see that you have added a movetype as i recommended in the other forum but it seems that your movetype isn't loading
I moved the movetype to a single file under your units folder containing race and movetype and loaded the file with this line from the _main.cfg file:
EDIT: basically zookeeper has informed me your [movetype] & [race] tags need to be in a file loaded from the _main.cfg with a [+units] tag!
To create a race i have created this and added it to the neanderthal_race.cfg file
This should solve all your problems, you can go through and change the ones you want or just download the archive i have attached! I moved the movetype to a single file under your units folder containing race and movetype and loaded the file with this line from the _main.cfg file:
EDIT: basically zookeeper has informed me your [movetype] & [race] tags need to be in a file loaded from the _main.cfg with a [+units] tag!
Code: Select all
[+units]
{~add-ons/Neanderthal_MP_Era/units/neanderthal_race.cfg}
[/units]
Code: Select all
[race]
id=ID
male_name= _ "race^NAMETITLE"
female_name= _ "race+female^NAMETITLE"
plural_name= _ "race^NAMETITLE"
description= _"TODO."
num_traits=2
undead_variation=dwarf
{DWARVISH_NAMES}
[/race]

Here is the archive with all the changes i have made:
Last edited by The_Gnat on November 17th, 2016, 9:36 pm, edited 1 time in total.
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
-
- Posts: 35
- Joined: November 9th, 2016, 11:04 am
Re: I can't get my add-on to work!
Hi!
Thanks a TON! This helps allot! I'l go try it out and make the modifications I want.
Thanks a TON! This helps allot! I'l go try it out and make the modifications I want.
-
- Posts: 35
- Joined: November 9th, 2016, 11:04 am
Re: I can't get my add-on to work!
Hello,
It worked great and my faction is up and running!
Since it was so successful, I am trying to make a previous faction I made that I had just integrated into the core folder ( after making a backup) into an addon. I encountered the problem that now my unit's images aren't working, their just invisible! Could I put it up here and have you guys take a look? I think the problem is that the path is no longer relevant or something... I only have one custom image, should that be in the addon somewhere?
It worked great and my faction is up and running!
Since it was so successful, I am trying to make a previous faction I made that I had just integrated into the core folder ( after making a backup) into an addon. I encountered the problem that now my unit's images aren't working, their just invisible! Could I put it up here and have you guys take a look? I think the problem is that the path is no longer relevant or something... I only have one custom image, should that be in the addon somewhere?
Re: I can't get my add-on to work!
Hi FG_Prince2000, yeah if your having more trouble with your add-on i am happy to look at it!
It sounds like your images aren't being loaded correctly, if you do want to have images with your add-on you should put them in your add-on under images/units/ and then you need to make sure your unit calls the images from the correct directory! 


Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
-
- Posts: 35
- Joined: November 9th, 2016, 11:04 am
Re: I can't get my add-on to work!
Hi Gnat!
Yea, most of my units in this faction use images from the standard image folder, but I do have one or two images that I modified, so I'l put those in the correct folder before sending it.
Yea, most of my units in this faction use images from the standard image folder, but I do have one or two images that I modified, so I'l put those in the correct folder before sending it.
- Attachments
-
Rat_MP_Era.zip
- I changed the path for the two units whose images I included.
- (16.12 KiB) Downloaded 201 times
Re: I can't get my add-on to work!
Hi FG_prince2000! Your image problem is pretty simple: I have attached the fixes in a archive but once again i recommend reading through what i have done:
1st -
2nd - in the Rat_side.cfg, you have put
3rd - in the Rat_side.cfg, you have put spaces and dashes in between the units names: (
For example: in your rat-leader.cfg file it says:
Also as zookeeper suggested you don't actually have to put
loads the entire units folder so you don't need to load the individual file, sorry about telling you that.
Also i noticed that your .pbl file is spelled "server.plb" this probably won't work because its supposed to be spelled ".pbl" (see this page)
Hopefully this helps!

1st -
image="~add-ons/images/units/giant-rat-king.png"
, instead you should put image="units/giant-rat-king.png", without any "~add-ons/" infront of it. (EDIT)2nd - in the Rat_side.cfg, you have put
image="units/monsters/giant-rat-king.png"
but your images are actually in the /units/ folder and their is no /monsters/ folder so it should say insteaed: image="units/giant-rat-king.png"
3rd - in the Rat_side.cfg, you have put spaces and dashes in between the units names: (
random_leader=Rat-Leader, Rat-Warrior, Rat-Surgion
) in order for it to work you need to write the exact line that is in your unit file. For example: in your rat-leader.cfg file it says:
id=Rat Leader
that everything after that = needs to be put when you want to load the unit. So it should look like: random_leader=Rat Leader,Rat Warrior,Rat Surgion
Also as zookeeper suggested you don't actually have to put
{~add-ons/Rat_MP_Era/units/rat_race.cfg}
in your main.cfg file because this line:
Code: Select all
[+units]
{~add-ons/Rat_MP_Era/units}
[/units]
Also i noticed that your .pbl file is spelled "server.plb" this probably won't work because its supposed to be spelled ".pbl" (see this page)
Hopefully this helps!

- Attachments
-
Rat_MP_Era.zip
- fixed archive
- (16.08 KiB) Downloaded 215 times
Last edited by The_Gnat on November 18th, 2016, 11:40 pm, edited 2 times in total.
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
Re: I can't get my add-on to work!
Careful there.The_Gnat wrote:instead you should put image="images/units/giant-rat-king.png"

-
- Posts: 35
- Joined: November 9th, 2016, 11:04 am
Re: I can't get my add-on to work!
Thanks allot guys, I will definitely examine the folder to check out all the changes you made. 

-
- Posts: 35
- Joined: November 9th, 2016, 11:04 am
Re: I can't get my add-on to work!
Hello again!
I am working on a campaign and I want a unit's horse to get shot, so I thought that I would store the unit "after shot" during the prestart event so that you don't see him til you unstore him after his horse gets shot. I thought that I could have him (preshot) move across the screen like the ship in the Heir to the Thrown campaign and when he gets to the spot where he will get shot he talks and then I unstore the "after shot version".
Would this be possible? And how would I make him speak right before he gets shot at and then change his image in the same event? Or would I at all?
I can keep posting Q's about my addons here right? Since this topic is called "I can't get my addon to work"?
I am working on a campaign and I want a unit's horse to get shot, so I thought that I would store the unit "after shot" during the prestart event so that you don't see him til you unstore him after his horse gets shot. I thought that I could have him (preshot) move across the screen like the ship in the Heir to the Thrown campaign and when he gets to the spot where he will get shot he talks and then I unstore the "after shot version".
Would this be possible? And how would I make him speak right before he gets shot at and then change his image in the same event? Or would I at all?
I can keep posting Q's about my addons here right? Since this topic is called "I can't get my addon to work"?
- ForestDragon
- Posts: 1857
- Joined: March 6th, 2014, 1:32 pm
- Location: Ukraine
Re: I can't get my add-on to work!
it's possible, you'll need to do some work with variables, i could show you how to do that, but maybe later. you don't need to unstore a new version, you can just modify his type.FG_Prince2000 wrote:Hello again!
I am working on a campaign and I want a unit's horse to get shot, so I thought that I would store the unit "after shot" during the prestart event so that you don't see him til you unstore him after his horse gets shot. I thought that I could have him (preshot) move across the screen like the ship in the Heir to the Thrown campaign and when he gets to the spot where he will get shot he talks and then I unstore the "after shot version".
Would this be possible? And how would I make him speak right before he gets shot at and then change his image in the same event? Or would I at all?
I can keep posting Q's about my addons here right? Since this topic is called "I can't get my addon to work"?
btw, about the topic, you can rename it by editing the first,and your latest messages
My active add-ons: The Great Steppe Era,XP Bank,Alliances Mod,Pestilence,GSE+EoMa,Ogre Crusaders,Battle Royale,EoMaifier,Steppeifier,Hardcoreifier
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
-
- Posts: 35
- Joined: November 9th, 2016, 11:04 am
Re: Add-on Help.
Thanks man! Sound great, whenever you have time is good. (preferably sooner than later of course, like within the next day or three rather than next month)
Re: I can't get my add-on to work!
Yeah definitely!FG_Prince2000 wrote:I can keep posting Q's about my addons here right? Since this topic is called "I can't get my addon to work"?
This is a more complex problem but it can be done if you use a [move_unit] Which takes a unit and move it to_x,to_y. See here:FG_Prince2000 wrote:Hello again!
I am working on a campaign and I want a unit's horse to get shot, so I thought that I would store the unit "after shot" during the prestart event so that you don't see him til you unstore him after his horse gets shot. I thought that I could have him (preshot) move across the screen like the ship in the Heir to the Thrown campaign and when he gets to the spot where he will get shot he talks and then I unstore the "after shot version".
Code: Select all
[move_unit]
id=YOUR_UNITS_ID
to_x=WHERE_YOU_WANT_IT_TO_GO_X
to_y=WHERE_YOU_WANT_IT_TO_GO_Y
[/move_unit]
Code: Select all
[animate_unit]
[filter]
id=THE_PERSON_ATTACKING
[/filter]
flag=attack
hits=yes
[primary_attack]
name=YOUR_ATTACKERS_WEAPON_NAME
[/primary_attack]
[facing]
[filter]
id=YOUR_UNIT_ID
[/filter]
[/facing]
#THEN THIS WILL MAKE THE HORSE GUY DEFEND
#currently it makes your horse guy defend when he gets shot but
#if you change it to say flag=death then it should animate his death instead
[animate]
[filter]
id=YOUR_HORSE_GUY
[/filter]
flag=defend
hits=yes
[secondary_attack]
name=HIS_WEAPON_NAME
[/secondary_attack]
[facing]
[filter]
id=THE_GUY_WHO_WAS_ATTACKING_HIM
[/filter]
[/facing]
[/animate]
[/animate_unit]
Then modify your horse guy to be a normal guy using [modify_unit]:
Code: Select all
[modify_unit]
[filter]
id=YOUR_UNITS_ID
[/filter]
type=THE_NEW_TYPE_OF_UNIT_YOU_WANT_HIM_TO_BE
#IF YOU WANT THIS HALVES THE HORSE GUYS HITPOINTS
hitpoints = "$($this_unit.hitpoints / 2)
[/modify_unit]
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
-
- Posts: 35
- Joined: November 9th, 2016, 11:04 am
Re: Add-on Help.
Wow! Thanks allot! I will try it out and see.