Scripts - ApplyEffect() format

Discussion of modding the game 'Kudos 2'
Peccavio
Junior Line Worker
Junior Line Worker
Posts: 1
Joined: Thu Mar 12, 2009 10:39 am

Scripts - ApplyEffect() format

Postby Peccavio » Thu Mar 12, 2009 5:08 pm

I was wondering...

I see 3 formats using 3 or 4 arguments:

ApplyEffect(confidence,-0.35,0.8,dumped);
ApplyEffect(happiness,-0.14,_HAPPINESS_DEGRADE,default bad);
ApplyEffect(stress,0.310,_STRESS_DEGRADE);

The first argument seems to be the attribute. Followed with a min/max value.
The _CAP_LETTERS seem some default or current value.
What is the (optional) 4th label?
xenomath
Junior Line Supervisor
Junior Line Supervisor
Posts: 10
Joined: Fri Aug 28, 2009 9:22 am

Re: Scripts - ApplyEffect() format

Postby xenomath » Fri Aug 28, 2009 9:48 am

I think the 4th argument is some kind of debug information to track where changes to an attribute came from.

I don't think that the second argument has something to do with min/max value, it seems to be simply amount the value should change, so a negative value will make it go down.

What I am puzzled about is what exactly the third argument does. The Caps letters just seem to point to a constant defined somewhere else.
Probably this is some kind of min max value or some other kind of factor to decrease a change when approaching the extremes 0 and 1.
Anyone knowing more details?
xenomath
Junior Line Supervisor
Junior Line Supervisor
Posts: 10
Joined: Fri Aug 28, 2009 9:22 am

Re: Scripts - ApplyEffect() format

Postby xenomath » Sun Sep 27, 2009 11:46 am

Ok forget about my guessing former guessing stuff regarding the third parameter.

After playing around a bit I'm now quite sure it works this way:
The third parameter is the dracrease factor of the attribute change.
The value of an attribute is it's default value plus all the changes in history.
After every day all the changes are multiplied by their decrease factor, being removed if they became too small.
So a decrease factor of 0.0 means, the change is just for one day, a factor of 1.0 and the change will be permanent.
Given the exponential curve the values will decrease quite fast, unless the values is very near to 1.0, this is why you see values like 0.97
which results in a half-value period of about 3 weeks.

All this becomes quite clear if you take a look into the save game files.

Return to “Kudos 2 Modding”

Who is online

Users browsing this forum: No registered users and 3 guests