.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Space Empires: IV & V (http://forum.shrapnelgames.com/forumdisplay.php?f=20)
-   -   Need help with formula (http://forum.shrapnelgames.com/showthread.php?t=35020)

Q June 10th, 2007 07:00 AM

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.

Captain Kwok June 10th, 2007 10:16 AM

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)

Q June 10th, 2007 10:49 AM

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?

Captain Kwok June 10th, 2007 01:48 PM

Re: Need help with formula
 
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

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.

Atrocities June 11th, 2007 03:37 AM

Re: Need help with formula
 
This is why I leave modding SE V to the professionals.

se5a June 11th, 2007 07:36 AM

Re: Need help with formula
 
it's not really that hard AT, once you sit down and look at it.


All times are GMT -4. The time now is 02:51 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.