Author Topic: changing states, always a joy  (Read 12490 times)

0 Members and 1 Guest are viewing this topic.

Offline Cloudee1

changing states, always a joy
« on: November 03, 2003, 03:04:46 AM »
Just when you think it is safe to go back into the water!

GARY_P = 0                     is a global variable

I have this which is the only place the variables changes.

(if(Said('[talk<to]/gary'))
   (if(< (send gEgo:distanceTo(garyMan)) 65)
         (if(== GARY_P 1)
        = state 17
        = cycles 1
            )(else
            = GARY_P 1
            = state 0
            = cycles 1
            )
   )(else Print("Don't yell at Gary,"))
)

when I talk to gary it goes to state 0 just fine but if I talk to him again it does not change state at all it does nothing, I need to get to sate 17 and beyond. here are my states.
...
(switch (state)
      (case 0 (if(not(TALK_TO))return))
      (case 1
        ProgramControl()
...
        return)
      (case 17(if(== GARY_P 0))return)
      (case 18
        ProgramControl()
...

Can someone please please please :-\ help? :-\
« Last Edit: November 06, 2003, 12:01:29 AM by cloudee1 »


Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline Brian Provinciano

Re:changing states, always a joy
« Reply #1 on: November 03, 2003, 03:37:10 AM »
Use the (instanceName:changeState(17)) and (instanceName:changeState(0)) instead of simple "= state XX".

States were a fantastic design decision by Sierra! I love them as well. They are used all the way through SCI3!

Good Luck!

Offline Cloudee1

Re:changing states, always a joy
« Reply #2 on: November 03, 2003, 04:28:27 AM »
I don't know how to set up multiple changestate instances,
     that is what this refers to, right?
 
          (instanceName:changeState(x))

I don't know where or how to use this statement.


...
 "post edited by cloudee1, see later attatchment if you would like to see script this question has led too "
« Last Edit: November 05, 2003, 11:59:47 PM by cloudee1 »
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline Cloudee1

Re:changing states, always a joy
« Reply #3 on: November 03, 2003, 05:03:40 PM »
AAAAAAUUUUUUUUUUGGGGGGGGGGGHHHHHHHHHH!!!!!
« Last Edit: November 03, 2003, 05:09:17 PM by cloudee1 »
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline Cloudee1

Re:changing states, always a joy
« Reply #4 on: November 04, 2003, 05:53:10 AM »
Ok I have done some major rearrangeing and the problem is that it is not accessing the JelLy instance which is now the first return and thereby not running the states therein, It now returns the second time correctly so it has to be in my setup of it or the way I am trying to access it. I have changed it so that all of the view's init's happen inside the changestate and at the end of their use I added a dispose(), I thought that might help.


I have this: The instance I can't seem to get to!

(instance JelLy of Script (properties)
 (method(changeState newState) = state newState
  (switch(state)
      (case 0 (if(not(TALK_TO))return))


and this: How I'm trying to get there!

(if(Said('[talk<to]/gary'))
  (if(< (send gEgo:distanceTo(garyMan)) 65)
  = TALK_TO TRUE
     (if(== GARY_P 0)
     = GARY_P 1
     (JelLy:changeState(0))
      = cycles 1
     )(else(if(== GARY_P 1)
     (RoomScript:changeState(20))
     = cycles 1
      ))
   )(else Print("Don't want to yell at Gary,")Print("Get Closer!"))
)

This process is the heart of my dialog and is very important to my game! What am I doing wrong?
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline Cloudee1

Re:changing states, always a joy
« Reply #5 on: November 04, 2003, 08:12:25 PM »
Guys seriously here I need help :(

I have attatched my  rm001.sc a couple of posts down.

Help me Help me Help me Pleeeassssseee!!! :-\
« Last Edit: November 05, 2003, 03:46:50 AM by cloudee1 »
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline Brian Provinciano

Re:changing states, always a joy
« Reply #6 on: November 04, 2003, 08:23:46 PM »
What you are doing is this:
    (case 0
         (if(not(TALK_TO))
           return
         )
    )
    (case 1
        ...

Well, if TALK_TO is false, it will return, yes. But, what if it's true? Then essentially the same thing will happen. You forgot to set your cycles or seconds property in case 0.

This would work:
    (case 0
         (if(TALK_TO)
           = cycles 1
         )
    )

Offline Cloudee1

Re:changing states, always a joy
« Reply #7 on: November 04, 2003, 10:35:06 PM »
alright brian
I tried adding a cycle here and there to no avail, so instead I have deleted case 0 from JelLy Instance so that now it starts without checking the TALK_TO value and the first case displays, but it does not move to case 2, case 3, etc.

Unfortunately I still need direction
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline Brian Provinciano

Re:changing states, always a joy
« Reply #8 on: November 05, 2003, 12:24:10 AM »
well, for one, you're doing:

(JelLy:changeState(20))

there is not state case#20 in the JelLy instance, so nothing will happen.

Offline Cloudee1

Re:changing states, always a joy
« Reply #9 on: November 05, 2003, 01:36:25 AM »
My Bad, see, I try what you say, then I try about a million other things and there have been times when I had changed that to go to the same place as the other return and I must have forgot to change that variable back to 1, but I assure you that that is not the problem, jus an oversight before attatching, but I've reattatched my best version of it to this post,

Thank You for your patience Brian.

My problem is that it does not advance through the jelly instance, It appears to do the first step but does not continue through the cases.
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline Cloudee1

Re:changing states, always a joy
« Reply #10 on: November 05, 2003, 11:56:41 PM »
someone?  anyone? hellloooo,

  :-\  :(  ???  :'(
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline robingravel

Re:changing states, always a joy
« Reply #11 on: November 06, 2003, 09:56:44 AM »
Come on Brian! I have the same problem than cloudee1.

Robin Gravel

Offline Brian Provinciano

Re:changing states, always a joy
« Reply #12 on: November 07, 2003, 03:37:04 AM »
I've been very busy with SCI Studio lately. If you want me to figure out your problem, send me the whole game. I need all the views/pics and any scripts linked to the room you're having problems with (ie. script.000) in order to compile it quickly and find your problem.

Offline robingravel

Re:changing states, always a joy
« Reply #13 on: November 07, 2003, 12:58:33 PM »
Hi cloudee1

Finally. I made it to work and solved my problem too.
Here the code:


Robin Gravel
« Last Edit: November 07, 2003, 01:07:05 PM by Robin_Gravel »

Offline Cloudee1

Re:changing states, always a joy
« Reply #14 on: November 07, 2003, 03:16:39 PM »
If you look at the two previously attatched scripts you will see one major difference, The first has a JelLy Instance, the other does not, I want to know how to make the seperate instance run. the second script does not involve the JelLy instance.

Robin I sent you my game so you could fix your problem by seeing what I did, posting my script here does not answer my original question, it only tells everybody that the problem is solved, when it's not.

Question:  
Why won't jelly instance run in first attatched script?  
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition


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

Page created in 0.044 seconds with 21 queries.