|
|
|
|
June 10th, 2007, 07:00 AM
|
|
Colonel
|
|
Join Date: Jan 2001
Posts: 1,661
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Need help with formula
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.
|
June 10th, 2007, 10:16 AM
|
|
National Security Advisor
|
|
Join Date: Oct 2001
Location: Toronto, Canada
Posts: 5,623
Thanks: 1
Thanked 14 Times in 12 Posts
|
|
Re: Need help with formula
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)
|
June 10th, 2007, 10:49 AM
|
|
Colonel
|
|
Join Date: Jan 2001
Posts: 1,661
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: Need help with formula
Great, that worked. Thank you very much Kwok.
Is there any documentation about the correct syntax of formulas like this one?
|
June 10th, 2007, 01:48 PM
|
|
National Security Advisor
|
|
Join Date: Oct 2001
Location: Toronto, Canada
Posts: 5,623
Thanks: 1
Thanked 14 Times in 12 Posts
|
|
Re: Need help with formula
The formula functions section has this sort of info at the end of modding guide in the docs folder.
|
June 10th, 2007, 02:06 PM
|
|
Shrapnel Fanatic
|
|
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
|
|
Re: Need help with formula
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.
|
June 11th, 2007, 03:37 AM
|
|
Shrapnel Fanatic
|
|
Join Date: Dec 2000
Location: USA
Posts: 15,630
Thanks: 0
Thanked 30 Times in 18 Posts
|
|
Re: Need help with formula
This is why I leave modding SE V to the professionals.
__________________
Creator of the Star Trek Mod - AST Mod - 78 Ship Sets - Conquest Mod - Atrocities Star Wars Mod - Galaxy Reborn Mod - and Subterfuge Mod.
|
June 11th, 2007, 07:36 AM
|
First Lieutenant
|
|
Join Date: Aug 2003
Location: New Zealand
Posts: 776
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: Need help with formula
it's not really that hard AT, once you sit down and look at it.
__________________
[img]/threads/images/Graemlins/Flag_NewZeland.gif[/img]
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
|
|