Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Item event for chapters

11 years ago

Okay, so for the game I'm doing, I'm making it so that all the items can be used on every page, even if it's just to take you to a page saying "That item doesn't work here." Unfortunately there are a lot of pages, and what I want to do is make it so that the game takes you to a different page depending what chapter you're on, example: Use Book on chapter 2, go to Use Book page on chapter 2. That doesn't seem to be an option though, and so I've had to add a destination for using the item every single page in the game... It takes a long time. I don't suppose there's any way to script it so that you only have to put in a destination for that chapter, and not for every single page in the chapter?

Item event for chapters

11 years ago

You could probably do it in the item script. There's a chapter ID variable, which likely stores which chapter you're currently in. So in the item script just check which chapter it is, and set the destination to that page.

$CHAPTERID is the variable

Item event for chapters

11 years ago

Okey dokey! So it'd be something like:

$CHAPTERID = 1 THEN

... What's the variable for the page number? Is it $PAGEID?

Item event for chapters

11 years ago

$DEST := @P99

Then after the P you do the number of the page (replace 99 with the number).

Item event for chapters

11 years ago

Hmm... I must be doing it wrong. I tried:

$CHAPTERID = 5 THEN

$DEST := @P40
 
But it said there were errors in the script.

Item event for chapters

11 years ago

Add an IF to the start of that haha. 

Item event for chapters

11 years ago

... Oh yeah cheeky

Item event for chapters

11 years ago

It works! Killa, I love you so much! This is literally going to save me hours! ^_^