Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

Greater/lesser or equal to symbols

9 years ago

Guys, for some reason, neither the ≥ or ≤ symbols seem to be working, is there anything I can use instead? frown

Greater/lesser or equal to symbols

9 years ago

Or, alternatively, if anyone can give me another way to achieve this:

I'm having a 'lava coming towards you' sequence. If anyone can give me a way to make it display:

'The lava is a long way off' if lava distance is below 1

'The lava is quite far off' if lava distance is above 1 but below or equal to to 10

'The lava is quite near' if lava distance is above 10 but below or equal to 20

'The lava is not far off you' if lava distance is above 20 but below or equal to 30

'The lava is quite close to you' if lava distance is above 30 but below or equal to 40

'The lava is nearly on top of you' if lava distance is above 40 but below or equal to 49

And if it's 50, I already know how to do the whole 'death sequence thing.'

Greater/lesser or equal to symbols

9 years ago

lol the symbols work perfectly fine. It must be something else you're doing wrong. 

Greater/lesser or equal to symbols

9 years ago
Yeah, it really helps if you copy and paste your Script Code here :)

Greater/lesser or equal to symbols

9 years ago

>= and <= are the symbols, that's why.

Greater/lesser or equal to symbols

9 years ago
Are you actually using and , or are you using >= and <=?

Greater/lesser or equal to symbols

9 years ago

I was actually using ≥ and ≤.

Greater/lesser or equal to symbols

9 years ago

My code doesn't seem to be working. Here it is:

%%LAVADIST%%0%>=%1%The lava appears to be a very long way off.%%.

%%LAVADIST%%1%>=%10%The lava seems to be a long way off.%%.

%%LAVADIST%%10%>=%20%The lava is quite far off.%%.

%%LAVADIST%%20%>=%30%The lava is quite near.%%.

%%LAVADIST%%30%>=%40%The lava is quite close to you.%%.

%%LAVADIST%%40%>=%49%The lava is nearly on top of you.%%.

Greater/lesser or equal to symbols

9 years ago
Got an extra % in there to start... plus an extra value...

%%LAVADIST%>=%1%The lava appears to be a very long way off.%%.

---

Also, you have a logic problem, where more than one option will be true at the same time, resulting in multiple instances showing on your page simultaneously.

Greater/lesser or equal to symbols

9 years ago

My 'extra value''s purpose was to make it so that if it was greater than one number, but less than another number, it would show.

Unfortunately that doesn't seem to have worked.

Greater/lesser or equal to symbols

9 years ago

Hey, hang on, 

%0%<%%LAVADIST%%>=%1%The lava appears to be a very long way off.%%

Is this right?

Greater/lesser or equal to symbols

9 years ago

Unfortunately, no.

With On-Page Variables, you can't run a range the easy way, you would have to stat out all possible variations.

For example, to do what you posted above, would require this -

%%LAVADIST%<%10%The lava appears to be a very long way off.%%%%LAVADIST%=%10%The lava seems to be a long way off.%%%%LAVADIST%=%11%The lava seems to be a long way off.%%%%LAVADIST%=%12%The lava seems to be a long way off.%%%%LAVADIST%=%13%The lava seems to be a long way off.%%%%LAVADIST%=%14%The lava seems to be a long way off.%%%%LAVADIST%=%15%The lava seems to be a long way off.%%%%LAVADIST%=%16%The lava seems to be a long way off.%%%%LAVADIST%=%17%The lava seems to be a long way off.%%%%LAVADIST%=%18%The lava seems to be a long way off.%%%%LAVADIST%=%19%The lava seems to be a long way off.%%%%LAVADIST%=%20%The lava is quite far off.%%%%LAVADIST%=%21%The lava is quite far off.%%%%LAVADIST%=%22%The lava is quite far off.%%%%LAVADIST%=%23%The lava is quite far off.%%%%LAVADIST%=%24%The lava is quite far off.%%%%LAVADIST%=%25%The lava is quite far off.%%%%LAVADIST%=%26%The lava is quite far off.%%%%LAVADIST%=%27%The lava is quite far off.%%%%LAVADIST%=%28%The lava is quite far off.%%%%LAVADIST%=%29%The lava is quite far off.%%%%LAVADIST%=%30%The lava is quite near.%%%%LAVADIST%=%31%The lava is quite near.%%%%LAVADIST%=%32%The lava is quite near.%%%%LAVADIST%=%33%The lava is quite near.%%%%LAVADIST%=%34%The lava is quite near.%%%%LAVADIST%=%35%The lava is quite near.%%%%LAVADIST%=%36%The lava is quite near.%%%%LAVADIST%=%37%The lava is quite near.%%%%LAVADIST%=%38%The lava is quite near.%%%%LAVADIST%=%39%The lava is quite near.%%%%LAVADIST%=%40%The lava is quite close to you.%%%%LAVADIST%=%41%The lava is quite close to you.%%%%LAVADIST%=%42%The lava is quite close to you.%%%%LAVADIST%=%43%The lava is quite close to you.%%%%LAVADIST%=%44%The lava is quite close to you.%%%%LAVADIST%=%45%The lava is quite close to you.%%%%LAVADIST%=%46%The lava is quite close to you.%%%%LAVADIST%=%47%The lava is quite close to you.%%%%LAVADIST%=%48%The lava is quite close to you.%%%%LAVADIST%=%49%The lava is quite close to you.%%%%LAVADIST%>%49%The lava is nearly on top of you.%%

Greater/lesser or equal to symbols

9 years ago

But this is a great idea, albeit, it is a huge amount to paste into almost every page.frown

Greater/lesser or equal to symbols

9 years ago
Cut and paste is your friend~

Greater/lesser or equal to symbols

9 years ago

%LAVADIST2 := %LAVADIST/10

You have to change the numbers a bit, but since your range is around 10 this would work better.

LAVADIST range 0-9 = LAVADIST2 is 0
LAVADIST range 10-19 = LAVADIST2 is 1
LAVADIST range 20-29 = LAVADIST2 is 2
LAVADIST range 30-39 = LAVADIST2 is 3
LAVADIST range 40-49 = LAVADIST2 is 4

Then change your comparisons to check lavadist2 instead.

%%LAVADIST%%20%>=%30%The lava is quite near.%%.

Becomes:

%%LAVADIST2%=%2%The lava is quite near.%%.

Make sense?

Greater/lesser or equal to symbols

9 years ago

^Makes for less typing haha!

%%LAVADIST%<%2%The lava appears to be a very long way off.%%%%LAVADIST%=%2%The lava is quite far off.%%%%LAVADIST%=%3%The lava is quite near.%%%%LAVADIST%=%4%The lava is quite close to you.%%%%LAVADIST%>%4%The lava is nearly on top of you.%%

Greater/lesser or equal to symbols

9 years ago

The only trouble with this is the fact that I want to vary the amount of time it takes to do certain things.

Greater/lesser or equal to symbols

9 years ago

I don't see how that is trouble at all given all you asked was to accomplish what we just did, unless you forgot to mention something.

Greater/lesser or equal to symbols

9 years ago

I have no idea what you just said.

Greater/lesser or equal to symbols

9 years ago

1. Make another variable called LAVADIST2

2. Set it equal to LAVADIST/10

3. Fancy math makes this work

4. Do what Berka said to do below my post

5. It will work

Greater/lesser or equal to symbols

9 years ago

How do I make a variable constantly another variable, albeit changed in some way? I'm quite new at this. This will be my first published game.

Greater/lesser or equal to symbols

9 years ago

Put the script in the global link script and it will refresh every page.

Greater/lesser or equal to symbols

9 years ago

Would that be %%LAVADIST%=%LAVADIST/2%?

Greater/lesser or equal to symbols

9 years ago

No. Going like this:

%%LAVADIST%=%1%Write Something%%

Is an IF statement.

IF %LAVADIST is EQUAL to 1 THEN PRINT "Write Something"

Is how you would read it. You only use it when you want to write things on a page if a value is equal to something. Not to mention your script there (if it worked like you intended, and it doesn't) would set lavadist equal to half of itself.

I already wrote the actual line, it's:

%LAVADIST2 := %LAVADIST/10

:= sets something equal to something

Greater/lesser or equal to symbols

9 years ago

How would I go about making LAVADIST round down to the nearest indices?

Greater/lesser or equal to symbols

9 years ago

That doesn't makes sense as a question. The nearest indices?

Greater/lesser or equal to symbols

9 years ago

%LAVADIST2 := %LAVADIST/10

If this is the case, then the answer might be a decimal point. In order to make it do what I want it to do, it'll need to round down to the nearest integer*.

*Whole number.

Greater/lesser or equal to symbols

9 years ago

The system uses integers (whole numbers). Any division done is automatically rounded down to the nearest whole number.

Greater/lesser or equal to symbols

9 years ago

Ok, thanks!

Greater/lesser or equal to symbols

9 years ago

Sorry, I meant whole number!