Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Random items?

3 years ago
I have a page the player will be on a lot, and I want to make it so certain items only show up there randomly. I can't see how to do this. I know how to make a random variable but the item just lets me pick one room that it's found in. To be clear I don't want to do ITEMSTATE either, it needs to be there so they can click it themselves. Does anyone know how?

Random items?

3 years ago
I don't believe it's possible. The system lets you define a location for an object. The object can be in that location or in the player's inventory. Generally that's it.

If you really, really wanted to do this, you could have an empty room that the player can't get to and use that as the location for all the items. Then you could do some scripting to decide which item was in the room. You could use that script to put the item in the description of the room. You could also set variables there to create a link to allow the player to pick up the item and then have a script that would put it in their inventory.

Or there might be an easier way, but that's the only way I can think of right now.

Random items?

3 years ago
That's what it looked like to me. That's too bad, I wanted the random items to be clicked for a guessing game. I'm going to try what BerkaZerka posted.

Random items?

3 years ago
There is a way.

First, you need to set the number of Uses of any Item you want to randomize to say 10.

Then use a Page Script on your first page to set all the Items to $ITEMSTATEX := 1 AND (in the same script) $ITEMUSEDX := 11.

This will add all the items to the player, but make them disappear (before the player sees them), because they have been used up.

In the Global Script, you add something like IF $ITEMUSEDX = 9 THEN $ITEMUSEDX := 0. This will keep the items usable forever.

When you want an Item to appear, just change $ITEMUSEDX := 0. To disappear, $ITEMUSEDX := 11 again.

For Items you actually want to have limited uses, you need to add a variable to track it and turn the item off when appropriate - or just give the item a number of uses less than your ON/OFF number AND less than the RESET number in the Global Script.

This is how you also get around the $ITEMSTATEX Bug off Page Links.

Random items?

3 years ago
This sounds really complicated D: But I'll try it. If I can't get it to work my other idea was to make copies of the rooms with items only in some of them, and use the random variable to send you to different ones without knowing the difference. But that was going to be a lot of work to.

Random items?

3 years ago
Neat idea. Though she did clearly say she didn't want to use ITEMSTATE... :)

Random items?

3 years ago
I realized later it was okay to have them in the inventory as long as they were random and it was easy to take them out again.

Random items?

3 years ago
I got it working! :D Well I sort of got it working, every so often it would put an extra item that wasn't supposed to be there in and then it would stop randomizing after a few times, but mizal was able to fix that part. I'm excited though, this is the biggest and most complicated script I've ever made and I have ideas for other things I can do with it now too.

Random items?

3 years ago
You had it right, you just needed the BEGIN and END in there around each section. I'm not sure exactly where the problem was but it had to do with the order the game was reading the things in the script in.