Strange order

Started by nOOwy, Tue 30/09/2003 11:27:14

Previous topic - Next topic

nOOwy

Hi

I need some help.
This is my script:

// script for hotspot3: Interact hotspot
DisplayMessage(20);
MoveCharacter(EGO,100,95);
MoveCharacterDirect(EGO,100,80);  
DisplaySpeech(EGO,"Come on,hurry up!");

Can anyone tell me why my character say "Come on,hurry up!" before moving !!??
It should fisrt move and then say his speech. I don't understand.

nOOwy

P.S. Sorry for my yesterday post with this stupid questions. And thanks a lot for replies.

Ishmael

You must use MoveCharacterBlocking for moving the character. It is like MoveCharacter, but blocks the game form running the following commands before it is finished. The last parameter of MoveCharacterBlocking set's if it works as MoveCharacter or MoveCharacterDirect. Study the manual... Now where did I put my pillow.......
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.

nOOwy

Thanks!
But now I faced another problem:

After displayingspeech I want to move my character and NPC to another room at specific coordinates.
I've used NEWROOMEX(x,x,x) to move my character but how can I move NPC to another location at specific coordinates?
I can't find any command that would do it :-(

Ginny

#3
Hmm, you could try editing the characters character[CHARID].x and character[CHARID].y global variables (only when the character isn't moving.) I think you can only set them in the room the NPC will be in. You could try this:

1. Create a global variable and set it as 0.
2. When you want to move the NPC to the other room, Use character[NPCID].room and then set the global variable to 1. Then in the room where the NPC appears, on "Player enters screen (before fade-in)" put an if statement to check if the global variable is 1, and if it is, set the NPC's coordinates appropriately.

I hope this helps :).

Of course, maybe I'm wrong and there's an easier way to do this ;)
Try Not to Breathe - coming sooner or later!

We may have years, we may have hours, but sooner or later, we push up flowers. - Membrillo, Grim Fandango coroner

SSH

The x and y and room are independent, so you can change the x and y before changing room of an NPC, or the other way around. The NPC will be visible only if they are in the current room. You can also have the NPC in no room by setting their room to -1.

For example,  look at my game "The Dark Cave". When you use the mobile phone, a split screen is used to show the other end of the conversation. This is donme by changing the room background and moving one character to -1 and two characters from -1 to the current room. The whole process is reversed when the phone conversation completes.

12

Ginny

#5
There, I knew someone knew of a simpler solution ;) Thanks SSH.
Try Not to Breathe - coming sooner or later!

We may have years, we may have hours, but sooner or later, we push up flowers. - Membrillo, Grim Fandango coroner

nOOwy


nOOwy

ey wait a moment, that's not as easy as I thought.

My character(0) and his frend NPC(1) are talking in room1 and are visible.
After end of conversation I want ot move them in romm2 at specific coordinates.

Can you please write what commands I should use in my script.

Should I hide NPC and how I can hide him?
What to do to change coordinates of NPC? Move him? Or some more complex command?

nOOwy


Ishmael

You'll need dialog_request, unless you use room rep_ex and a Globalint. This is the dlreq way as I see it:

in Global Scrpt:

fuction dialog_request (int val) {
 if (val == 1) {
   character[NPC].room = r#;
   character[NPC].x = x#;
   character[NPC].y = y#;
   NewRoomEx(r#,x#,y#);
 }
}

where you replace r# with the correct room number, which in this case is 2, and the x# and y# with the appropriate cordinates.

To call this in the end of the conversation, just use

run-script 1

in the dialog script.
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.


SMF spam blocked by CleanTalk