Stupid newbie questions about character position and movement

Started by TheQisSilent, Tue 18/11/2003 11:23:35

Previous topic - Next topic

TheQisSilent

OK, I have two questions right now that will probably forever mark me a stupid newbie-

1.  How do you make npc's change rooms at specific coordinates?  Yes, I did check the manual and tried the whole scripting thing but I'm having some trouble getting the hang of it.

2. How do you make someone start from offscreen and end offscreen?  For instance, in my game's opening scene I'm having the character fall and I want him to fall down through one screen.  How can I do this?

These are my stupid newbie questions now.  I'll probably be coming back with some more later.


Follow the updates and download the demo of AFRO JONES- IN COLOR!

Timosity

1. to change any character room and coordinates:

character[NPC].room=5;

character[NPC].x=100;
character[NPC].y=150;

2. To have a character outside the visible part of the screen just set the coordinates outside the range of the screen.


If you need any more detail, just ask, but that should help you.

~Tim

TheQisSilent

Again, this is probably still just dumb newbie-ouscity of me, but-

1. The problem is that offscreen would have to go into negative coordinates and it won't let the character move because it's not within the walkable area boundaries.  Is there any way around this?

2. Whenever I try to test the game with this it says that the game encountered an unexpected "character."  Where exactly would I put this?

Well, I feel dumb now.  Thanks for the help, it really is- well, helpful.  Now I feel even dumber ;).


Follow the updates and download the demo of AFRO JONES- IN COLOR!

Timosity

Quote from: TheQisSilent on Tue 18/11/2003 12:51:58
1. The problem is that offscreen would have to go into negative coordinates and it won't let the character move because it's not within the walkable area boundaries.  Is there any way around this?

OK, if the player is not on a walkable area you can use:

MoveCharacterDirect(EGO,160,250);
while (character[EGO].walking) Wait(1);

this should allow you to move the character off the screen

Quote
2. Whenever I try to test the game with this it says that the game encountered an unexpected "character."  Where exactly would I put this?

It depends when you want to move the character to the new room, or coordinates.

eg. if you want it to happen before the player enters that particular room, put it in player enters screen (before fadein)

If you want it to happen when the player leaves the screen put it in Player leaves screen

If you want it to happen if you interact with a hotspot or object, put it in the interaction for that hotspot or object.


I hope that's a bit clearer.

~Tim

TheQisSilent

Wow, thanks, this is helping a lot.  Only one teeny problem left-  when the player's falling, I made the second coordinates off the screen but he just hits the bottom and then switches to the other room.  Can I get him to go all the way off the screen or am I stuck?

But seriously, thanks for all the help.  It's getting this whole development stage going a lot smoother now.


Follow the updates and download the demo of AFRO JONES- IN COLOR!

Timosity

Do you have it so the player goes to a new room when he goes past the bottom of the screen? eg.walk off bottom edge

if so, remove that bit of code and add

NewRoomEx(2,100,100); //will change to room 2 with the player at coordinates 100,100 (you can set it to whatever room and coordinates you like)

after the player falls off the screen.

If that's not the problem, you can post the script you made, to see if anyone can help you with it.

~Tim

TheQisSilent

Well waddya know, it worked.  Thanks for all the help.  :)


Follow the updates and download the demo of AFRO JONES- IN COLOR!

SMF spam blocked by CleanTalk