.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $6.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: IV & V

Reply
 
Thread Tools Display Modes
  #1  
Old June 10th, 2007, 07:00 AM
Q's Avatar

Q Q is offline
Colonel
 
Join Date: Jan 2001
Posts: 1,661
Thanks: 0
Thanked 0 Times in 0 Posts
Q is on a distinguished road
Default 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.
Reply With Quote
  #2  
Old June 10th, 2007, 10:16 AM
Captain Kwok's Avatar

Captain Kwok Captain Kwok is offline
National Security Advisor
 
Join Date: Oct 2001
Location: Toronto, Canada
Posts: 5,623
Thanks: 1
Thanked 14 Times in 12 Posts
Captain Kwok is on a distinguished road
Default 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)
__________________
Space Empires Depot | SE:V Balance Mod
Reply With Quote
  #3  
Old June 10th, 2007, 10:49 AM
Q's Avatar

Q Q is offline
Colonel
 
Join Date: Jan 2001
Posts: 1,661
Thanks: 0
Thanked 0 Times in 0 Posts
Q is on a distinguished road
Default 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?
Reply With Quote
  #4  
Old June 10th, 2007, 01:48 PM
Captain Kwok's Avatar

Captain Kwok Captain Kwok is offline
National Security Advisor
 
Join Date: Oct 2001
Location: Toronto, Canada
Posts: 5,623
Thanks: 1
Thanked 14 Times in 12 Posts
Captain Kwok is on a distinguished road
Default Re: Need help with formula

The formula functions section has this sort of info at the end of modding guide in the docs folder.
__________________
Space Empires Depot | SE:V Balance Mod
Reply With Quote
  #5  
Old June 10th, 2007, 02:06 PM
Fyron's Avatar

Fyron Fyron is offline
Shrapnel Fanatic
 
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
Fyron is an unknown quantity at this point
Default 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.
__________________
It's not whether you win or lose that counts: it's how much pain you inflict along the way.
--- SpaceEmpires.net --- RSS --- SEnet ModWorks --- SEIV Modding 101 Tutorial
--- Join us in the #SpaceEmpires IRC channel on the Freenode IRC network.
--- Due to restrictively low sig limits, you must visit this link to view the rest of my signature.
Reply With Quote
  #6  
Old June 11th, 2007, 03:37 AM
Atrocities's Avatar

Atrocities Atrocities is offline
Shrapnel Fanatic
 
Join Date: Dec 2000
Location: USA
Posts: 15,630
Thanks: 0
Thanked 30 Times in 18 Posts
Atrocities is on a distinguished road
Default 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.
Reply With Quote
  #7  
Old June 11th, 2007, 07:36 AM

se5a se5a is offline
First Lieutenant
 
Join Date: Aug 2003
Location: New Zealand
Posts: 776
Thanks: 0
Thanked 0 Times in 0 Posts
se5a is on a distinguished road
Default 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]
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 04:57 PM.


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