Page 4 of 4

Posted: Sat May 23, 2009 7:46 am
by Newbie Newtype
I know I'm bumping a thread many many moons old, down to the years, but I believe slices can make many things about a Rogue like realistically possible.

Basically, the problem with items is that you either can't have unique properties of the same type of item, or you have to eat quite a few globals or use menu slots to have an inventory system.

I figured out today that Slices can be used for "fake object oriented" scripting purposes, meaning that if needed, they can be used just for storing data, and conserving globals at that. Here's how:

Image

Basically, the only global necessary would actually be the parent, since it can just create children slices that are attached to it. With each item being an individual slice with variables that alter its properties, this system would allow a way for every item to be completely unique even if they are the same type.

And if three extras aren't enough, TMC said that you can use many other variables that slices have if you are willing to use specific commands to access such variables and use them for different purposes, or each item could have its own child that you can use for more extra data if necessary.

Posted: Sat May 23, 2009 2:45 pm
by Bob the Hamster
Yep :) I used invisible slices as metadata in Crypt of Baconthulhu quite extensively. It works great. Real arrays will be better, but until the become available, hidden slices are the best way to do structured data storage. Much better than read/write global.

As for the inventory access, I just need to buckle down and make some commands for direct inventory access.

Posted: Sat May 23, 2009 3:09 pm
by Newbie Newtype
I actually consider using slices in such a fashion to be fake object oriented scripting.

Posted: Sun May 24, 2009 2:30 am
by Pepsi Ranger
Hmm, this sounds like it would be quite useful compared to the clunky way I'm handling things now. Now I wish I had taken a little extra time to learn these things before diving into my current project...

Maybe for the sequel.