A question about Absolute Value in script call

Orichalcum+

Veteran
Veteran
Joined
Apr 17, 2015
Messages
72
Reaction score
52
First Language
English
Primarily Uses
I wrote this in the script box (the one on event page 3). I was hoping it would give me the absolute value of that variable.

DIX = DIX.absHowever, it results in 0 every time, it doesn't matter if "DIX" is positive or negative.

So my question is how do I make a variable assume its absolute value?

The end goal is to check the distance between 2 events.

EDIT:The two events are not always the same, so I don't want to use control variables to determine the distance. 

Wait wait, its more accurate to say that I'd prefer not to use control variables, looked over some old notes in ACE.

If the problem isn't with ".abs" I could solve this using the script box in control variables.
 
Last edited by a moderator:

Quxios

Veteran
Veteran
Joined
Jan 8, 2014
Messages
1,055
Reaction score
785
First Language
English
Primarily Uses
RMMV
Well the .abs was a ruby function. For JS you will have to do:

Code:
Math.abs(your number or variable in here)
 

Orichalcum+

Veteran
Veteran
Joined
Apr 17, 2015
Messages
72
Reaction score
52
First Language
English
Primarily Uses
Worked amazingly, Thank you lots :)  
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.
time for a new avatar :)

Forum statistics

Threads
106,018
Messages
1,018,357
Members
137,803
Latest member
andrewcole
Top