ID:162760
 
So kinda feel dumb that I've researched this topic as much as I have and yet can't figure out how to get it to work so basically I just want to save and load the verbs that a player has gotten, so like if they've leveled up they get this verb or from some quest they get it ect, or they have a verb from an item that's equipped. If I could just figure out how to refer to verbs that the player currently has, or maybe create a conditional state where the player will have the verb, though I'd prefer the former, and not even sure the latter would be possible since that sort of thing doesn't like to be done at runtime.

Mike-


Conditionals that don't like to be done at runtime? Do you really know what that means?

What's your definition of a conditional.
In response to Obs
Actually I think i meant the opposite, basically what I'm saying is you can't create a static verb that is available if the client/mob has the needed conditions to have it or rather you can't have a conditional argument to having a verb available to you.
I've read alot of posts saying why don't you save the condition that gives you the verb, if I knew how to give a verb based on that I'd be fine, but I can't find the reference for it.

like
mob/verb
if("somethingvar==1")
something()
...stuff


obviously this code is nonsensical but that's what I meant as to what doesn't work.
In response to Kichimichi
mob
var
V
verb
Savenow()
set name ="Save"
var/savefile/F = new("players/[usr.key].sav")
usr.V = usr.verbs
Write(F)

mob
verb
LoadPlayer()
if(fexists("players/[src.key].sav"))
var/savefile/F = new("players/[src.key].sav")
Read(F)
for(var/stuff in src.V)
src.verbs += stuff
In response to Pirion
didn't work code did nothing for me, do I have to make V a list and update it when my usr's get new verbs, if so how would I do that otherwise yeah not working.

Mike-
In response to Kichimichi
Sorry, I forgot to make some changes, try it now.
In response to Pirion
still doesn't work
In response to Pirion
You can't just use = with other lists. You do it like this:
mob
var
V[0]
verb
Savenow()
set name ="Save"
var/savefile/F = new("players/[src.key].sav")
for(var/verb in src.verbs)
src.V+=verb
Write(F)
//or
mob
var
V[0]
verb
Savenow()
set name ="Save"
var/savefile/F = new("players/[src.key].sav")
src.V=src.verbs.Copy()
Write(F)

The code for loading is correct.
In response to Kakashi24142
ah thanks for the responce kakashi, I'm gonna fgo with a different system though I think to avoid saving temp in oview() verbs and whatnot...,

Mike-