PDA

View Full Version : Need help with formula


Q
June 10th, 2007, 07:00 AM
What is wrong with:

Ability 2 Amount 2 Formula := iif([%Level%] > 3), (([%Level%] - 3) * 2), 0

SE V does not accept it and gives the error message of "incorrect number of parameters for function iif([%Level%] > 3)".

I want the Amount of Ability 2 (minesweeping) to be as follows:

Level 1 : 0
Level 2 : 0
Level 3 : 0
Level 4 : 2
Level 5 : 4
Level 6 : 6

Thank you for you help.

Captain Kwok
June 10th, 2007, 10:16 AM
Your parenthesis were not correct.

It should be like this:
iif([%Level%] > 3, ([%Level%] - 3) * 2, 0)

The general format for iif is:
iff(Condition, TRUE, FALSE)

Q
June 10th, 2007, 10:49 AM
Great, that worked. Thank you very much Kwok.
Is there any documentation about the correct syntax of formulas like this one?

Captain Kwok
June 10th, 2007, 01:48 PM
The formula functions section has this sort of info at the end of modding guide in the docs folder.

Fyron
June 10th, 2007, 02:06 PM
Keep in mind that pretty much everything put in the formula fields is an actual function, rather that a flow control keyword as in pretty much every programming language. Everything beyond basic math/boolean operators needs to be used as a function call.

Atrocities
June 11th, 2007, 03:37 AM
This is why I leave modding SE V to the professionals.

se5a
June 11th, 2007, 07:36 AM
it's not really that hard AT, once you sit down and look at it.