Author Topic: changeState woos  (Read 22556 times)

0 Members and 1 Guest are viewing this topic.

Offline robbo007

changeState woos
« on: March 25, 2025, 02:13:47 PM »
Hi Guys,
I've got some issues with calling a changeState from within a changeState.

I have my RoomScript changeState and an actors changeState (IvanaScript).

Code: [Select]
(method (handleEvent pEvent)
(super handleEvent: pEvent)
; handle Said's, etc...
(if (Said 'press/button')
(self changeState: 1)
)
)
(method (changeState newState)
(ShowState self newState 1 2) ; Displays changeState info on screen when debug is enabled.
(= state newState)
(switch state
(0
)
(1 ; Ego goes to soda Machine
(ProgramControl)
(gEgo
illegalBits: 0
ignoreActors:
setMotion: MoveTo 158 177 self
)
)
(2 ; Ego presses soda machine button
(gEgo
cycleSpeed: 1
view: 707
setLoop: 2
setCycle: End self
)
)
(3 ; Done pressing button
(gEgo setCycle: Beg self)
)
(4 ;Soda machine turns on
(gEgo view: 000 setCycle: Walk loop: 3)
(ProgramControl)
(aSoda setCycle: Fwd)
(self changeState: 5)
)
(5
(PlayerControl)
(SetUpEgo) ;this sets ego back to normal
(= cycles 10)
)
(6
(aIvanaScript changeState: 12)
)
(7 ;Ivana walks path back behind counter
(aSoda setCel: 0)
(aIvana setCycle: Walk setMotion: MoveTo 143 17 self)
)
(8 ;Ivana walks path back behind counter
(aIvana setMotion: MoveTo 87 179 self)
)
(9 ;Ivana walks path back behind counter
(aIvana setMotion: MoveTo 111 119 self)
)
(10 ;Ivana walks path back behind counter
(aIvana setCycle: Beg setMotion: MoveTo 78 120 self)
)
(11 ;Ivana walks path back behind counter
(aIvana priority: 8)
(aIvanaScript changeState: 0)
)

)

)
)

Code: [Select]
(method (changeState newState &tmp IvanaLoop)
(ShowState self newState 1 2) ; Displays changeState info on screen when debug is enabled.
(switch (= state newState)
(0
(= seconds (Random 4 8))
)
(1
(aIvana
illegalBits: 0
cycleSpeed: 0
setLoop: -1
setCycle: Walk
setMotion: MoveTo 72 124 self ;Ivanna walks up
)
)
(2
(= seconds (Random 4 8))
)
(3
(aIvana setMotion: MoveTo 53 138 self) ;Ivanna walk down
)
(4
(= seconds (Random 4 8))
)
(5
(aIvana setMotion: MoveTo 53 134 self) ;Ivanna walk down part 2
)
(6
(= seconds (Random 3 9)) ; Ivana does some random poses
(switch (= IvanaLoop (Random 0 5))
(0
(aIvana loop: 6 cycleSpeed:4 setCycle: End self)
)
(1
(aIvana loop: 7 cycleSpeed:4 setCycle: End self)
)
(else
(= state -1)
)
)
)

(7
(self changeState: 0) ;Returns to the start. Only interupted if talked to.
)
(8
(aIvana setMotion: MoveTo 63 128 self) ; Let's try and talk. Ivanna stops and goes to central point.
)
(9
(aIvana setLoop: 5 cycleSpeed:4 setCycle: Beg) ;Talk a little
(= seconds 3)
)
(10
(aIvana setCel: 0 setLoop: 0)
(= cycles 10)
)
(11
(cond
(register
(switch register
(101
(PrintA 33 7) ; "test 2"
)
(102
(PrintA 33 6) ; "test 3"
)
)
)

(else
(switch msgVar
(0
(PrintA 33 8) ; "test 1"
)
(1
(PrintA 33 9) ; "Yes? May I help you?"
)
(2
(PrintA 33 10) ; "Would you like me to call security?"
)
(3
(PrintA 33 11) ; "How may I help you?"
)
)
(if (> (++ msgVar) 3)
(= msgVar 0)
)
)
)
(self changeState: 0) ;Start all over again.
)
(12
(aIvana
illegalBits: 0
cycleSpeed: 0
setLoop: -1
setCycle: Walk
setMotion: MoveTo 78 120 self ;Ivanna walks out behind desk
)
)
(13 ;Ivanna walks path to soda machine
(aIvana setPri: -1 setMotion: MoveTo 111 119 self)
)
(14 ;Ivanna walks path to soda machine
(aIvana setMotion: MoveTo 87 179 self)
)
(15 ;Ivanna walks path to soda machine
(aIvana setMotion: MoveTo 143 179 self)
)
(16 ;Face soda machine and scratches head and waits.
(aIvana setCel: 1 setLoop: 6)
(= cycles 20)
)
(17
(RoomScript changeState: 7)
)
)
)
)

The first issue is when Ivana reaches the SodaMachine . Ego presses the button and she comes out from behind the desk and walks to the sodamachine, but she gets stuck on changeState 7 of the RoomScript changeState. (See screenshot 1)

The second problem is randomly, Ivana does not walk her programmed MoveTo path in the IvanaScript changeState. She will randomly walk behind the SodaMachine doing a completely differnt moveto path that I've not specified.  (see screenshot 2)

Questions: If you are calling different changeStates and jumping between different scripts is there anything special syntax that is needed to avoid any problems? I'm just using the scriptname changeState: x syntax to do this.

Also how do I make sure the Cycler is on Walk when the actor needs to start moving when I use the MoveTo command? Sometimes the actor just seems to moonwalk the MoveTo coordinates. I know with ego you can use the (SetupEgo) syntax. Can this be done with actors? the (SetUpActor) jsut causes a crash.

Thanks,


« Last Edit: March 25, 2025, 02:21:52 PM by robbo007 »



Offline lskovlun

Re: changeState woos
« Reply #1 on: March 25, 2025, 06:11:51 PM »
Well, calling
Code: [Select]
ivanaScript changeState: 12 won't cue the RoomScript when Ivana is done with her routine. So you need to put a
Code: [Select]
RoomScript cue: in Ivana's script somewhere when she's done. As for the other question, it looks to me (but I don't quite understand the scene) like you're trying to make one or both scripts do several things that could interact in bad ways. You'll have to describe the scene a little closer.

EDIT: Or maybe - I still don't understand the scene - the RoomScript state 7 is at fault. It appears it might set Ivana on new path while her own script is running and waiting for a cue. And since you're now setting a new cuee, her own script will get stuck?

Several things could be wrong here.
« Last Edit: March 25, 2025, 06:20:59 PM by lskovlun »

Offline robbo007

Re: changeState woos
« Reply #2 on: March 26, 2025, 11:53:04 AM »
Thanks for the reply. I think I was messing things up pointing to and from RoomScript and IvanaScript. I've made it a little simpler by moving all of Ivana's actions into her script. But I still have the moonwalk animation when she is returning to the counter after being at the soda machine, which is changeState 16 onwards of the IvanaScript. There is also the issue that sometimes she still walks off her path as indicated in the sreenshot2.

What is happening in the scene is the following:
Ivana is running her IvanaScript changeState 0 through to 7 (which is walking back a forward behind the counter. She will only stop if talked to by ego and this goes to changeState 8 to 11 then goes back to walking behind the counter changestate 0.

When ego presses the button on the soda machine with the said:
Code: [Select]
(if (Said 'press/button')
(self changeState: 1)
)
)
this triggers (RoomScript changeState 0 through to 5 then queue's Ivanascript on changeState 6). This then makes Ivana walk out from behind the counter using changeState 12 to 21 changeStates of the Ivanascript.

New RoomScript changeStates:
Code: [Select]
(method (changeState newState)
(ShowState self newState 1 2) ; Displays changeState info on screen when debug is enabled.
(= state newState)
(switch state
(0
)
(1 ; Ego goes to soda Machine
(ProgramControl)
(gEgo
illegalBits: 0
ignoreActors:
setMotion: MoveTo 158 177 self
)
)
(2 ; Ego presses soda machine button
(gEgo
cycleSpeed: 1
view: 707
setLoop: 2
setCycle: End self
)
)
(3 ; Done pressing button
(gEgo setCycle: Beg self)
)
(4 ;Soda machine turns on
(gEgo view: 000 setCycle: Walk loop: 3)
(ProgramControl)
(aSoda setCycle: Fwd)
(self changeState: 5)
)
(5
(PlayerControl)
(SetUpEgo) ;this sets ego back to normal
(= cycles 10)
)
(6
(aIvanaScript cue: changeState: 12) ; Ssets up Ivana script to move out behind counter and move to the sosa machine.
)

)

)
)

New IvanaScript changestate:
Code: [Select]
(method (changeState newState &tmp IvanaLoop)
(ShowState self newState 1 2) ; Displays changeState info on screen when debug is enabled.
(switch (= state newState)
(0
(= seconds (Random 4 8))
)
(1
(aIvana
illegalBits: 0
setPri: 8
cycleSpeed: 0
setLoop: -1
setCycle: Walk
setMotion: MoveTo 72 124 self ;Ivanna walks up
)
)
(2
(= seconds (Random 4 8))
)
(3
(aIvana setMotion: MoveTo 53 138 self) ;Ivanna walk down
)
(4
(= seconds (Random 4 8))
)
(5
(aIvana setMotion: MoveTo 53 134 self) ;Ivanna walk down part 2
)
(6
(= seconds (Random 3 9)) ; Ivana does some random poses
(switch (= IvanaLoop (Random 0 5))
(0
(aIvana loop: 6 cycleSpeed:4 setCycle: End self)
)
(1
(aIvana loop: 7 cycleSpeed:4 setCycle: End self)
)
(else
(= state -1)
)
)
)

(7
(self changeState: 0) ;Returns to the start. Only interupted if talked to.
)
(8
(aIvana setMotion: MoveTo 63 128 self) ; Let's try and talk. Ivanna stops and goes to central point.
)
(9
(aIvana setLoop: 5 cycleSpeed:4 setCycle: Beg) ;Talk a little
(= seconds 3)
)
(10
(aIvana setCel: 0 setLoop: 0)
(= cycles 10)
)
(11
(cond
(register
(switch register
(101
(PrintA 33 7) ; "test 2"
)
(102
(PrintA 33 6) ; "test 3"
)
)
)

(else
(switch msgVar
(0
(PrintA 33 8) ; "test 1"
)
(1
(PrintA 33 9) ; "Yes? May I help you?"
)
(2
(PrintA 33 10) ; "Would you like me to call security?"
)
(3
(PrintA 33 11) ; "How may I help you?"
)
)
(if (> (++ msgVar) 3)
(= msgVar 0)
)
)
)
(self changeState: 0) ;Start all over again.
)
(12
(aIvana
illegalBits: 0
cycleSpeed: 0
setLoop: -1
setCycle: Walk
setMotion: MoveTo 78 120 self ;Ivana walks out behind desk
)
)
(13 ;Ivana walks path to soda machine
(aIvana setPri: -1 setMotion: MoveTo 111 119 self)
)
(14 ;Ivana walks path to soda machine
(aIvana setMotion: MoveTo 87 179 self)
)
(15 ;Ivana walks path to soda machine
(aIvana setMotion: MoveTo 143 179 self)
)
(16 ;Ivana faces soda machine and scratches head and waits.
(aIvana loop: 6 cycleSpeed: 2 setCycle: End self)
;(= cycles 20)
)
(17
(aSoda setCel: 0) ;Soda machine stops.
(aIvana setCycle: Walk setLoop: -1)
(aIvana setMotion: MoveTo 143 173 self) ;Ivana starts walk back to counter.
(self changeState: 18)
)
(18 ;Ivana walks path back behind counter
(aIvana setMotion: MoveTo 87 179 self)
)
(19 ;Ivana walks path back behind counter
(aIvana setMotion: MoveTo 111 119 self)
)
(20 ;Ivana walks path back behind counter
(aIvana setCycle: Beg setMotion: MoveTo 78 120 self)
)
(21 ;Ivana walks path back behind counter
(aIvanaScript changeState: 1)
)

)
)
)

I've had to add in the Ivanascript changestates number 17 (self changeState: 18) otherwise it would not move onto changeState 18. It was getting stuck there for some reason? I forced the Cycler there to setCycle Walk also. Not sure if this is right?

There are things I still dont fully understand with the changeStates. When to setCycler, when to use Beg, When to use self. Does the order of the syntax's affect the outcome? eg: putting SetCycler: before setMotion etc.

Offline lskovlun

Re: changeState woos
« Reply #3 on: March 28, 2025, 12:25:56 AM »
I still don't understand fully, but this:
Code: [Select]
(aIvanaScript cue: changeState: 12) looks wrong. Cueing means to advance the state of the script by one. You do that, causing a state transition from whatever it was to the next. After that, you explicitly transition to state twelve. Both state transitions are executed.

Oh and this:
Code: [Select]
(else
(= state -1)
)
So you are setting her state to -1 and hope that she gets cued from somewhere else. If she does, she'll end up in state 0 again, but does she?

To expand a bit, what I don't understand is that you have this soda machine out in the customers area. Ego presses the button to activate it, and then the lady comes out. But why is this? Either a machine is meant for the customers to use, or it is not? What is going on here?

Also, the number of states could be reduced by using the (D)Path mover class.
« Last Edit: March 28, 2025, 01:29:48 AM by lskovlun »

Offline robbo007

Re: changeState woos
« Reply #4 on: March 31, 2025, 06:53:59 AM »
I still don't understand fully, but this:

To expand a bit, what I don't understand is that you have this soda machine out in the customers area. Ego presses the button to activate it, and then the lady comes out. But why is this? Either a machine is meant for the customers to use, or it is not? What is going on here?

Also, the number of states could be reduced by using the (D)Path mover class.

Hi. So let me explain the scene a little better. The soda machine is broken and out of order. Ivana is behind the counter and when ego presses the button to activate the soda machine Invana comes out from behind the counter to turn the machine off , this bothers Ivana. Ego then has to quickly steal her keycard which is on the counter before Ivana gets back and sees him. Does that make sense?

I did not know about D(Path). Could you provide an example so I can try that. Maybe this will help me with the issue.

Regards,


Offline robbo007

Re: changeState woos
« Reply #5 on: April 01, 2025, 06:02:48 AM »
After looking closer at the order of the changeState displayed in real-time (see videos) I've noticed that when the RoomScript changeState calls the IvanaScript with (aIvanaScript changeState: 12)  the IvanaScript still runs for a brief second.
Code: [Select]
(7
(self changeState: 0) ;Returns to the start. Only interrupted if talked to.
)

Before handing over to the IvanaScript at state 12. I think this could be the reason why the actor is not following the MoveTo path correctly and other random things don't work correctly. Which script has priority? Could this be the issue?

Code: [Select]
(script# 33)
(include sci.sh)
(include game.sh)
(use AutoDoor)
(use Controls)
(use Cycle)
(use Door)
(use Feature)
(use Game)
(use Gauge)
(use Inv)
(use Main)
(use MenuBar)
(use Obj)
(use Rev)
(use DPath)
(use rm797) ;showState debugging changestates script
(public
rm033 0
)

(local
seenMsg
msgVar
)

(procedure (PrintA) ; Ivana's(actors) response. Tbis adds a nice title to the dialogue.
(Print &rest #at -1 20 #title {Ivana Chercemov:} #width 222 #mode 1)
)

(define vRoom 033
)
(define lLotto 0)
(define lDoor 1)
(define lSoda 2)


(instance rm033 of Rm
(properties
picture 033
north 0
east 029
south 0
west 34
)

(method (init)
(super init:)
(gAddToPics ;This adds views to the background in a much more elegant way :)
;add: aLotto
add: aCard
doit:
)
(self setScript: RoomScript)
(switch gPreviousRoomNumber
)
(cond
((== gPreviousRoomNumber 032) (gEgo posn: 292 171 loop: 1)
)
(else
(gEgo posn: 292 171 loop: 0)
)
)
(SetUpEgo)
(gEgo init:)
(aDoor init:)
(aLotto init: stopUpd:)
(aSoda init:)
(aIvana init:)


)
)

(instance RoomScript of Script
(properties)

(method (doit)
(super doit:)
; code executed each game cycle
)

(method (handleEvent pEvent)
(super handleEvent: pEvent)
; handle Said's, etc...
(if (Said 'press/button')
(self changeState: 1)
)
)
(method (changeState newState)
(ShowState self newState 1 2) ; Displays changeState info on screen when debug is enabled.
(= state newState)
(switch state
(0
)
(1 ; Ego goes to soda Machine
(ProgramControl)
(gEgo
illegalBits: 0
ignoreActors:
setMotion: MoveTo 163 177 self
)
)
(2 ; Ego presses soda machine button
(gEgo
cycleSpeed: 1
view: 707
setLoop: 2
setCycle: End self
)
)
(3 ; Done pressing button
(gEgo setCycle: Beg self)
)
(4 ;Soda machine turns on
(gEgo view: 000 setCycle: Walk loop: 3)
(ProgramControl)
(aSoda setCycle: Fwd)
(self changeState: 5)
)
(5
(PlayerControl)
(SetUpEgo) ;this sets ego back to normal
(= cycles 20)
(PrintA {Hey, don't touch that!})
)
(6
(= cycles 10)
(aIvanaScript changeState: 12) ; Ssets up Ivana script to move out behind counter and move to the sosa machine.
)

)

)
)
(instance aDoor of AutoDoor
(properties
view vRoom
loop lDoor
cel 0
x 300
y 172
cycleSpeed 1
entranceTo 032
doorCtrl ctlBLUE
roomCtrl ctlGREEN

)

(method (init)
(super init:)
(self
;setCycle: End
setPri: 10
)
)
)

(instance aLotto of Prop
(properties
view vRoom
loop lLotto
x 31
y 133
cycleSpeed 3
)

(method (init)
(super init:)
(self
setCycle: Fwd
setPri: 9
startUpd:

)
)
)
(instance aSoda of Prop
(properties
view vRoom
loop lSoda
x 144
y 176
cycleSpeed 3
)

(method (init)
(super init:)
(self
;setCycle: Fwd
setPri: 13
startUpd:

)
)
)

;;;(instance aLotto of View
;;; (properties
;;; view vRoom
;;; loop lLotto
;;; x 31
;;; y 131
;;; priority 9
;;; signal ignAct
;;; )
;;;)
(instance aCard of View
(properties
view 213
loop 1
x 44
y 130
priority 10
signal ignAct
)
)
(instance aIvana of Act
(properties
view 526
x 50
y 139
loop 0
cel 0

)

(method (init)
(super init:)
(self
setPri: 8
setScript: aIvanaScript
)
)
)

(instance aIvanaScript of Script
(properties)

(method (handleEvent event)
(if (or (!= (event type:) evSAID) (event claimed:))
(return)
)
(cond
(
(or
(Said 'talk/girl, woman, chick, babe, bitch')
(Said 'talk/girl, woman, chick, babe, bitch')
)
(Print 33 0) ; "Hey babe. What's your sign?"
(aIvanaScript changeState: 8 register: 102)
)
((Said 'talk/soda') ; testing soda machine
(aIvanaScript changeState: 12)
)
((Said 'talk')
(cond
((& (gEgo onControl:) ctlCYAN)
(Print 33 1) ; The giant lotto machine seems to drown out your voice.
)
((& (gEgo onControl:) ctlFUCHSIA)
(Print 33 2) ; "You attempt to catch the clerk's attention, "Excuse me.""
(aIvanaScript changeState: 8)
)
(else
(Print 33 12) ; "She can't hear you from way back here."
)
)
)
(
(and
(not (Said 'look>'))
(or
(Said '/key,penthouse,area')
(Said 'enroll')
(Said '//key,penthouse,area')
)
)
(Print 33 3) ; ""Excuse me, clerk. Whats with the soda machine?"
(aIvanaScript changeState: 8 register: 101)
)
((Said 'look/woman,bitch,slut')
(Print 33 4) ; "The Quiki Mart clerk eagerly awaits your every request."
(Print 33 5 #at -1 144) ; "(If you are a registered guest!)" ; this addes the text to the bottom of the screen. (under the breath type meaning)
)
)
)




(method (changeState newState &tmp IvanaLoop)
(ShowState self newState 1 2) ; Displays changeState info on screen when debug is enabled.
(switch (= state newState)
(0
(= seconds 1)
;(= seconds (Random 4 8))
)
(1
(aIvana
illegalBits: 0
setPri: 8
cycleSpeed: 0
setLoop: -1
setCycle: Walk
setMotion: MoveTo 72 124 self ;Ivanna walks up
)
)
(2
(= seconds (Random 4 8))
)
(3
(aIvana setMotion: MoveTo 53 138 self) ;Ivanna walk down
)
(4
(= seconds (Random 4 8))
)
(5
(aIvana setMotion: MoveTo 53 134 self) ;Ivanna walk down part 2
)
(6
(= seconds (Random 3 9)) ; Ivana does some random poses
(switch (= IvanaLoop (Random 0 5))
(0
(aIvana loop: 6 cycleSpeed: 4 setCycle: End self)
)
(1
(aIvana loop: 7 cycleSpeed: 4 setCycle: End self)
)
;;; (else
;;; (= state -1)
;;; )
)
)

(7
(self changeState: 0) ;Returns to the start. Only interupted if talked to.
)
(8
(aIvana setMotion: MoveTo 63 128 self) ; Let's try and talk. Ivanna stops and goes to central point.
)
(9
(aIvana setLoop: 5 cycleSpeed: 4 setCycle: Beg) ;Talk a little
(= seconds 3)
)
(10
(aIvana setCel: 0 setLoop: 0)
(= cycles 10)
)
(11
(cond
(register
(switch register
(101
(PrintA 33 7) ; "test 2"
)
(102
(PrintA 33 6) ; "test 3"
)
)
)

(else
(switch msgVar
(0
(PrintA 33 8) ; "test 1"
)
(1
(PrintA 33 9) ; "Yes? May I help you?"
)
(2
(PrintA 33 10) ; "Would you like me to call security?"
)
(3
(PrintA 33 11) ; "How may I help you?"
)
)
(if (> (++ msgVar) 3)
(= msgVar 0)
)
)
)
(self changeState: 0) ;Start all over again.
)
(12
(aIvana
illegalBits: 0
cycleSpeed: 0
;setLoop: -1
setCycle: Walk
setMotion: MoveTo 78 120 self ;Ivana walks out behind desk
)
)
(13 ;Ivana walks path to soda machine
(aIvana setPri: -1 setMotion: MoveTo 111 119 self)
)
(14 ;Ivana walks path to soda machine
(aIvana setMotion: MoveTo 87 179 self)
)
(15 ;Ivana walks path to soda machine
(aIvana setMotion: MoveTo 143 179 self)
)
(16 ;Ivana faces soda machine and scratches head and waits.
(aIvana loop: 6 cycleSpeed: 2 setCycle: End self)
;(= cycles 20)
)
(17
(aSoda setCel: 0) ;Soda machine stops.
(aIvana setCycle: Walk setLoop: -1 setMotion: MoveTo 143 173 self) ;Ivana starts walk back to counter.
(self changeState: 18)
)
(18 ;Ivana walks path back behind counter
(aIvana setMotion: MoveTo 87 179 self)
)
(19 ;Ivana walks path back behind counter
(aIvana setMotion: MoveTo 111 119 self)
)
(20 ;Ivana walks path back behind counter
(aIvana setCycle: Beg setMotion: MoveTo 78 120 self)
)
(21 ;Ivana walks path back behind counter
(aIvanaScript changeState: 0)
)

)
)
)

Offline doomlazer

Re: changeState woos
« Reply #6 on: April 01, 2025, 03:49:04 PM »
I recall cycles and seconds are shared between all scripts, so it's possible cycles/seconds set in one script are triggering event changes in another. It's something I've encountered before, but don't recall the exact details.

Also, DPath documentation


Offline Kawa

Re: changeState woos
« Reply #7 on: April 01, 2025, 04:05:39 PM »
I recall cycles and seconds are shared between all scripts, so it's possible cycles/seconds set in one script are triggering event changes in another.
Seconds and cycles are per-script properties. Doing (= seconds 2) or whatnot within RoomScript can't and won't change anything about aIvanaScript.

Code: [Select]
(method (doit &tmp thisSeconds)
(if cycles
(if (not (-- cycles))
(self cue:)
)
else
(if seconds
(= thisSeconds (GetTime 1))
(if (!= lastSeconds thisSeconds)
(= lastSeconds thisSeconds)
(if (not (-- seconds))
(self cue:)
)
)
)
)
)

Offline doomlazer

Re: changeState woos
« Reply #8 on: April 01, 2025, 04:25:44 PM »
Yeah, IDK. That's just what I remember happening. It was basically the same symptoms. I think I switched to using timers because I was having so many issues with cycles/seconds. Though since I don't remember the specifics and can't attempt to reproduce it, this message really isn't very helpful. sorry

Offline lskovlun

Re: changeState woos
« Reply #9 on: April 01, 2025, 08:43:13 PM »
A few things in the code: You have this line
Code: [Select]
(aIvana loop: 6 cycleSpeed: 2 setCycle: End self)in Ivana's state 16. You need to use setLoop here or the graphics will glitch (in theory, this could cause issues with collision detection, but when Ivana stops out on the floor (the "wrong" version), there is plenty of space around her so I doubt it).

The other thing I noted is:
Code: [Select]
(aIvana setCycle: Walk setLoop: -1 setMotion: MoveTo 143 173 self) ;Ivana starts walk back to counter.
(self changeState: 18)
Here you start a mover but then explicitly change her state. That mover will never finish because it immediately gets replaced by another. Probably remove the changeState call. The coordinates are also slightly different between state 15 and 17 (I assume they should be the same?).

A few things you can do:

The SetDebug call (I believe I've mentioned it before). You can put that in a state, and when it triggers, press s (in SSCI) or type bt (in ScummVM) to get a backtrace. That should show you what triggers the change of state.
The Show call will change the screen to display either the Priority (if called as Show 2) or the Control (if called as Show 4) screen. If you're having collision detection problems, maybe you can see the problem there. (Show 1) switches back to normal.


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

Page created in 0.054 seconds with 22 queries.