Author Topic: SCI0: Issues implementing Trite Phrase Menu item  (Read 139 times)

0 Members and 1 Guest are viewing this topic.

Offline robbo007

SCI0: Issues implementing Trite Phrase Menu item
« on: September 26, 2024, 04:35:18 PM »
Hi guys,
I'm trying to implement something like the Trite Phrase used in LSL2 or the Expletive in LSL3. The LSL2 version seems a lot simpler but I'm getting a crash when using the code in my main.sc

I've added the following to my main.sc
Code: [Select]
(= gExpletive (Format @gExpletiveBuffer 976 0)) ; "Have a nice day."
and I've added the following to menubar.sc

Code: [Select]
(AddMenu
{ Action_}
{Pause Game`^p:Inventory`^I:Retype`#3:--! :Colors`^c :Ask about`^a :Boss Key`^b :Lowe-O-Meter\05`^h :Expletive`^x};:Expletive`^x
)

Code: [Select]
(MENU_EXPLETIVE
(GetInput (Format @temp4 gExpletive) 38
{Enter your favorite expletive:}
)
(if (> (StrLen @temp4) 4)
(Format gExpletive @temp4)
)
)

The game.sh has:
Code: [Select]
(define MENU_EXPLETIVE $0309)
And I have a text file created 976 with the 0 entry holding "Have a nice day"

I get the opps error when starting my game. Using the debug commands I see its getting stuck in room 290 init. This room runs a speed checker for real hardware at startup.

Code: [Select]
(method (init)
(ProgramControl)
(= gProgramControl FALSE)
(SL disable:)
(TheMenuBar hide:)
(super init:)
(gEgo
view: 290
posn: 20 100
setStep: 1 1
setMotion: MoveTo 3000 100
setCycle: Walk ;even though view.290 has only one frame, the overhead of a Cycler makes the simulation more realistic.
init:
)
(gGame setSpeed: 0)
)








Offline lskovlun

Re: SCI0: Issues implementing Trite Phrase Menu item
« Reply #1 on: September 29, 2024, 03:54:12 AM »
Did you insert the new variable in the middle of the existing globals, and if so, did you remember to recompile everything? It may be a good idea in any case...

Offline robbo007

Re: SCI0: Issues implementing Trite Phrase Menu item
« Reply #2 on: September 29, 2024, 03:09:55 PM »
Hi,
I did, I've got gExpletive defined in my main.sc. Recompiled all.
Regards,


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

Page created in 0.028 seconds with 22 queries.