Mystic Software Forums
Mystic Software - Hosted Sites => Dark Age Games => Topic started by: DarkElite on January 29, 2004, 08:07:49 AM
-
is there any way to make a variable by adding text and another variable?
ex.
#variable!=3
#finalvar!=var+iable+!
#Mwin(finalvar!) *should show 3 in message window
althought im fairly certain that will not work, but you get the basic idea.
-
and also being able to add variable into the added variable
-
ex.
#crap$=cool
#finalvariable$=the+one+crap$+is+$
#Mwin(finalvariable$) *show "theonecoolis"
-
The second example works, the first one doesn't.
var+iable+! is not "variable!", though...
#code$ = "var"+"iable"+"!"+"=3"
#rpgcode(code$)
...works.
Variables are divided into literal($) and numeral(!) and one of them can't be added or subtracted to another one, if types don't match. Use #cast-xxx commands to turn variables between numeral and literal.
-
Yep. And to refine the second:
#crap$="cool"
#finalvariable$="theone"+crap$+"is"
#Mwin(finalvariable$) *show "theonecoolis"
-
so for something like a shop, or item getting sorta thing could i do this?
#itm1$=potion
#castnum(itm1$,itm1!)
#itm1!=itm1!+1
would that cause potion! to go up? or only the itm1! variable?
-
No, only the variable. "potion" equals 0 as a number, so itm1! equals 0+1=1.
I don't get exactly what you want to do... Up the "potion"? Make it "potion2"?
-
ummm.... I think I know what you are doing. But doing that gets you nowhere leave that first literal variable alone. but also have a numeric variable of the same name for a counter. so instead of that just add or subtract from potion!
-
This topic was made before half the people who post here have even joined. I'm sure the problem is fixed and/or forgotten.
-
And the other half no longer post. Smile