Scripting Problem: Rommchange don't work Correctly

Started by kampfkaese, Tue 22/07/2014 19:57:27

Previous topic - Next topic

kampfkaese

Hello!

I realised a roomchange using this Method:

Quote
Remove all text from the field next to "walks off right edge".
Then click on "walks off right edge", then click the little ...-button.

This will open the room script and add this function to its end:
Code: Adventure Game Studio

    function room_LeaveRight()
    {
     
    }


Now put the line (player.ChangeRoom(2, ...); ) in between { and }.

But it wont work corectly. When my Player Character Switches the Room, just the Room is loaded but the Character is not Visible or Movable. I Tried different starting coordinates in Room 2 but it wont make a difference. I Use the Verb Coins Template.

Then i tried deleting Room2 and making a new one but no change.

Khris

If room 2 is loaded, then the room change works fine. AGS will always show the player's current room, so the player character is definitely in room 2.

Open the room and check its properties:
In the Settings category, there's an option called "ShowPlayerCharacter". Make sure it is set to true.

You can also press Ctrl-D in the game to see where the player character is. What does it say?

What coordinates did you try?

Walkable areas have a setting called AreaSpecificView. Make sure it isn't set to an empty view (0 is the default).

Did you change the player's transparency? Check the room script (though it should be empty if you deleted the room and created it anew).

kampfkaese

Quote from: Khris on Wed 23/07/2014 01:16:26
If room 2 is loaded, then the room change works fine. AGS will always show the player's current room, so the player character is definitely in room 2.

Open the room and check its properties:
In the Settings category, there's an option called "ShowPlayerCharacter". Make sure it is set to true.

You can also press Ctrl-D in the game to see where the player character is. What does it say?

What coordinates did you try?

Walkable areas have a setting called AreaSpecificView. Make sure it isn't set to an empty view (0 is the default).

Did you change the player's transparency? Check the room script (though it should be empty if you deleted the room and created it anew).

Hello!

Thanks for your help.

I made a screenshot of What the Game Says when pressing CTRL+D.

Screenshot 1
Screenshot 2

I Tried severalcoordinates within the Walkable Areas Area, exactly in the Middle etc.

I Tried setting AreaspecificView from 0 to 1 (Which is the Players View) but no change.. I did this in the Walkable Are Settings menu and the Room Setting. Nothing happens or differs.

Where do i find Player Transparency? But i dont think that thats the problem because i tried moving, but CTRL+D shows me that he has not.

Khris

I just remembered what is most likely going on; my guess is you drew a walkbehind instead of a walkable area. This will prevent moving and hide the player.

chucklas

Actually the first image says there are no walk behinds.  Look at the player's coordinates.  It says (570,405).  I seriously doubt this is anywhere in the visible room.  I would try player.ChangeRoom(2,20,20). See if he doesn't show up there.  The coordinates you are using appear to be way out of the range of the actual screen.

Khris

True, I completely missed that. I found the reason though.



Judging from the size of the pixels, this is a 640x480 game upscaled by 2.
The objects use 320 coords though, because they don't line up and are too close together.
Doubling them works, but it's still completely off somehow. The origin isn't at the top left, and the sizes have doubled now.

Bottom line: your character's coords need to be lower than 320/240, but you should never mix resolutions like that. AGS still supports it for legacy reasons, but there's no reason to use it in a new game.

kampfkaese

#6
I dont really understand!

I just used the verbcoin template and room 1 has same resolution. Nothing is upscaled, i drawed in paint in that resolution. It looks a bit streched because i stitched it a bit but room1 is 640&480 and works fine.

The coordinates 20, 20 work! How can i get the game to use 640&480 in the second room, too? I want to use every coordinates i mean...

Here is room1:
Screenshot 1
Screenshot 2

Khris

By upscaled I meant you're playing the game using the x2 filter.
Just look at the player's coordinates on room1 though, they are in the proper range for 320x240, given the player's position. Again, your game is set to use low res coordinates.

Edit: I just started a new VerbCoin game, and indeed that's the template's setting. Go to General settings -> Backwards Compatibility and set "Use low-resolution co-ordiates in script" back to "False".

kampfkaese

Yay!!! It works!!!

Thank your very very much!!!

Crimson Wizard

BTW, if anyone is using AGS 3.3.0, there's a newer VerbCoin template, recently uploaded by Elektroshokker:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=32745.0

It does not have this setting.

SMF spam blocked by CleanTalk