Need help with variables

Started by guybrush, Sun 21/08/2005 09:10:19

Previous topic - Next topic

guybrush

Hi!
Here's my situation:
If player uses the phone in room 17, a cab should appear in room 19 after player enters it. The problem is, I used SetGraphicalVariable function, used "Cab called" string variable name, but when I'm testing the game, after i use the phone, game stops and i get message: "Error: SetGraphicalVariable: Interaction variable "Cab called" not found."

And second, how do I make that taxi comes from the edge of the screen?
SPY FUNCTION-- My first game
C O M I N G   S O O N !

GarageGothic

Make sure that the variable you set is a Global one, not a local. You won't be able to check for it in room 19 if it's specific for room 17.

For the taxi coming from outside the screen, just use negative x starting coordinate (if from the left) or coordinate larger than 320 (if from the right). Then when you move the taxi object/character to an x-coordinate inside the screen area, it will come driving from outside the screen.

Sektor 13

I think the problem is that you only wrote in script "Cab called". You Must create this variable. Open an room interaction editor (icon with big red "i"). Then select one of the options, like First Time player Enters Screen - than Add NEW ACTION and select -> choose one Character - Face Location - clik a button CHANGE and than EDIT VARIABLES - > click NEW VARIABLE and write "Cab called".. Now this variable exist and it should work..

guybrush

OK, thnx, it works!
Now, I have another problem. Player is in the car, and the car should shake randomly, but not always.
In room interactions, I used repeatedly execute--Run Script, and then Shake Screen Background, after that Wait, then Shake in some other way, but "wait" is a blocking command(same with WaitKey), so how do I make not-shaking for few seconds, then shake again(without any blocking)?
SPY FUNCTION-- My first game
C O M I N G   S O O N !

GarageGothic

Use a timer (see SetTimer and IsTimerExpired commands in manual)

SMF spam blocked by CleanTalk