AndyPanda |
Everytime I think I know how something works, something always comes up to prove me wrong :) Can anyone take a look at this to tell me what I'm doing wrong? I'm just pasting the part of the roomscript where I'm having trouble. The thing is...it worked, until I scripted the last bit, after where it says "Using". It's the brackets I'm having trouble with, it seems: /***************************************** * Handle the possible said phrases here * *****************************************/ /* Looking */ (if(Said('look>') (if(Said('/door')) Print("It's the door to the living room!") )(else (if(Said('/painting, art')) Print("It's your favorite snack! (which reminds you that you have a quest to finish).") )(else (if(Said('/table')) Print("There's nothing of importance on the table.") )(else (if(Said('/chair')) Print("It's a bad excuse for a barstool. You don't want to get up on that thing, ever again.") )(else (if(Said('/walls, wall')) Print("This place could use a little paint.") )(else (if(Said('window')) Print("Rays of sun are coming in through the dirty window.") )(else (if(Said('[ /* , !* ]')) Print("It's your kitchen. Your sink is making a strange noise constantly.") ) ) ) ) ) ) ) ) ) ) ) /* Using */ (if(Said('(turn<on),use / sink') Print("You can't, it's broken.") ) ??? |
Eigen |
Hey! When I opened up vocab.000 and removed imperative verb because it's only a noun, and changed the if Said to (if(Said('(turn<on),use / sink')) , it works. -Eigen |
AndyPanda |
It doesn't work here :-\ I get "segment name expected" on the "(if(Said('(turn<on),use / sink'))"-line. There's gotta be a bracket mistake somewhere here. |
Eigen |
This way it seems to work. ******************************** (instance RoomScript of Script (properties) (method (handleEvent pEvent) (super:handleEvent(pEvent)) (if(Said('look>')) (if(Said('/door')) Print("It's the door to the living room!") ) (if(Said('/painting, art')) Print("It's your favorite snack! (which reminds you that you have a quest to finish).") ) (if(Said('/table')) Print("There's nothing of importance on the table.") ) (if(Said('/chair')) Print("It's a bad excuse for a barstool. You don't want to get up on that thing, ever again.") ) (if(Said('/wall')) Print("This place could use a little paint.") ) (if(Said('/window')) Print("Rays of sun are coming in through the dirty window.") ) (if(Said('/')) Print("It's your kitchen. Your sink is making a strange noise constantly.") ) ) (if(Said('(turn<on),use/sink')) Print("You can't, it's broken.") ) ) ) ************************ -Eigen |
AndyPanda | So it did ;D Thanks a lot, Eigen! |
AndyPanda |
Oh, one more thing. Let's say I have a house with four rooms, and I want to have the same background music over the whole house, without starting the song from the beginning in every room (from each rooms script). Is that possible? It just sounds weird if the music stops and starts from every room you enter. |
Eigen |
Yeah that's totally possible in SCI. Just start the music in your first room, and it will keep on playing in all the rooms. Until you come back to the first room, where you started it. There it will start again. But that can be fixed using a global variable that. So the music will only start playing, when the variable is unset. After starting the music, you set the variable. -Eigen |