Moving char. off then on same screen at diff. points

Started by holodude, Mon 26/05/2003 06:54:05

Previous topic - Next topic

holodude

Okay, here's the deal.  I'm trying to make it so that if a character (user character) walks off a certain part of the screen, then he'd move onto the screen at a closer, different point, but the same screen edge.  I've made it so that I'm using hotspots to signify the different points, but my character doesn't want to move off the screen.  

I've tried using negatives as my points when using movecharacterdirect command, but still it doesn't work.  I also want it so that the character can then move back onto the second hotspot where he reentered and then he'd leave and come back onto the screen where he started from.  Any suggestions?  Thanks in advance.

Ishmael

I'm not sure what you are doing here.... But if you want a char to disappera from the screen, you must set its room to something else, room -1 would probably be good...
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

AJA @ School

MoveCharacterDirect (Blah, blah, blah);
MoveCharacterBlocking (CHARID,x,y,DIRECT); // if direct is 1 will act like MoveCharacterDirect

Using direct moving the character will ignore the walkable areas and can move anywhere on the screen and outside of it...

holodude

Quote from: AJA @ School on Mon 26/05/2003 13:17:24
MoveCharacterDirect (Blah, blah, blah);
MoveCharacterBlocking (CHARID,x,y,DIRECT); // if direct is 1 will act like MoveCharacterDirect

Using direct moving the character will ignore the walkable areas and can move anywhere on the screen and outside of it...

Tried that.  Didn't work.  Because it is the player character, it is not able to leave the screen unless it is going to a different room, which it isn't.

TK, what I am trying to do is this:  Divide the screen into half horizontally (left-to-right).  Now call the left edge of the top A and the left edge at the bottom B.  I want to have it so that if the player walks off A he disappears then walks on at B.  And vice versa.

Any other suggestions?

Ishmael

Tried using the character[CHARID].y and character[CHARID].x?
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

holodude

Yeah. Tried that.  It does work, but not perfectly, because I want a transition that is not instant (walk off, wait, walk on).  But I figured it out.  I created a sprite that was noting (whole thing transparent) and I changed the character view to it once it got to the edge of the screen, then I told it to change transition to instant, then move to a different room at specific coordinates (but actually same room) then I told it to revert back to the proper view for the character.  Then it walked from where it was to look like it walked back onto the screen.  then I made it so that when the character left the screen (only 1 exit) it would change the transition back to fade.  Using the character[CHARID].x and .y would have been SOOO much easier, but I found a workaround so all is good.  Thanks for the advice TK.

Ishmael

That seems a very good idea. I have another, dunno if it is any better (I doubt it)...

MoveCharacterBlocking(GetPlayerCharacter(),320,150,0); // the last parameter is needed to be 1 if there is no walkable area to the edge of the screen
character.[GetPlayerCharacter()].room=-1; // hides the player char without any view fiddling
character.[GetPlayerCharacter()].y=50 // set the char's position to the upper half of the screen
Wait(80); // wait for 2 secs
character.[GetPlayerCharacter()].room=1; //replace the 1 with the room's number the char is in
MoveCharacterBlocking(GetPlayerCharacter(),280,50,0); // same thing with the last parameter

In thes script important is that the player cannot use the mouse while the character is hidden, or the game will crash.
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Scorpiorus

QuoteI've tried using negatives as my points when using movecharacterdirect command, but still it doesn't work.
TK introduced a good solution and you can use negative co-ordinate values as well so the character walks off the screen completely (in case you need that to happen of course).

-Cheers

SMF spam blocked by CleanTalk