Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Vetrijar on Sun 28/03/2004 04:19:52

Title: Remainder of a division (SOLVED)
Post by: Vetrijar on Sun 28/03/2004 04:19:52
I had a couple of questions with the scripting feature

1. I havent' found any messages on what language the scripting is done in. Is it
    in C or C++ or just a limited version of one of those languages?

2. Does anyone have a suggestion on how to go about getting a remainder from
dividing two integers? I want to check whether the remainder is 0 or not. I was
trying to use the % command but that isn't recognized.

Thanks.

Title: Re:Scripting - language / remainder
Post by: Fuzzpilz on Sun 28/03/2004 04:38:29
1. AGS' script language is very C-like, but it isn't exactly C - there are a few C++isms in the syntax, and of course it's full of limits and idiosyncrasies due to its specialised nature.

2. The % operator (it's not a command) exists in AGS scripting since 2.61 beta 1. In older versions, you'll have to work around it - a%b is the same as a-(a/b)*b.
Title: Re:Scripting - language / remainder
Post by: Vetrijar on Sun 28/03/2004 08:20:56
So the / operator is available in the current 2.60 SP1 version and the % is in the next version coming out, right?  
Title: Re:Scripting - language / remainder
Post by: Vetrijar on Sun 28/03/2004 08:55:17
ok, no need to answer that last comment. I found it.

Works good now.  Thanks for the help !