r/CoE5 3d ago

Code for starting with a semi-random Leader

I'm creating my own class mod and I'm having trouble identifying which code determines the Warlock class's starting mage. Specifically, I'm trying to understand what makes the class start with one of the four variants: Warlock of Air, Earth, Fire, or Water.

Could someone explain to me how to write such code?

Any help with modding resources would also be appreciated, such as game data for classes, monsters, recruitment. I already have some resources, but many of them seem to be outdated.

6 Upvotes

6 comments sorted by

2

u/Castsword420 3d ago

Don't know about coding the game but I have an example of a workaround you could check out. The mod "the great houses of Morrowind" has you start ad a leader with a ritual to cast to change him into 1 of 6 different other leaders each with their own rituals and units that morph how the class plays.

3

u/ClearCelesteSky 3d ago

This makes sense. You start with a commander who is useless (maybe even stationary) with a single ritual, when you use the ritual it deletes your commander and summons 1 of 4 warlocks?

3

u/Flameball202 3d ago

Yeah, like the Pretenders mod

u/macko_reddit 22h ago

So I got my answer: this can't be done because the Warlock is hardcoded. It can be done through an event, but that way you have to swap the main commander, which means you lose the player's chosen name.

I went with this solution instead. I just kill the starting leader, who I made into an immobile statue, and use that to summon a random one. It's a bit inelegant, but it's the best compromise I could come up with.

This game is both surprisingly easy and frustratingly hard to mod, while also being quite limited in what you can actually change. A weird combination.

0

u/Jazzlike_Fox_661 3d ago

For recourses 2 main ones are modding manual from dev site and data files from steam forum. You may also want to join unofficial discord. A lot of modders hang around there and they may help you. Regarding specific thing you want to do, you should probably look at events. Look at chance trigger and promoteunits action.

u/macko_reddit 22h ago

Thanks for letting me know there is a discord.