Im sorry if this was asked but I couldnt find it.
When making a If statement with a variable I saw this # symbol...
This is the same thing as ==?
no
I suggest you give the full line you read, then we can explain it to you
# is a comment in Ruby (XP, VX, VX Ace). It means anything after # on the line is ignored.
It has no meaning in Javascript (MV) outside of a hexadecimal code.
Where did you see it?
In if statement when we check variable and then we can choose =, >, <, ...
Below < have a symbol.
I want to know what that symbol do.
≠ ≠ # .
It means not equals or !=. It's an equal sign with a slash across it.
You should probably post the line of code you saw it in, because right now, it doesn't mean anything to actual JS code. html/css uses it to denote hex color codes, and private fields in class declarations use it, but the latter is an experimental feature that isn't currently available.
You're probably right, actually. I guess I was overthinking it, wondering if maybe he saw some weird code example or something.
Oh, well if that's the case, that's NOT a # symbol - the two are very different and mean different things. I thought he was saying there's a # in a script formula somewhere.
A screenshot would have done the job nicely 🙂
If your question is now resolved, just report your first post and let the mods know, and they'll close the thread for you.
Thanks for your help.
One more question...
How I do >= in script language?
Or where I can find a link or something.
Now I know != is "not equal".
Because I want to put a limit in this code but only works with the IF of the Software.
For exemple
10 in 10 minutes I gain passive gold but I want a limit to reach.
I have in my code
IF variable >= 120
Variable = 120
else
var minutes = $gameVariables.value(22);
var seconds = $gameVariables.value(21);
var earnings = $gameVariables.value(7);
earnings = earnings + 20;
if (minutes === 0 && seconds === 0) {$gameVariables.setValue(7, earnings);}
else if (minutes === 10 && seconds === 0) {$gameVariables.setValue(7, earnings);}
else if (minutes === 20 && seconds === 0) {$gameVariables.setValue(7, earnings);}
else if (minutes === 30 && seconds === 0) {$gameVariables.setValue(7, earnings);}
else if (minutes === 40 && seconds === 0) {$gameVariables.setValue(7, earnings);}
else if(minutes === 50 && seconds === 0) {$gameVariables.setValue(7, earnings);}
Works well in this form
But I want to put the code before the first else in the script and I dont know how to make a >=
When i try to pass to script the gold jump from 80 to 120.
Just do > 120.
>= is greater than or equal to, but if it's equal to, you don't need to change it, because it's already the correct value. So you just have to check for greater than, or >
But the top bit of code I gave you is the list of event commands to use, without having to do a big, long, convoluted if statement like you've got.
In fact if you already have a clock script that ticks over the seconds and minutes, you could just put the check right in that - when the minutes change, see if it's a multiple of 10 (mod 10 === 0), and then give the gold.
minutes mod 10 === 0
is the same as saying minutes === 0 or minutes === 10 or minutes === 20 or minutes === 30 or minutes === 40 or minutes === 50
And you can remove the seconds === 0 check from every test and put it right at the start, so you only check the minutes if the seconds IS 0.
To have a thread closed, you need to report your first post and let the mods know you're done with it. Don't rely on them seeing and reading a comment.