Error "two room changes" when using Regions

Started by tweety, Wed 07/07/2004 01:19:01

Previous topic - Next topic

tweety

Hello, this is my first post in this board.  :o

I'm trying to make my first bigger game, but after some tests i experienced a problem:

every now and then, when the player leaves a room for another, i get an error with something like "two room changes" in it.

I made up regions around the exit area of each room. when the player enters them, I change the room within the "Player enters region" ...ehm... thing :) in the interactions of that region...

i cannot reproduce the error, it just happens in one room and at the next attempt in another. sometimes i can enter and leave a room three times, and it crashes on the fourth time...  ???

i already made sure that the player (when taken to a new room) "lands" outside the region that would send him right back to the room where he has come from...

has anyone some ideas how to fix this?
there's no place like ~/

Gilbert

Hmm can you upload the room files in question for us to check?

tweety

Thanks for the offer, but now it seems to work... how very strange, since I didn't change anything...

I rebooted my computer and it just worked...
is it possible that if you run the editor for a long time, it gets somehow confused when compiling the game?

Anyway, I'm thinking about changing the way the character changes rooms - since it's a large dungeon, it's probably better to use some kind of map with clickable areas that lead you to the specific room - i myself got lost one time when testing the game :)
So, if the error will occur again, I'll just change to that map thing  ;)

but again, thanks for your offer :)
there's no place like ~/

tweety

#3
Since it DOES happen again with two important rooms, I'm gonna need some help with it.
The exact error message is:

Quote
An error has occured ... likely to be a scripting error...

(ACI version 2.61.747)
(Global script line 63)
Error: NewRoom: requested 2 room changes within one script

line 63 in the global script is:
Quote
ProcessClick(mouse.x,mouse.y,GetCursorMode());
inside the on_mouse_click function.

I uploaded the two rooms to
http://www.nutzlos-aber-vorhanden.de/ags/Room4.crm
http://www.nutzlos-aber-vorhanden.de/ags/Room10.crm

The problem is when the player enters the doorway with the red lighting in Room 4 - or leaves Room 10 through the door... Happens not everytime, but every now and then...

UPDATE: I found the problem: It only works when the cursor is in "walk" mode, it crashes on every other mode, giving the error above...
Is this a bug or a feature? ;)
Why do cursor modes other than "walk" call "NewRoom" on their own? Or don't they do that?
Now I'm really confused...
Anyway, I'm gonna add conditionals to my code that check for the cursor mode, and everything should work fine.

Thanks
there's no place like ~/

Gilbert

I think I sort of know the problem, I don't know if it's been brought up already, but this is ought to be a limitation or a bug in the engine I think, seems that when you click the region with modes other than walk and you set a walk-to point that will cause a problem.

Here is a (not-so-good) walkaround, let's use that room 10 door as an example. What I did is:

1. Load room 10.
2. Change the action of that "Player walks to region" to "Game - Set variable value", press the first "Change" button, press "Edit variables", check the "room" radio box then press "New variable..." to define a new room variable, let's call it say, "leave room", leave it's initial value at 0. , then set that action to set the variable "leave room" to 1. Like this:

leave=1;
3. In the room's interaction menu, add an action for "repeatedly execute" and set the action like this:


@CJ primary: I think this is similar to the old player enters screen for first time played twice bug, is it a known issue ?

Ashen

Or, try adding a Stop Moving command to the region interaction, e.g.

(Room 4, region 3)
Player walks onto region
    Character - Stop character walking (EGO)
    Player - Go to a different room (at specific co-ordinates)(10, 290, 130)

For some reason, I get a glitch where the character is in the middle of the room for a second, but it doesn't crash. The only other way I've got it to work properly is by using either hotspots or regions, not the combination you're using. Hope this is some help.
I know what you're thinking ... Don't think that.

tweety

Quote from: Ashen on Thu 08/07/2004 14:24:31
The only other way I've got it to work properly is by using either hotspots or regions, not the combination you're using. Hope this is some help.

Okay, thanks for that hint - but what is the best way to do that?
I had the following in mind:

- when there is a click on an area (let's say the door), the player first walks to that area and is then taken to the new room (yes, i know, that's what is normally happening :) )

If I use hotspots only, will I have to use "Player stands on hotspot"? this is marked "obsolete" in my editor since there are regions now. Can I still use "Player stands on hotspot"? or is it going to be removed in the future?

And if i use regions, I won't be able to display the name of the region in my gui (with "@OVERHOTSPOT@")...

So I'm kind of stuck between two things, I thought the combination of them would work, but unfortunately it doesn't...

Did I miss something or got something wrong? If yes, please let me know...
there's no place like ~/

Ashen

QuoteIf I use hotspots only, will I have to use "Player stands on hotspot"?
No, just put the 'New Room' command in the  'Interact with hotspot' section. The problem with that, however, is that it won't work when the player walks in to the hut by themselves (in the case of room 4, hotspot 5 "Halle der Schmiede").

Having thought about it, though, if you leave the region as it is, add the interaction to the hotspot, and just move the walk-to point off the region, it should work both ways - walking into the hut will trigger the region-based room change, interacting with it will trigger the hotspot. The same would work with the doorway in room 10, just set the hotspot's walk-to point to be outside of the region.

Does that make sense? I don't know if I explained very well. If not, let me know, or maybe someone else can put it better.
I know what you're thinking ... Don't think that.

tweety

oh yes, it works, thank you :)

Why didn't I think of that earlier? I don't even know now, why I ... okay, enough of that - the important thing is that it works :)

thanks again
there's no place like ~/

Pumaman

Ah, well spotted - there's a conflict between NewRoomEx, walk-to points and region interactions.

A workaround is to add a Stop Character Moving command before you do the Go To Differnet Room command.

I'll get it fixed properly in the next version.

tweety

Ehm... I tried that workaround, but then my character appears clearly visible for about one second at the new coordinates, but in the old room before he is taken to the new room. this is what Ashen already mentioned - but now it is even better to see...

well... will it be wasted time if I waited for the next version with that bug fixed?
or can I leave those areas as they are and continue to write my game? I guess when I have finished it, the new version will be available - and then I can just recompile my game with that version and that bug won't be there anymore...

Am I getting that right? Sorry for bothering you, but since i am new with AGS, I don't know how version changing during game design affects my designed game...
there's no place like ~/

Pumaman

Yep, that's right. Just leave it as is, and wait for the next version. I hope to release a new beta version within the next couple of weeks.

SMF spam blocked by CleanTalk