How to add new buffs.

Everything about mods can be found here.

Moderator: Morax

How to add new buffs.

Postby RavenCurow » 26 Aug 2016, 08:20

I'm wondering how you could add a new buff for a mod. I imagine you would have to modify the buff file and hook it in the sim folder, but I'm not sure what sections of the file to add code to. I'd like to make a buff that allows you to add a mass or energy production buff to an enhancement instead of just replacing the old econ number. So a stacking buff so to speak.
RavenCurow
Avatar-of-War
 
Posts: 98
Joined: 30 Oct 2014, 01:17
Has liked: 1 time
Been liked: 14 times
FAF User Name: RavenCurow

Re: How to add new buffs.

Postby Franck75 » 26 Aug 2016, 15:07

Hi raven,

Maybe this previous post from me can help you :

viewtopic.php?f=41&t=11421
Franck75
Crusader
 
Posts: 13
Joined: 22 Aug 2016, 13:56
Has liked: 2 times
Been liked: 0 time
FAF User Name: Franck

Re: How to add new buffs.

Postby RavenCurow » 28 Aug 2016, 05:44

Unfortunately not because the buff I want make doesn't exist in the games buff file normally so I have no buff parameters to draw on for the blueprint.

Edit: It seems towards the bottom someone does explain what I need. Thanks.

Edit: Nevermind. I can't do it that way. There are only certain stats you can call in a buff blueprint normally. Things like max health, rate of fire, build rate. Unfortunately mass and energy production aren't included
I would have to modify the Buff.lua with a new buff function and the call it in a blueprint. I've tried that, but it isn't working.

Edit: After looking at another mod that does what I want I was able to solve this problem. It seems that normally it is impossible for a unit to have a production buff and and adjacency buff at the same time. So I had to right a code that allowed that in the unit file and hook it. Works great now. On to the next mod mystery lol. I hope people don't get tired of my constant questions.
RavenCurow
Avatar-of-War
 
Posts: 98
Joined: 30 Oct 2014, 01:17
Has liked: 1 time
Been liked: 14 times
FAF User Name: RavenCurow


Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest