Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

How to Permanently Increase the Maximum Variable

11 years ago

I have a part in my game where the player can upgrade their items. The maximum value is 10. How do I permanently increase the maximum value to 20 when the player buys the upgrade, using the same variable?

How to Permanently Increase the Maximum Variable

11 years ago

Just set the variable's maximum to 20 in the variable list.

How to Permanently Increase the Maximum Variable

11 years ago

My story involves scuba diving. If you go underwater, you have oxygen level at 10. What I wanted to do was have the player go to a shop and purchase an oxygen tank upgrade to oxygen level 20. How would I go about doing that if I just increased the max in the main variable area? 

This is why I'm a little confused right now. If the player emerges to the surface, it'll just reset to the wrong number.

How to Permanently Increase the Maximum Variable

11 years ago

While I have no idea what you mean by it'll reset the wrong number, you can just check to see the value of the variable to determine how far down they can go. Variables can change their value after all, max is just the absolute highest you want it to be able to be.

How to Permanently Increase the Maximum Variable

11 years ago

It should be noted however, that the system will ignore the Max setting when you use Scripting.

How to Permanently Increase the Maximum Variable

11 years ago

I don't think you can do it. Needs some scripting...

How to Permanently Increase the Maximum Variable

11 years ago

Set the maximum to 20 originally and just make a script that it can't go over 10 if pageID is less than targetpageID.

How to Permanently Increase the Maximum Variable

11 years ago

So I kind of did it a different way.
I set the maximum to 50, then when you select "resurface", there's two possible options to choose, but only one of the options is visible to the reader:

1) Resets the value to 10 if and only if the reader's oxygen level is < 10.

2) Does nothing if and only if the reader's oxygen level is >= 10.