Author Topic: States  (Read 273 times)

0 Members and 1 Guest are viewing this topic.

Offline AndyPanda

States
« on: June 22, 2004, 07:40:27 PM »
I read through the help file and the tutorial, and I still don't fully understand how to use states. Sorry if I'm asking too much on the board, but I really tried hard on this. Here's the script that I'm struggling with. I can't get it past case 1. I have the cycle property set on case 1, so I don't understand why it won't go any further:

/*
TV-SEQUENCE
*/
(instance TVSEQ of Script
 (properties)
 (method (changeState newState) = state newState
 (switch(state)
 
(case 0
Print("Let's see if I'm lucky tonight." #title "You say:")
(send gEgo:
    setMotion(MoveTo 250 98 TVSEQ))
= cycles 10
)
(case 1
SetUpEgo(1 20)
(TV:
        init()
        setCycle(Fwd)
        cycleSpeed(5))
= cycles 20
)
(case 2
Print("...and tonight one lucky person will win the first price in the <clever name here>-lottery.)")
Print("If you have number 291839 on the back of your lottery ticket, please call 1-800-3518 now!")
Print("Your reach inside your pocket, and pick up the lottery ticket.")
= cycles 15
)
(case 3
Print("I WON!!!"#font LARGE_FONT #title "You say:")

    )
   )
  )
 )

By the way, I use this to get there:

(if(Said('watch/tv'))
(if(send gEgo:has(INV_TICKET))
(TVSEQ:cue(state))
)(else
Print("There's nothing but soap operas on right now, so you decide not to.")
)

Andreas
« Last Edit: June 22, 2004, 07:44:12 PM by AndyPanda »



Offline Cloudee1

Re:States
« Reply #1 on: June 22, 2004, 11:01:51 PM »
Hey Andy,

It seems that the main roomcript changestate will work in that way, But other instances do not.

you can also look here:
 http://www.mega-tokyo.com/forum/index.php?board=5;action=display;threadid=5675
or here, this one takes a while to get going, but may help:
http://www.mega-tokyo.com/forum/index.php?board=5;action=display;threadid=4832

If you figure it out, let us know.  ;)
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline AndyPanda

Re:States
« Reply #2 on: June 23, 2004, 12:52:35 AM »
I finally came up with something that worked (thanks, cloudee). I used the changestate in the roomscript, and used some variables. Much harder, but it works  ;D  But something tells me I'll have to find a better way to do it later on, since this example is a fairly simple one.  


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.054 seconds with 22 queries.