ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

using multiplcation in an expression

This forum is the place to discuss the older ADRIFT versions 3.9 and 4.0.

Please refer to the ADRIFT 4 Manual for more information.

using multiplcation in an expression

Postby brickman21 » Sun Dec 11, 2011 1:49 am

Hy, I'm writing an adventure where I would like to change a variable by reducing it by three times another variable.
Something like this: range = %range% - 3 * %turns% but this generates an error. I don't know if this is a syntax error
or if multiplication is not supported. :?
brickman21
 
Posts: 3
Joined: Sun Dec 11, 2011 12:52 am

Re: using multiplcation in an expression

Postby Campbell » Sun Dec 11, 2011 10:35 am

What's the error?
ADRIFT Developer developer.
User avatar
Campbell
Site Admin
 
Posts: 4570
Joined: Sun Jun 23, 2002 11:05 am
Location: Edinburgh, Scotland

Re: using multiplcation in an expression

Postby NickyDude » Sun Dec 11, 2011 12:56 pm

Multiplication is 'times' as in 2x6 = 12, what you're doing is subtraction; 10-5 = 5. :)
ImageI reject your reality and substitute my own...
User avatar
NickyDude
Moderator
 
Posts: 2466
Joined: Sun Jun 23, 2002 10:36 pm
Location: UK

Re: using multiplcation in an expression

Postby brickman21 » Sun Dec 11, 2011 4:19 pm

I realize I have subtraction in the equation but the expression I'm trying to use is range = range - 3 * turns. I thought it should look like: range = %range% - 3 * %turns%. The objective is to initially set "range" to a number, say 120, then activate it in an event and with subsequent calls to a task to reduce the value of range by 3 times the number of turns elapsed. There is little direction for this in the manual.
brickman21
 
Posts: 3
Joined: Sun Dec 11, 2011 12:52 am

Re: using multiplcation in an expression

Postby brickman21 » Sun Dec 11, 2011 4:21 pm

I was using "*" for multiplication should I use "x"
brickman21
 
Posts: 3
Joined: Sun Dec 11, 2011 12:52 am

Re: using multiplcation in an expression

Postby NickyDude » Sun Dec 11, 2011 7:23 pm

I realize I have subtraction in the equation but the expression I'm trying to use is range = range - 3 * turns.


Ahh, yes you are, sorry about that. :blush:

I was using "*" for multiplication should I use "x"


No, "*" is correct for multiplication.
ImageI reject your reality and substitute my own...
User avatar
NickyDude
Moderator
 
Posts: 2466
Joined: Sun Jun 23, 2002 10:36 pm
Location: UK


Return to ADRIFT 3.9 and 4.0

Who is online

Users browsing this forum: No registered users and 6 guests