i3lack0p 0 Posted June 14, 2004 Share Posted June 14, 2004 1st: Is there a way to execute a command as the result of a conditional statement. Such as changing the valuse of a counter or variable based on a math operation i.e. If (score / 10 > 0) Then score = ((score mod 10) * 5) 2nd: Can i do math like in the above question. I want to give bonus points for controlling this smoke in hamburgerhill like game I'm writing. I also wanna give bonus points at the end of the game for most kills. Also i track kills and base control seperately and need to add totals together for final scoring its late so i cant think of anymore right this sec... but i ill ask some more later Quote Link to post Share on other sites
Jack57 0 Posted June 14, 2004 Share Posted June 14, 2004 Absolutely you can You use the ContinueIf > CompareIntegers script. There is really no limit what you can achieve in this way. Igor doesn't really have an exact equilvalent of: If X Then Y Else Z End To achieve that you use the RedirectIf response - you get the same result, just a bit more long winded. In your example it would be simply: ContinueIf (score / 10 > 0) Set score = ((score mod 10) * 5) Quote Link to post Share on other sites
i3lack0p 0 Posted June 14, 2004 Author Share Posted June 14, 2004 ok thanks for the conditional info kind of knew those was looking more for an ifthenelse and seeing how there isnt one ill just have to deal... question it you use redirect if when it finishes the redirect function does it continue in the same script?.... also you didnt answer my question as far as the math goes... im want to add bonus points based on controlling the base/smoke for 10 consecutive sec intervals i.e if you control the smoke for 10 sec u get an additional 5 points... if you control it for 20 you get 10, 30 u get 15, so on and so forthe Quote Link to post Share on other sites
Jack57 0 Posted June 14, 2004 Share Posted June 14, 2004 ReDirectIf is a Call function so you need to specify a new group for it and it will execute all script blocks in that group that use the Call trigger. It is not the same as GroupEnable. also you didnt answer my question as far as the math goes... You use the ContinueIf > CompareIntegers script. There is really no limit what you can achieve in this way. So, you would do something like: Trigger: Timer Expired Responses: Set Timer to expire in 10 secs BlockPreserve ContinueIf Exist (flag?) KingCompany Set CompanyScore for the KingCompany to CompanyScore for the KingCompany + 10 You get the picture Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.