#How To Add An RPG Inventory with uVS?

1 messages · Page 1 of 1 (latest)

crude linden
#

Im curious... How can i implement an inventory and drop item system for RPGs like in Diablo 2?

(Each item occupies 1 slot. No need for size)

Is it possible to create scriptable objects (DO) with unity visual scripting (uVS) and not using c#?

Everywhere i search - its recommended to use SO...

I want to add weapon drops with magic stats... And a range of them...

"Vampire Rifle Of Hell"

1 ~ 4% turn dmg into hp
1 ~ 7% chance to burn

So it can have 1% hp steal and 3% burn chance... Or 4% hp steal and 1% burn... And so on.

I would love to add this into my game.

I already have a drop item system from enemies. When they die, there's a % chance to drop item.

Now i need to add this item to an inventory. Save item so it doesnt disappear on closing game. And spawning different stats with suffixes/prefixes.

Any help?

===

@lime pebble @remote prairie you guys have helped me a lot previously, maybe you know about this

void wedge
#

what is the issue with creating scriptable objects with c# its very easy

crude linden
#

I tried once. Failed. Didnt work :/

#

Seems like c# doesnt like me lol

crude linden
#

i dont understand why its that doable with c# but not with uVS hmm

lime pebble
#

If not I can help you make the Scriptable Object since its quite easy

crude linden
#

and what about the inventory system. I've been reading about it and SO are not obligatory to make it happen.

lime pebble
#

Yeah its not obligatory its just more difficult

#

Atleast from what i remember because its been like 2 years since i tried to make a Inventory

crude linden
# lime pebble Yeah its not obligatory its just more difficult

Really, 2 years. hmm and without SO - what would be the method?

I've been told playerPrefs is not good for things that are not editor-related. And "Saved Variables" in uVS (according to manual) uses playerPrefs.

so how are items, specially weapons with magic stats, saved properly?

lime pebble
crude linden
#

Found the written guide. Its a shame his patreon doesnt exist or no longer publishes new tutorials...

Thanks for that reference. I saw it the other day but couldnt focus on loooong videos (like 5 of 15 mins each).

Reading this guide helps

crude linden
lime pebble
#

I cant really give you more info as I don't have your inventory code to see where or how to implement this for your specific case

crude linden
#

I'll share what I have soon.

crude linden
#

And after 13 days since I got the wish to add an inventory to my game...

No C# needed at all. No scriptable object. 100% uVS.

My game can now:

• Drop items with random suffix/prefix names with stat bonuses.
• Pick them and add to inventory. Checks if it's stackable, empty slot or shows bag full.
• Can equip weapons or armors. They can't be crossed (armor in weapon, etc).
• Weapon becomes available when equipped to be used.
• Headgear shows a placeholder - I can add TONS of headgear styling with this now as it follows player's head.
• Items have stats that adds and shows correctly in player's stat screen
• Stat screen have separated base stat + bonus stat. And even shows special effects power.
• System can be saved / loaded even after game closes so progress and drops are not lost.
• Inventory is scrollable, resizeable, and can have less or more slots with ease (maybe start small and purchase more space?)

I may share a tutorial on how to do this. Because I didn't see any tutorial for this online. The only ones I've found are sort of "here's a custom node made with c#, buy it, and get it done" type of videos... and that is not a tutorial. That's an upsell.

I always loved inventories in videogames. I didn't want to do this on my game because I thought it was "impossible" at my current skill level (5 months old since I started...). BUT... I really like inventories - so I made one. The great thing about it, I can export and readd in future games using this same system!

Thanks for the resources some people here gave me. I appreciate it.

void wedge
#

How did you make scriptable objects without c#?

willow pulsar
crude linden
crude linden
# void wedge How did you make scriptable objects without c#?

I didn't use scriptable objects. and I mention that in the 2nd line 🙂

Mainly, because I tried to "create a scriptable object" in the past for other stuff... but im not sure why c# doesn't like me and it never worked... so since it never worked, i found a differemt way to get it working.

willow pulsar
crude linden
void wedge
crude linden
#

Im the kind of guy who prefers tutorials that teaches you how to think - rather than follow these steps to reproduce the thing.

Think > Remake.

Once you know how to think, you can create on your own and go further.

#

Just need one more feature before I lay off the inventory, and that is "Equipping Potion" in 2 consumable slots. heal + special effect type.

void wedge
#

i would have different groups in a game with different inventory

crude linden
#

List?
Used by an event?

crude linden
void wedge
# crude linden List? Used by an event?

i would have to use list of scriptable object or list of gameobject maybe? as for used by an event i guess i can just add a trigger event at the end but i need it to be able to do that

void wedge
crude linden
void wedge
#

it can be 2-3-4 or more but its because that game requires 4

crude linden
void wedge
#

** TWITCH LIVESTREAM ARCHIVE from http://twitch.tv/marriland (various games are streamed, see Twitch description for schedule) **

This SNES game isn't really a great game but it's hilarious so I'm playing it for kicks. Yeah, that's right, Tecmo Secret of the Stars came out in the US in 1995, after classics such as Final Fantasy II (IV) and ...

▶ Play video
void wedge
crude linden
crude linden
void wedge
#

for each group of 4 player

#

look up further in the game there is a different group of character that you play as, you can switch between the two groups and they have different inventory i think i am not 100% certain

#

every group has a common inventory that is limited in size

#

every group has 3-4 character and they have equipments

crude linden
void wedge
#

so you use a string for your inventory system?

crude linden
#

Its a mix of AOT dictionaries, custom events, gameObject Manager and using strings.

void wedge
#

okay

crude linden
# void wedge okay

Tomorrow I'll record my inventory, what it can do and how i did it.

Sorry for the delay, needed to finish some features and polish its functions.

I recently completed most of it for now. So its ready to be shown.

Will post a new thread and a video tour inside the graphs about it. Tagging you there ✌️

sleek osprey
#

How's this going? In general i only use SO for the initial database that holds the descriptions of items.

Ingame u spawn and use copies of those however u want.

Then use something like binary, json or xml to store player inventory

crude linden
#

It's been harder to record - met bugs while recording, had to fix bugs before sharing it. I'm almost done.

#

I have these in file. But it's not finished yet

crude linden
sleek osprey
#

Ah, if you ever want to revisit it I can give you detailed/concise approach to make it work, but I'm also a big fan of "do what works for you"

#

you can also use Google Sheets or MS Excel as a CSV generator for game-data lol