Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

timing an variable by percentage?

10 years ago

Is it possible to script that? 

timing an variable by percentage?

10 years ago

What do you mean timing a variable?

timing an variable by percentage?

10 years ago

I mean multiplying a variable by a percentage by using scripts. 

timing an variable by percentage?

10 years ago

It only works with integers (whole numbers), so no.

timing an variable by percentage?

10 years ago

I also have trouble with making $PAGETEXT to say "You level up!" every time you level up. 

I tried putting it like this.

IF %EXPERIENCE >= %NEXTLEVEL THEN

$PAGETEXT := $PAGETEXT + "You level up!"

 
That didn't work because experience gets set to 0 every time you level.
Then I tried this one.
 
IF %LEVEL = %LEVEL + 1 THEN
$PAGETEXT := $PAGETEXT + "You level up!"
 
That also didn't work because %LEVEL can't ever be more than itself logically. Then I just tried 
 
IF %LEVEL = 0 + 1 THEN
$PAGETEXT := $PAGETEXT + "You level up!"
 
The problem with that is that the words "You level up!" shown up on every page, and it doesn't go pass level 1. 
So if you have any ideas on what I should do, please help. Thanks. 
 

timing an variable by percentage?

10 years ago

Make another variable to see if they just leveled up (where you actually level them up).

Check that variable here, and set it back to 0 if they did level up (thus resetting the variable).

timing an variable by percentage?

10 years ago

But the level up places are random, and how do you write that in script form?

I'm so confused. 

timing an variable by percentage?

10 years ago

What do you mean they're random? You have the script in the global link script don't you?

timing an variable by percentage?

10 years ago

I don't understand how to translate your instructions into script language.

timing an variable by percentage?

10 years ago

Lets say you want 50% of X.

I think you can do X := X * 0.5.

If you can't, just do

X := X * 50 / 100

timing an variable by percentage?

10 years ago

But if the answer is a decimal it would jus round it to the nearest number right?

And thanks. That would work pretty good.

Also, I have another question.

Is it possible to set the variable to

If %VARIABLE INCREASE BY SO AND SO THEN

BEGIN

...

END

???

I think for now, all we have is equals to, bigger than, less than, and equals to or bigger than, or less than.

 

timing an variable by percentage?

10 years ago

Don't forget != (not equal)