Begun Modding but need Help!

I have recently been modding (this is the first game I have ever modded) and I have a few things that I would still like to add in. In the Mars Effect mod I noticed it has custom research buttons, how do you add/make these? Secondly, I made a phase bomb for the vasari that pretty much detroys everything in the grav well. To balance this and intorduce the storyline more into the gameplay, the phase explosion causes the mysterious entity to take notice. Basically it comes down to making a buff that only has a 25% chance of happening. So when you detonate the bomb, there is a 25% chance that one of your planets will "fall off the grid".  The only part I need help with is the random chance. Is it possible and if so what coding line is needed?
3,885 views 2 replies
Reply #1 Top
In the Mars Effect mod I noticed it has custom research buttons, how do you add/make these?
End of quote


Take a look at the current research buttons, they're all titled RESEARCHSUBJECT__. All you really have to do is make your own .entity file (copy/modify an existing is the easiest, obviously :P), give it the position on the tree you want (also defined in the entity file), and then add the research to the player(tech/phase/psi).entity file where it lists all the topics that race can research.

If you did everything properly, it's as easy as that :P

The only part I need help with is the random chance. Is it possible and if so what coding line is needed?
End of quote


It is possible, but it's tricky and I doubt anyone can explain it clearly :P The basic premise is the ability file calls a buff file. That buff file contains a periodic action that "onChance" calls a second buff file, where your actual buff effects are defined.

For an example of this, look at AbilityFighterBlink.entity and its associated buff files ;) This is the ability for the Vasari carrier capital that has a chance to make its fighters "blink" towards their target.
Reply #2 Top
Thank you for your help. I think I can get it as long as I have a template to work off of.