Author Topic: SCI0 - Death Icon always set to loop indefinitely  (Read 2581 times)

0 Members and 1 Guest are viewing this topic.

Offline Doan Sephim

SCI0 - Death Icon always set to loop indefinitely
« on: January 21, 2021, 09:42:20 PM »
I'd like to have some more flexibility with the death handler icon, if possible. It seems to be set to always cycle forward indefinitely.

Is there a way for me to just run the Cels ONCE, like you can do with setCycle: End.

The Method is here, but it's not clear to me how to allow a choice between cycling once or infinite:
Code: [Select]
(instance deadIcon of DCIcon
(properties)

(method (init)
(super init:)
(if (== gRoomNumberExit 540)
(= cycler (End new:))
(cycler init: self)
)
)
)


Artificial Intelligence Competition

Offline lskovlun

Re: SCI0 - Death Icon always set to loop indefinitely
« Reply #1 on: January 23, 2021, 02:27:48 PM »
Code: [Select]
(instance deadIcon of DCIcon
(properties)

(method (init)
(super init:)
(if (== gRoomNumberExit 540)
(= cycler (End new:))
(cycler init: self)
)
)
)
That if-statement there is a holdover from LSL3 and might cause trouble down the road if you ever have a room 540.
If you only need this once or twice, then that structure might be appropriate; it is simple and the code is already there. Another thing you could do is add a new global variable, or a new property to dyingScript. Then change the check above to look there instead.


Offline Doan Sephim

Re: SCI0 - Death Icon always set to loop indefinitely
« Reply #2 on: February 05, 2021, 08:55:01 AM »

Thanks. Now I understand what the room number 540 was all about. Instead of the room number, I did like you said and just created a global variable that when true would trigger the code properly.

Code: [Select]
(instance deadIcon of DCIcon
(properties)

(method (init)
(super init:)
(if (== gDeathIconEnd 1)
(= cycler (End new:))
(cycler init: self)
)
)
)


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

Page created in 0.067 seconds with 23 queries.