Problem with script. [Solved]

Started by Qwerty, Sat 19/06/2004 09:07:11

Previous topic - Next topic

Qwerty

I cannot upload picture, so I type my hotspot interaction here:

Conditional - If inventory item was used
Run script (And script is: DisplaySpeech(GetPlayerCharacter(), "Speech...");
Object - Remove object from room (0)
Object - Remove object from room (1)
Object - Switch object back on (2)
Game - Pause processor for a set time (40)
Player - Go to a different room (at specified co-ordinates) (3, 100, 100)

Everything works ok, execept script. Player character doesn't say anything.

What is wrong?

Estaog

Quote from: Qwerty on Sat 19/06/2004 09:07:11
Run script (And script is: DisplaySpeech(GetPlayerCharacter(), "Speech...");

There is your problem. You have to use DisplaySpeech (Character number,Message)
See the manual for questions like these.
Think about the kittens man!

http://members.aol.com/johnk0/godkills.jpg

strazer

Tanker, character names return the character number as does GetPlayerCharacter. I don't see what you think is wrong with the script.

Qwerty, could you indent your list so we can see the hierarchy?
And are you sure you're using the inventory item you specified in the conditional?

Estaog

Yea i know that i just tough that might fix it. But then again the problem could be somewhere else.
Think about the kittens man!

http://members.aol.com/johnk0/godkills.jpg

Qwerty

Quote from: strazer on Sat 19/06/2004 14:47:55
Qwerty, could you indent your list so we can see the hierarchy?
And are you sure you're using the inventory item you specified in the conditional?

Ident my list? What do you mean?

Yes, I'm sure, beacuse everything else works ok.
Maybe It's a bug...?

Ashen

QuoteIdent my list? What do you mean?

He means like:

Conditional - If inventory item was used
  Run script (And script is: DisplaySpeech(GetPlayerCharacter(), "Speech...");
  Object - Remove object from room (0)
  Object - Remove object from room (1)
Object - Switch object back on (2)
Game - Pause processor for a set time (40)
Player - Go to a different room (at specified co-ordinates) (3, 100, 100)

So we can see what is conditional on the inventory item.
I know what you're thinking ... Don't think that.

Qwerty

Ok, ok.

Conditional - If inventory item was used (2)
Ã,  Run script (And script is: DisplaySpeech(GetPlayerCharacter(), "Speech...");
Ã,  Object - Remove object from room (0)
Ã,  Object - Remove object from room (1)
Ã,  Object - Switch object back on (2)
Ã,  Game - Pause processor for a set time (40)
Ã,  Player - Go to a different room (at specified co-ordinates) (3, 100, 100)

And I just tested, when I take off Player - Go to a different room, it works.
But I want player changing room...

Ashen

What if you use the 'Game - Display a Message' interaction, instead of run script? Or use script for the whole thing?
I know what you're thinking ... Don't think that.

Qwerty

#8
I don't like display message interaction, it only messes up the game :P

I can try to use script for the whole thing, thanks for suggestion.

EDIT: 8) Thanks for suggestion again 8)

Now it works. Only run script:

DisplaySpeech(GetPlayerCharacter(), "Speech"); 
ObjectOff(0);
ObjectOff(1);
ObjectOn(2);
Wait(40);
NewRoomEx(3, 188, 110);

Strange, why it didn't work without script.... :o

Scorpiorus

It didn't work because under certain conditions the RunScript option is executed *last* regardless of actual order of interaction options. Thereby you got a Player - Go to a different room before RunScript and thus (since a player moves to another room) the RunScript option didn't have a chance to run.

That fact is rather unintuitive, I know, and the best option would be to use a single RunScript action and put all the commands there, as Ashen suggested.

SMF spam blocked by CleanTalk