Interaction menu problems

Started by Nostrum, Wed 20/08/2003 04:14:43

Previous topic - Next topic

Nostrum

If I have a series of events under a certain option in the interaction menu for an object, the actions don't happen in the order I put them in. For example, if under "Interact object" the action order is like this...

-Run script
-Character - Move Character, (WAR, 51, 172, true)

It'll move the character first and THEN run the script. Any help appreciated.

Ginny

Hmm, well maybe it's default is to Run Scripts first.

How to solve it: Use a command for moving the character at the end of the script. Unless that won't work in this case, like if you have a dialog and you want it to start before the char moves.

Hmmm
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

Nostrum

No, that won't work for this situation... thanks anyway.

Anyone got more help? This problem's really getting in the way of me making progress in my game.  :-\

Scummbuddy

What kind of script do you have before the move character function?  Is it blocking or not?  Try putting a "Wait(120);" in between the codes.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Gilbert

I'm not sure but it is possible that script runs at the end of interaction menu.

However, as you had one of the interaction ste to run script already, why don't you put EVERYTHING in that interaction into the text script part? (ie just do the movecharacter in text script in your case)

In my opinion, mixing "run script" and some other interactions in a single interaction may not be a good habit.

inFERNo

Well, I had the same problem in the beginnen and found out that every interaction in the list is executed first, the run script always when all others are done. I don't know why this is but the solution is simple. Just delete the interactions and put them into the Run Script. To move a character for example you need to write
MoveCharacterBlocking (CHARID, int x, int y, int);
The blocking is that the character moves to the given position and waits with any further commands until he's there. the last int is set either to 0 or 1 where 1 makes him move there directly, ignoring the walkable areas, so usually you will want to set it to 0.
After that you put all further commands.
Hope this helps.

Nostrum

That seems to work well, except there's an error in the script... I got an error message for MoveCharacter(WAR, 58, 172, 1); because it's got the "wrong number of parameters". My guess is that it's talking about that "1" on the end, but I thought you said that putting a 1 there would make him move to his destination directly, ignoring walkable areas. Hmm...

Ishmael

MoveCharacterBlocking(WAR, 58, 172, 1);

The MoveCharacter don't have the DIRECT param... You need to use MoveCharacterDirect(...); if you want it to be non-blocking... ;)
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.

Scummbuddy

you forgot the word blocking. check it out in the manual

MoveCharacterBlocking
MoveCharacterBlocking (CHARID, int x, int y, int direct)

Moves the character CHARID to location (X,Y), waiting until they arrive there before returning to the script.
If DIRECT is 0, this acts like MoveCharacter; if it is 1 then this acts like MoveCharacterDirect.

Example:

MoveCharacterBlocking(EGO,234,122,1);

will make the character EGO walk to 234,122 ignoring walkable areas and return the control to the player when he gets there.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

inFERNo

Here's something very handy:
If you aren't sure about a command and if there might be variations of it, just highlight it and press F1. You will automagically be directed to the specific command in the help file that will tell you what it does.

Nostrum

#10
Yeeeaarrrgghhhee. This is massively infuriating. I fixed the script so that there are no errors in it now. I have it so that when you interact with the door, it runs this script:

MoveCharacterDirect (WAR, 66, 175);
SetCharacterView (WAR, 8);
AnimateCharacter (WAR, 0, 5, 0);
ReleaseCharacterView (WAR);
FaceLocation(GetPlayerCharacter(),character[GetPlayerCharacter()].x,0);

Yet, much to my despair, when I interact with the door in-game, nothing happens. At all.

Scummbuddy

Are you using braces for your interactions that use more than one command?  If not, then it will ignore ones after the first command.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Nostrum

I'm not exactly sure what you mean by that. Could you explain more thoroughly?

Scummbuddy

- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

SMF spam blocked by CleanTalk