Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - robbo007

Pages: 1 2 [3] 4 5 ... 13
31
SCI Development Tools / Re: SCI01 Template Game
« on: September 25, 2025, 04:23:19 PM »
Just opening up old posts...I'm not sure how much more memory and heapspace adjustments the SCI01 template has over the SCI0. For me this is the selling point. I can give it a test run with my game. To see if its worth migrating everything over.

How can I migrate my scripts to the SCI01 template? Do I need to create a new room and then copy and paste the code on for each room?

How can I migrate my Views, Pics, Vocabs, Fonts etc to the SCI01 template? Do I have to export as patch file and import one by one?

Any help most appreciated.
Regards.

32
SCI Syntax Help / Re: Heap Space Fun
« on: September 21, 2025, 07:40:18 AM »
Ha, one could write a heap visualizer taking SCI0 savegames as input. They aren't compressed, but of course the format is going to vary depending on the version. But I think the main takeaway here is that the heap is not very fragmented, there's just very little memory left. Maybe you'll have to scale back some of the animations/actors.

It's not possible to use the SCI0 template game in SCI01. There was a property lookup table (VOCAB.994?) that provided very fast property lookup for the properties where speed was an issue. That would have to be regenerated, and the standard classes modified to suit. You'd have to switch to the SCI01 template game

But even better? Just switch to ScummVM! Its engine uses a completely different design where this isn't a problem.
ok thanks,
What are some of the main things that use up memory more than others? So I can try and optimise more my rooms?

What are the main changes with SCI01? Is it worth converting all my progress over to it and use the SCI01 template?

Unfortunately I want full MSDOS support on vintage hardware so I can use the ScummVM engine.

33
SCI Syntax Help / Re: Heap Space Fun
« on: September 19, 2025, 05:25:36 AM »
Just reopening this as my game advances so does the "Out of heap space" fun...

When I started this debacle  I had a few things I knew I wanted to make sure my game had. Loads of unique responses when a player typed into the parser. And to have a more dynamic gaming world, actors, NPC's etc moving around.

To reduce the size of my scripts I've been following the guidelines here: http://sciwiki.sierrahelp.com/index.php?title=Memory_Management
I use the text resource for all print statements. I've added scripts to the main.sc DisposeLoad section, but this is still not enough.

Do I need to include the template scripts like FEATURE, CONTROLS,GAME, OBJ, REV etc? Or do these all get removed automatically from heap when ego moves into the next room?

Currently I have listed:
Code: [Select]
(method (startRoom roomNum);this disposes these scripts after use to free up heapspace.
(DisposeLoad
NULL
FILEIO_SCRIPT
JUMP_SCRIPT
EXTRA_SCRIPT
WINDOW_SCRIPT
TIMER_SCRIPT
FOLLOW_SCRIPT
REV_SCRIPT
DCICON_SCRIPT
DOOR_SCRIPT
AUTODOOR_SCRIPT
WANDER_SCRIPT
AVOID_SCRIPT
DPATH_SCRIPT
SHOW_STATE
SIGHT_SCRIPT ;this was dded 18/9
DYING_SCRIPT ;this was added 18/9
DISCLAIMER_SCRIPT ;this was added 19/09
TITLESCREEN_SCRIPT  ;this was added 19/09
INITROOMS_SCRIPT

)

If I use a RoomScript or an Actor/Prop script in my room does this need to be manually disposed of? Or will it get automatically disposed when ego moves to the next room? If not, what's the best way to have these dispose?  What syntax do I need to use?

Is the heap space better in the SCI01 (Quest for Glory II) engine? If so, can I use this with my SCI0 template, my resource file and current game? Will I need to convert everything over? Does SCI Companion support this?

Regarding the Heap Space. To better understand it. How can I see a good visual map of the heap space in use. Or draw one like in the tutorials examples of the memory.  Excuse my maths skills but I'm not to switched on with hexadecimal. I see the heap space references with the alt-m debug command are in hex. Do more than one reference here mean the heap space is fragmented? I've included screenshots of the objects on the heap space also. Is this normal to have so many objects in heapspace in a room? Also using O seems to overlap the text. I see my inventory items all there also. Does this take up loads of memory on the heap? Should I be using less inventory items? Or can these be optimised as to not use loads of heap space?

Thanks.


34
SCI Syntax Help / Re: Joke text resoruce LSL3
« on: September 04, 2025, 10:42:36 AM »
Thanks everyone. Its all clear now. Amazing..

35
SCI Syntax Help / Re: Joke text resoruce LSL3
« on: September 03, 2025, 07:23:19 AM »
The way it's set up, a joke has a maximum of five messages. Any excess ones are marked by a space character (which is impossible to see in the screenshot). And it's not hex; it seems to be a joke number and an alphabetic character. But that's a red herring; the only thing the code looks at is that space character.

ok thanks. Could it be to do with the group numbers? Or so that the ComicScript knows when to finish?

Code: [Select]
(11
(aComic setCycle: Walk viewer: 0)
(= count 0)
(repeat
(++ count)
(= i (Random 0 42))
(if testCount
(= i (++ testCount))
(= [toldJoke i] 0)
)
(if (== [toldJoke i] 0)
(= [toldJoke i] 1)
(= group2 (= group1 (Random 49 51)))
(= group3 group1)
(while (== group1 group2)
(= group2 (Random 49 51))
)
(while
(or (== group3 group1) (== group3 group2))
(= group3 (Random 49 51))
)
(for ((= j 0)) (< j 5) ((++ j))
(= k 0)
(Format @jokeString 340 49 341 (+ j (* i 5))) ; "%s"
(if (!= 32 (StrAt @jokeString 1))
(for
((= line 0))
(< line (StrLen @jokeString))
((++ line))

(if (== 47 (StrAt @jokeString line))
(StrAt @jokeString line 37)
(switch (StrAt @jokeString (++ line))
(group1
(= [jokeArgs k] @ethnicGroup1)
(++ k)
)
(group2
(= [jokeArgs k] @ethnicGroup2)
(++ k)
)
(group3
(= [jokeArgs k] @ethnicGroup3)
(++ k)
)
)
(StrAt @jokeString line 115)
(++ line)
)
)
(Printf
@jokeString
[jokeArgs 0]
[jokeArgs 1]
[jokeArgs 2]
[jokeArgs 3]
[jokeArgs 4]
)
)
)
(if (> testCount 42)
(if testCount
(Print 340 50) ; "All done."
(= testCount 0)
else
(Print 340 51) ; "error"
)
)
(aDrummer setCycle: End)
(if (> (DoSound sndCHECK_DRIVER) 5)
(gSoundFX number: (Random 21 27) loop: 1 play:)
)
(break)
)
(if (>= count 1000)
(= state 12)
(break)
)
)
(= seconds 2)
)

https://github.com/sluicebox/sci-scripts/blob/main/lsl3-dos-1.021/src/rm340.sc

There seem to be 42 jokes in total.Then the last part of the 341 text resource has:

Code: [Select]
done2
done1
done3
done4
done5

Regards,

36
SCI Syntax Help / Joke text resoruce LSL3
« on: September 03, 2025, 06:02:23 AM »
Hi guys,
I'm just trying to understand the ComicScript instance in room 340 in LSL3. I understand what the script is doing but not sure why in the text resource 341 (which is where the joke text is located) there are what seems like hex codes after each joke? What do the codes do? Which part of the script uses them?
Thanks,

37
SCI Syntax Help / Re: Money, cash greenback
« on: August 21, 2025, 10:32:11 AM »
Before I forget to mention, there's a parser command in your main script that I suspect doesn't work as you intend.
Code: [Select]
(cond
((Said 'look>')
(cond
((Said '/carpet,down')
"Look carpet" will work, although I'm not sure why this would be in your main script...unless there's a carpet in every room in the game.
But "look down" doesn't parse as "down" I believe is an adverb. I think the game will just give the standard "look" command if the player types "look down."

Just a small observation.

ahh ok thanks for spotting that :) I'll review it.. It's a luxury to have a second set of eyes on your code :)

38
SCI Syntax Help / Re: Money, cash greenback
« on: August 20, 2025, 03:42:59 PM »
Any chance your fork of SC can support Windows XP :)
I guess there is a setting to make it target XP... and I mean in Visual Studio, not this.

Edit: https://helmet.kafuka.org/sci/SCICompanion_XP.exe freshly made for you. I don't know if it'll work, but lemme know. (Also includes the decimal word groups)

Amazing thanks. it seems to load and run things fine :)
Wow...I see it detects inconsistencies in the code that he original version doesn't. I'm going to have to check the readme on your github to see what has changed.



39
SCI Syntax Help / Re: Money, cash greenback
« on: August 20, 2025, 02:36:00 PM »
Kawa, maybe we need to make this print group numbers in decimal? The use cases for hex notation here are rather narrow (mainly related to the special tokens which are located at the top of the 12-bit range). And the interpreter uses decimal.
Ten-four, supreme space cadet sir!

*loads up MSVC*

Update: the next Nightly Build should have this change in it.

Any chance your fork of SC can support Windows XP :)

40
SCI Syntax Help / Re: Money, cash greenback
« on: August 20, 2025, 12:41:03 PM »
SCI Companion shows the group number in hex for some reason. In that case, you need to find group numbers 58 (hex) and 59 (hex) instead.

OMG!!!  You can go over code 100 times and not see something thats in plain daylight.

Hex code 58,59 in the Vocab file pointed me to the area and I saw this. The closing parenthesis on my inventory item should not be there. Removing it resolved the Bad said spec.

Code: [Select]
(instance CROWEBAR of Iitem
(properties
said '/crowebar, crowbar)'
description 101 ;The Crowebar \05_ This thing looks tough.
owner 0
view 227
loop 0
cel 0
script 0
name "Crowebar \05_"
)
)

Thanks for all your suggestions everybody and sorry for the long post...

41
SCI Syntax Help / Re: Money, cash greenback
« on: August 20, 2025, 06:37:16 AM »
What's the best way to troubleshoot "Bad Said Sepc hit return to continue / 88 , 89 )" errors?
Those numbers look like they are word numbers. Try looking them up on the vocab screen in Companion. That'll tell you which spec is at fault (hopefully).

So I just made sure its not my main.sc causing the issue, as in a new room I get the same bad said spec with the wallet item and also other non declared said syntaxes linked to "look". I've commented out all said syntaxes from the handleEvent in the main.sc except this:

Code: [Select]
(method (handleEvent pEvent &tmp i)
; ////////////////////////////////////////////////////////////////////
; ** This is debug functionality                                   //
; ** Comment it out if you don't want people to cheat in your game //
; ////////////////////////////////////////////////////////////////////
(if (== evKEYBOARD (pEvent type?))
; Check for ALT keys
(switch (pEvent message?)
($2f00 (Show 1)) ; alt-v ; Show visual
($2e00 (Show 4)) ; alt-c ; Show control
($1900 (Show 2)) ; alt-p ; Show priority
($3200      ; alt-m
; Show memory usage
(ShowFree)
(FormatPrint
{Free Heap: %u Bytes\nLargest ptr: %u Bytes\nFreeHunk: %u KBytes\nLargest hunk: %u Bytes}
(MemoryInfo miFREEHEAP)
(MemoryInfo miLARGESTPTR)
(>> (MemoryInfo miFREEHUNK) 6)
(MemoryInfo miLARGESTHUNK)
)
)
($1400      ; alt-t
; teleport to room
(gRoom newRoom: (GetNumber {Which Room Number?}))
)
($1700      ; alt-i
; get inventory
(gEgo get: (GetNumber {Which inventory#?}))
)
($1f00      ; alt-s
; Show cast
(gCast eachElementDo: #showSelf)
)
)
)
; //////////////////////////////////////////////////
; End of debug functionality                     //
; //////////////////////////////////////////////////
(super handleEvent: pEvent)
(if (or (!= (pEvent type:) evSAID) (pEvent claimed:))
(return)
)
(FormatPrint "Received SAID event in main.sc")
(cond
((Said 'look>')
(cond
((Said '/carpet,down')
(Print 0 115) ; It just lies there, under your feet.
)
((Said '/air,ceiling')
(Print 0 116) ; It's still up there!
)
((= i (gInv saidMe:))
(if (i ownedBy: gEgo)
(i showSelf:)
else
(Print 0 112) ; You see nothing special.
)
)
(else
(switch (Random 42 44)
(42
(Print 0 113) ; It's just as it appears.
)
(43
(Print 0 114) ; It doesn't look interesting.
)
(44
(Print 0 112) ; You see nothing special.
)
)
(pEvent claimed: 1)
)
)
)
)

I've checked the Vocab.000 and see in the "group" column number 88 and 89 refer to words described as nouns I've added. Removing them don't seem to do anything.

What is the process that the (method (handleEvent pEvent) uses. Checks local room first, then checks main.sc then...... ?
its only happening with "look". I have the above look syntax defined in my main.sc and in the new room I'm testing I have a condition:
Code: [Select]
((Said 'look>')
            (cond
                ((Said '/machine,slot')
                    (Print  {Natives Inc Casino machines.})
                )
                ((Said '[/!*]') ; just "look"
                    (Print {test})
                    )
If I type "look chair" I get the bad said spec also but it resolves the look statement using main.sc (Print 0 113) ; It's just as it appears. Could something be corrupt?


42
SCI Syntax Help / Re: Money, cash greenback
« on: August 18, 2025, 11:56:30 AM »
sorry to prolong this simple syntax...

What's the best way to troubleshoot "Bad Said Sepc hit return to continue / 88 , 89 )" errors?

The "look wallet" seems to be working from a main.sc perspective. It shows the wallet from the inventory when ego has it, all good.  It's in some rooms I get "bad said spec errors" and it does not do this with all inventory items.

For example the inventory item wetsuit has no bad spec error:

Code: [Select]
(instance WETSUIT of Iitem
(properties
said '/wetsuit'
description 77 ;A wetsuit.
owner 0
view 203
loop 0
cel 0
script 0
name "Wetsuit"
)
)


Regards,

43
SCI Syntax Help / Re: Money, cash greenback
« on: August 15, 2025, 04:51:46 AM »
Amazing thanks. That's what I needed. I did not see this in the LSL3 code. It must of slipped by me. Not being a programmer by trade the variables sometime evade my thought pattern.
Regards,
 

44
SCI Syntax Help / Re: Money, cash greenback
« on: August 14, 2025, 04:57:08 AM »
ok thanks. So there is no way to include this with less code in the main.sc? If I have to add everything to the game object's HandleEvent method I'll create soo much code.

I see in LSL3 main.sc  decompiled by sluicebox all the items can be "look"'ed at once you have the item in inventory from any room. It seems to only be declared like this in the main.sc

Code: [Select]
(instance Penthouse_Key of Iitem
(properties
name {Penthouse Key}
said '/key'
owner 450
view 12
)
)

If I declare my item like that I can't look at it. It only works by going into the inventory and selecting it. I can't type "look wallet".

Code: [Select]
(instance WALLET of Iitem
(properties
said '/wallet'
description 105 ;You've had this baby since Leisure Suit Larry 1. It contain $%d in cash.
owner 0
view 231
loop 0
cel 0
script 0
name "Wallet"
)
(method (showSelf &tmp [buf 500])
(Format @buf 000 105 gLarryDollars)
(Print @buf #title objectName #icon view loop cel)
)
)

45
SCI Syntax Help / Re: Money, cash greenback
« on: August 13, 2025, 04:33:53 PM »
Keep a global variable to track the exact amount of cash, yeah.

What you might want to do is either have a wallet that's always in your inventory and may be empty (LSL1), or have a procedure in script 0 to give or take money that, if you have the Cash item but the global goes <= 0 it takes away the item, or if it's > 0 and you don't have the item, gives it to you.

So I opted for the LSL1 approach on this with a global value of gLarryDollars

Code: [Select]
(instance WALLET of Iitem
(properties
said '/wallet'
description 105 ;You've had this baby since Leisure Suit Larry 1. It contain $%d in cash.
owner 0
view 231
loop 0
cel 0
script 0
name "Wallet"
)
(method (showSelf &tmp [buf 500])
(Format @buf 000 105 gLarryDollars)
(Print @buf #title objectName #icon view loop cel)
)
)

How do you get the parser to understand "look wallet" or "look at wallet"? without adding that to every room? Does it not pick up the Said from the syntax in the Iitem?

Pages: 1 2 [3] 4 5 ... 13

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

Page created in 0.072 seconds with 20 queries.