Logo Platform
logo amplifiers simplified

Hero Modding

Reply
Copied to clipboard!
12 years ago
Dec 4, 2012, 8:17:38 AM
Hi guys



It really grates me when I see a member of my race leading an enemy fleet so I started investigating modding heroes. I found some help on the forum but I thought it would be nice to have a complete guide, so I apologise if what I'm sharing is already posted somewhere.



I'm kinda new to modding with Notepad++ so apologies if I dont explain what I'm doing correctly.



Introduction



Each hero has his/her own profile (or unique number), by placing the corresponding script of the desired hero into the you can manipulate not only which heros you can recruit but also which the AI races can recruit.



The ability points and stats of each hero can be manipulated in the script, this kind of modding breaks the game for me, but it's there if you want.



And finally... I have found out how to change the 'class' of the hero. I used to avoid the Sophons as their heroes kinda sucked... But know my Sophon heroes can be Pilots and Adventurers. Yay!



Firstly I will explain where to find and how to manipulate the hero scripts.



The Hero



So this is what typical script looks like for each Hero in the game.



[PHP]





6

1

1

0.2

5

0

87.56505

5

4

0

0

3

4

4

4









HeroAbilityCommon12

HeroAbilityCommon15

HeroAbilityCommander01

HeroAbilityCommander02

HeroAbilityCommon01



][/PHP]



Hero Profile is the unique number that corresponds to the hero eg. Jana Kyrv the Pilgrim hero is 'Hero64'. For the complete list see below under hero codes.

Status this is extremenely important!!! Here you can see J.Kyrv is assigned to a fleet. When in the hero pool it's set to 'Idle' by default. When you paste heroes to the the status must be set to Status="AvailableForRecruitment". You cannot recruit an 'Idle' Hero.

Properties here you can edit Levels, ability points and such like of your hero.

Abilities here lists the known abilities.



Hero Codes



So here is my list of hero codes for each race. Now to makes things easier, I have sorted the complete scripts into groups. So I can just paste into the appropriate section.



Here is the compressed file Endless Heroes.zip of the complete scripts that sorts heroes by race, downlaod and open in notepad++



Terran Hero17, Hero19, Hero23, Hero26, Hero47, Hero49, Hero53, Hero56, *Hero65



Sophon Hero01, Hero02, Hero13, Hero31, Hero32, Hero43



Craver Hero05, Hero07, Hero20, Hero24, Hero35, Hero37, Hero50, Hero54



Hissho Hero10, Hero16, Hero21, Hero22, Hero40, Hero46, Hero51, Hero52



Amoeba Hero15, Hero18, Hero29, Hero45, Hero48, Hero59



Horatio Hero06, Hero09, Hero11, Hero30, Hero36, Hero39, Hero41, Hero60



Sower Hero03, Hero04, Hero12, Hero28, Hero33, Hero34, Hero42, Hero58



Pilgrim Hero08, Hero14, Hero25, Hero27, Hero38, Hero44, Hero55, Hero57, *Hero64



Others Hero61 + Hero62 (that look like pirates)

Hero63 (Automation)

*Hero64 (Pilgrim)

*Hero65 (Terran)

Hero66 (Sheredyn)

Hero67 (The Tech Seeker)

Hero68 (The 'Unknown' Hero)



Where To Start?



First thing is to know where to find the files. So open up yor saved game in Notepad++ and under look for.



[PHP]









[/PHP]



(Empire Index=0 is the player Empire, Index=1 are the Pirates, the following Index's refer to other AI races)



Pool Count



This where 'Idle' heroes are stored, as the game advances they will become randomly recruitable (to all players). Its a good place to find alot of hero codes. But I generally just clear the hero scripts listed in it.



Heroes Count



The 'Count' number corresponds to the total number of heroes you have recruited in your empire. Open the tab and you will see a list like so.



[PHP]



[/PHP]



Recruits Count



Here is listed the heroes that are available for recruitment, again the number corresponds to how many are available. This is where I paste my saved hero scripts that I want to be available to the corresponding empire. (See attatchments)



How To Create Your Race Specific Hero List



I start by clearing all the heros from the Pool and Recruit Counts of my Empire and all AI Empire in game. I then simply paste the racial list from one of my saved files Endless Heroes.zip



When I edit my recruits count to look like this...



[PHP]





>













[/PHP]



I have the complete list of Terran Heroes avaiable to recruit. (note how the status for each hero is set to 'AvailableForRecruitment' and NOT 'Idle')



Changing Hero Class



All you need to know is the unique number of the hero you wish to edit.



The available classes are:

Administrator

Adventurer

Corporate

Commander

Pilot



Open the file Endless Space\Public\Simulation|Hero with notepad++ and find your hero.



[PHP]



<br/><br/> <Description>%Hero64Description</Description> <br/><br/> <Icon Small="Gui/DynamicBitmaps/HeroPortraits/resistanceHero09Small" Large="Gui/DynamicBitmaps/HeroPortraits/resistanceHero09Large" Wide="Gui/DynamicBitmaps/HeroPortraits/resistanceHero09Wide"/> <br/><br/>

1

Pilot;Adventurer

Labor=0;Wit=3;Melee=4;Offense=4;Defense=4

[/PHP]



Change the descriptor to the class you want... Simples!!!!



I hope you find this usefull, and hopefully it all makes sense.



Thanks guys, look forward to your comments and suggestions.



Kaldyr
0Send private message
12 years ago
Dec 4, 2012, 3:29:54 PM
This was helpful in that I was looking for a list by race which you have provided. -Thanks.

Now I wish there was one that told me which were female\male\robot-other



BTW you didn't mention the detail about recruitment bits which can accomplish some of what you want without having to remove them from the original pool.

I think I should expand on that because simply dropping them into the recruited section without flipping their bits could potentially cause a problem later.



Recruitment bits store which empire can recruit a hero. When you start a new map they are generated as follows in the main pool:

(2 << TotalEmpiresInTheMap) - 1 << here means bit shifted to the left

So assuming you have a full 9 player map (pirates count even if not enabled) they start at 1023 or 0x03ff

These are checked in the code during recruitment process to see if said bits include the bit for the empire doing the recruitment pass.

If the asking empire's bit is there the randomly selected hero will be recruited, if not then the hero is passed over and another selected.

Also once recruited that empire's bit is removed from their bits. It will be put back later if you hire and dismiss them depending on how that goes...but lets keep this simple for now.



An Empire bit is determined by 1 << TheEmpire'sIndex

So for example:

Empire 0's bit is 1 << TheirEmpireIndex or this case ( 1 << 0 ) = 1

Empire 1's bit is 1 << TheirEmpireIndex or in this case (1 << 1) = 2

Empire 2's bit is 1 << TheirEmpireIndex or in this case (1 << 2) = 4

Empire 3's bit is 1 << TheirEmpireIndex or in this case (1 << 3) = 8

Empire 4's bit is 1 << TheirEmpireIndex or in this case (1 << 4) = 16

So on and so forth..



So if you want to flag a hero to not be recruited by a given empire all one needs to do is change the recruitment bits to remove said empire's bit. So in the case of a full map and say wanting empire3 to NOT be able to recruit the hero in question you set his bits to 0x03f7 (dec: 1015) which will allow all empires except empire3 to recruit that hero.

Another example with a 8 player map (like it appears in the map of your original post) where we're starting with all bits enabled of 0x1ff (511)

To make a hero not available to the human-empire0 we'd set the bits to 0x1fe (510)

To make a hero not available to empire6 or empire1 we'd set the bits to 0x1be (446)

To make a hero only available to empire2 we'd set the bits to 0x104 (260)



Also note that if you are going to just drop all the ones you want into your recruited pool you should remove your empire's bits from them when you do because the game engine upon firing someone will look to put back that bit that it's expecting not to be there. Your example "When I edit my recruits count to look like this." all have incorrect bit settings assuming you're empire0, they all should technically be 0x1fe.



BTW my mapeditor's heroeditor has a bit calculator that makes this easier when you want to modify these things. I don't yet allow you to just move people from recruit to pool to hero etc but it's something that was on the todo list. Also on the todo list though it was not a high priority is a simple button someone can press that will jimmy up all the hero bits correctly according to their race so you don't have to go do this manual process, now that you have inadvertently helped in that effort I may try to get that in the next build.
0Send private message
0Send private message
12 years ago
Dec 5, 2012, 10:44:51 PM
Thanks for your comments.



This is my first post, and I have no experience of notepad++ until reading a guide on here, so what I know is just from trial and error.



Davea it IS editing a saved game, apologies for my newbness I thought modifying a saved game meant modding smiley: redface



Knight Hawk, the reason I didn't mention the recruitment bits is because I never new of them smiley: biggrin ha ha. So thanks for pointing them out, although I'm not sure I quite understand from your explanation... When it comes to 'editing saved games' I have about 2 weeks experience of messing about with notepad++ so a spoon needs to be called a spoon for me to eat ice-cream!!!!



Empire 0's bit is 1 << TheirEmpireIndex or this case ( 1 << 0 ) = 1

Empire 1's bit is 1 << TheirEmpireIndex or in this case (1 << 1) = 2

Empire 2's bit is 1 << TheirEmpireIndex or in this case (1 << 2) = 4

Empire 3's bit is 1 << TheirEmpireIndex or in this case (1 << 3) = 8

Empire 4's bit is 1 << TheirEmpireIndex or in this case (1 << 4) = 16




When you put
<<
does that mean 4x4 sorry but I've never seen multiplication written this way. So Empire 4's bit is 16? but I dont see how you go on to use this to get numbers like 1023 and 0x1fe



So assuming you have a full 9 player map (pirates count even if not enabled) they start at 1023 or 0x03ff




What start at 1023? And how does 1023 mean 0x03ff?



To make a hero not available to the human-empire0 we'd set the bits to 0x1fe (510)




Maybe if I understood the previous stuff this would make sense. My brain hurts I need to lie down.



Kaldyr



Ps. KinghtHawk its a shame your editor is not free smiley: sad
0Send private message
12 years ago
Dec 6, 2012, 3:44:04 AM
The << operator is a left shift, and 0x means hexadecimal (base 16). These are common programming terms. It would take a while to explain, but you can google these terms to learn more.
0Send private message
12 years ago
Dec 7, 2012, 11:12:08 PM
Ps. KinghtHawk its a shame your editor is not free



WHAT ARE YOU TALKING ABOUT??? - It's been FREE since the day I posted it and will always be free. You must have my tool confused with that 1 guy over the summer who was trying to charge for his. If you mean not open-source - no it's not at the moment. but then again it's .net technically it's all there for anyone to rip apart.

/#/endless-space/forum/37-modding/thread/16346-tool-to-move-your-star-systems-around-esmapeditor



If you're new to those terms like hex and bit shifting, first don't be scared they are far less complicated and as davea mentioned Google is your friend and there is no shortage on the internet on these topics. This one isn't bad http://www.gamedev.net/page/resources/_/technical/general-programming/bitwise-operations-in-c-r1563 It's an opportunity to learn





But if you just want to get down to using it. open up win7's calc and switch it to programmer mode RoL will shift a number left, RoR will shift a number right by one bit for every press, didn't even know those were there till last week. xor will help you 'apply or un-apply' a mask. So say you wanted to disallow player-4 out of the starting bits 3ff (dec 1024). 1023 xor 16 = 1007, then you can just switch it to hex from dec (the radio button the left) in calc, it'll show you 3ef or typically written 0x3ef in Amp's game saves.
0Send private message
?

Click here to login

Reply
Comment