character gets Jammed on 'Stand on Global Int'

Started by Mr Jake, Thu 05/06/2003 16:10:46

Previous topic - Next topic

Mr Jake

Im using this script for the interaction stand on hotspot:
It involves needing to speak to someone before you can leave the room, the global Int works its jsut when the display speech is up it gets Jammed cause he is still on the hotspot. Ive tred putting move char after and no luck, with wait in he just stands still then talks.....


if (GetGlobalInt (1)==1) {
NewRoomEx (4, 227, 117); }
else {
MoveCharacter (EGO, 249, 125);
Wait (1);
DisplaySpeech (EGO, "I should speak to Mika first");
}  

Very grateful for any help :)

Scorpiorus

Character stands on hotspot event occurs repeatedly which holds him there.

You should go with blocking move instead:

if (GetGlobalInt (1)==1) {
NewRoomEx (4, 227, 117); }
else {
MoveCharacterBlocking(EGO, 249, 125, 1);
DisplaySpeech (EGO, "I should speak to Mika first");
}

you take the right approach and probably wanted it so:

if (GetGlobalInt (1)==1) {
NewRoomEx (4, 227, 117); }
else {
MoveCharacter (EGO, 249, 125);
while (character[EGO].walking) Wait (1);
DisplaySpeech (EGO, "I should speak to Mika first");
}

these scripts are equal.


btw there is new era of regions is coming ;)
but you probably use AGS 2.54 which hasn't that feature yet.


-Cheers

Mr Jake

#2
kk, thxs
BTW: Its works perfect! thxs

Mr Jake

#3
Grrr....
same sort of problem...
I want Mika to walk out of the room, if I use

MoveCharacter (MIKA, 247, 99);
while (character[EGO].walking) Wait (30);
character[MIKA].room = 7;

she still disappears. If I use wait (30); she just turns half way a disappears!

Suggestion:
Printable/orderable/obtainable 'Scripting for Dummies' Book

EDIT: Mayb if I change the char script name :(...
yep its works  :-[

Scorpiorus

This is why CJ added MoveCharacterBlocking(). Working the same way as the while (character[].walking) Wait (1); thing it frees you from writing of two lines of code. ;)

MoveCharacterBlocking (MIKA, 247, 99, 1);
character[MIKA].room = 7;

-Cheers

Mr Jake

lol, if I do it the long way I cant make people inpressed (someday I hope  8)) jking

SMF spam blocked by CleanTalk