ID:175327
 
I've wanted to make my own rpg from scratch, however it will require the ability to store other mobs, like pets stats. How can I do this? Anyone have a suggestion?
Ryuo
You have to make a save verb. There are a lot of demos and libraries on that.

This is the best one in my opinion:

http://developer.byond.com/hub/Deadron/CharacterHandling

But truly, there are a lot!
In response to SSChicken
You seem to miss the point. I need to make a method to store mob stats, that are not directly connected to the user. They would be like in a list, but how do I store them like this?
In response to Ryuo
Right sorry....well you can try and save the list like you would save any other variable.

var/spells[1]

mob/Write(savefile/L)
L << spells[1]


But thats just an idea..sorry if it dosnt work.
In response to Ryuo
What exactly are you trying to do? From what I can gather you want a mobA (player), too be able to access mobB's (There pets) stats. Is that right?
Or do you just want access to all the pets in the worlds stats?
In response to Ryuo
Ryuo wrote:
You seem to miss the point. I need to make a method to store mob stats, that are not directly connected to the user. They would be like in a list, but how do I store them like this?

Easily!

You have to make the mob's variable defined as another mob/pets.
mob/var
mob/pets/Pet
mob/pets/Dragon


Then, when they log in, set the mob type of that variable.

mob/Login()
src.Pet=new/mob/pets/Dragon(locate(1,2,1))
..()


Now the variable 'Pet' it attached to a Dragon, you can do anything you want with it, such as;

src.Pet.icon_state="mad"


To display the stats, do this;

mob/Stat()
if(src.Pet) // Make sure they have a pet!
statpanel("Pet Status")
stat("Health:",src.Pet.health) // Display it's health.


Hope that helps you.

~>Volte