Roguelike RPG in the OHR?

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

User avatar
Newbie Newtype
Reigning Smash Champion
Posts: 1873
Joined: Mon Oct 15, 2007 9:44 pm

Post 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.
<TheGiz> oh hai doggy, oh no that's the straw that broke tjhe came baclsb
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post 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.
User avatar
Newbie Newtype
Reigning Smash Champion
Posts: 1873
Joined: Mon Oct 15, 2007 9:44 pm

Post by Newbie Newtype »

I actually consider using slices in such a fashion to be fake object oriented scripting.
<TheGiz> oh hai doggy, oh no that's the straw that broke tjhe came baclsb
User avatar
Pepsi Ranger
Liquid Metal Slime
Posts: 1419
Joined: Thu Nov 22, 2007 6:25 am
Location: South Florida

Post 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.
Place Obligatory Signature Here
Post Reply