Math Functions
Merrie
28 Feb 2007, 02:08I might be blind as a bat
or perhaps Im not looking in the right area, but I was reading through the manual. Are there common math fuctions like + - / * ?
Thanks!

Thanks!
007bond
28 Feb 2007, 05:27I know someone tried to create a math library, but that was years ago.
I think it was Tr0n or GameBoy, not sure.
Speaking of libraries, what happened to MaDbRiT and his TypeLib?
I think it was Tr0n or GameBoy, not sure.
Speaking of libraries, what happened to MaDbRiT and his TypeLib?
Alex
28 Feb 2007, 11:56Yes, you can use common math functions.
You can enter any expression when setting the contents of a numeric variable, e.g.
2 + 2
3 * %something%
(%num% + 3) / 4
You can also enter a mathematical expression in any parameter by enclosing it with { braces }. For example, in a "Print a message" script, you can type:
You can enter any expression when setting the contents of a numeric variable, e.g.
2 + 2
3 * %something%
(%num% + 3) / 4
You can also enter a mathematical expression in any parameter by enclosing it with { braces }. For example, in a "Print a message" script, you can type:
You are carrying %beans% magic beans. If you buy 3 buckets, you will have { %beans% - (3 * #bucket:cost#) } left.
paul_one
28 Feb 2007, 12:20Oooo, very VERY nice!
Elexxorine
28 Feb 2007, 14:12Is that one of the new features?
Alex
28 Feb 2007, 14:50Yes, that's new in Quest 4.0.
I can recommend taking a look at http://www.axeuk.com/quest/developer/do ... pgrade.htm and also VERSIONS.TXT...
I can recommend taking a look at http://www.axeuk.com/quest/developer/do ... pgrade.htm and also VERSIONS.TXT...
Elexxorine
05 Mar 2007, 14:00Thanks. I haven't actually been using version 4, sticking to the old version until my game's finished... lol.
MaDbRiT
05 Mar 2007, 14:19007 Bond asked;
Well I'm still here, my typelib (as it was) was intended to provide functionality which was missing in Quest 3, a lot of which is now included in Quest 4, so large chunks of it are redundant.
I'm not in the least distressed by that, the fact many functions my typelib provided are now integral to Quest sort of proves that it served a purpose.
I do have a (shelved presently) new typelib that does 'lots of other stuff' that I've mentioned on here in the past. However as the #1 collaborator, tester and user of my code (and story-writer) is currently very tied up with 'real life'TM (she has a new baby to contend with!) My Quest activities are reduced to 'interested bystander'.
I'm also playing about with the other I-F engines, and I must admit that were I to write a game 'solo' I'd probably choose to use one of these as I'd be doing a 'strictly text' approach to allow running on other platforms than Windows.
Al (MaDbRiT)
Speaking of libraries, what happened to MaDbRiT and his TypeLib?
Well I'm still here, my typelib (as it was) was intended to provide functionality which was missing in Quest 3, a lot of which is now included in Quest 4, so large chunks of it are redundant.
I'm not in the least distressed by that, the fact many functions my typelib provided are now integral to Quest sort of proves that it served a purpose.

I do have a (shelved presently) new typelib that does 'lots of other stuff' that I've mentioned on here in the past. However as the #1 collaborator, tester and user of my code (and story-writer) is currently very tied up with 'real life'TM (she has a new baby to contend with!) My Quest activities are reduced to 'interested bystander'.
I'm also playing about with the other I-F engines, and I must admit that were I to write a game 'solo' I'd probably choose to use one of these as I'd be doing a 'strictly text' approach to allow running on other platforms than Windows.
Al (MaDbRiT)
steve the gaming guy
05 Mar 2007, 19:41Alex wrote:Yes, you can use common math functions.
You can enter any expression when setting the contents of a numeric variable, e.g.
2 + 2
3 * %something%
(%num% + 3) / 4
You can also enter a mathematical expression in any parameter by enclosing it with { braces }. For example, in a "Print a message" script, you can type:
You are carrying %beans% magic beans. If you buy 3 buckets, you will have { %beans% - (3 * #bucket:cost#) } left.
Very cool....even though I'm not a 100% programmer-thinking type. This is pointless but I was curious. In your example, what does the "cost" do?
Alex
05 Mar 2007, 20:55"cost" is a property of the "bucket" object in that example.