Probem with room changing cutscene

Started by llamaman, Thu 26/04/2007 10:19:33

Previous topic - Next topic

llamaman

I currently want my game to run a cutscene when you click a certain cursor, which I'll call "Poke" on this particular character. 
So, I've made it such that if you poke them it starts running a script.  Then I found out that it doesn't like you doing a changeroom in the middle of a script, before you move a character. 

So I tried putting the changeroom in a function call, and that didn't work.  So then, I changed my on poke to be running three scripts from  the graphical menu. 
The first one sends my invisible main charater(in that room) and the character who I want in the cutscene to the new room, storing the old room# and their positions to global variables, declared at the top of the global script.
This part appears to work.

Then second script part should have character 2 doing stuff, and talking.  She instead just stands there.  If I poke her again, the screen goes black.  However, if I hardcode the room values, it seems to teleport me to the room I hardcode, after a length of time that could be accounted for by the script invisibly running.

And Script3 never seems to activate ever.
Here's my code, in case you have any pointers.
http://rafb.net/p/b0eB3y94.html

Additionally, there is a character1_a section with nothing in it, that I don't believe is referenced by the program.

Khris

From the manual, regarding Character.ChangeRoom()
QuoteIf you call this on the player character, then the current room is unloaded from memory and ROOMx.CRM is loaded instead, where X is room_number.

IMPORTANT: This command does not change the room immediately; instead, it will perform the actual room change once your script function has finished (This is to avoid problems with unloading the script while it is still running). This means that you should not use any other commands which rely on the new room (object positionings, and so on) after this command within the same function.

You'll have to put everything you want to happen after the room change into the new room's player enters screen (after fadein).

You don't need any of the global vars you're using.
The character's coordinates won't change if you simply use cJack.ChangeRoom(1); since the coords are optional. Plus, you can access the previous room a character was in by using Character.PreviousRoom.

SMF spam blocked by CleanTalk