Help with coding if a variable is relative

R

ReytheN00B

Guest
Hey, I've been using Game maker for a while, and I've begun to develop practice games and such. So far, I have made a health system that uses purely code. I know that it is a little weird to not use the feature of drag and drop, but is there a way to make a variable relative or not through coding, instead?
 
G

guadalcanal

Guest
You want to declare a variable? Just do
Code:
myVariable = "I am a variable!"
If you just want to declare a variable only accessible in the event or script, you can do it like this:
Code:
var myVar;
var myOtherVar = 1;
myVar = 50;
Variables themselves are not relative or absolute. You can change them relatively by doing
Code:
variable (+ or * or - or / or %)=number
or
Code:
 variable = variable + amount
 
Last edited by a moderator:

FrostyCat

Member
I know that it is a little weird to not use the feature of drag and drop
I'd drop this misguided mindset right now if I were you. People who rely on drag-and-drop are the weird and marginalized ones around here, not people who use code. Most features of GMS are GML-only, and GML is the only format that makes practical sense for posting on a forum.
 
Top