mob
var
Level=1
CHP=100
MHP=100
CReir=100
MReir=100
BReir=100
CStr=10
BStr=10
CReia=10
BReia=10
CEnd=10
BEnd=10
Souls=0
TierMod=0.5
PressureMod=100
HPMod=1
ReirMod=1
StrMod=1
ReiMod=1
EndMod=1
ImmunityP=0
FocusP=0
ImmenseStrengthP=0
ThickSkinP=0
OverwhelmingForceP=0
QuickLearnerP=0
UnlockedPotentialP=0
NPC=0
CAgil=10
BAgil=10
AgilMod=1
Name=""
Class=""
Race=""
Rank=""
Gender=""
ReleaseType=""
HollowType=""
SmashRank=1
FlurryRank=1
BlockRank=1
DodgeRank=1
ChargeRank=1
IkkotsuRank=1
SokkotsuRank=1
ShunkouRank=1
ThrustRank=1
stuck=0
isblocking=0
cantattack=0
weakened=0
bleeding=0
frozen=0
slowed=0
dazed=0
inrelease=0
inLetzStil=0
inshunkou=0
canthrust=0
BowType=""
bowequipped=0
ArrowVariation=""
channel="OOC"
list
wearingclothes=list(armband=0,captainsuit=0,arrancarsuit=0,eyepatch=0,quincyuniform=0,gloves=0,headband=0,shirt=0,labcoat=0,
shinigamisuit=0,pants=0,shinirepcape=0,sanreiglove=0,zanpakutou=0,scarf=0,shoes=0)

hasclothes=list(armband=0,captainsuit=0,arrancarsuit=0,eyepatch=0,quincyuniform=0,gloves=0,headband=0,shirt=0,labcoat=0,
shinigamisuit=0,pants=0,shinirepcape=0,sanreiglove=1,zanpakutou=0,scarf=0,shoes=0)
proc/Pressure()
return round(((CHP + CStr + CReia + CEnd) * TierMod * PressureMod * CReir) / 100000,1)
I reckon it's a conflict between mob.Name, and atom.name. Is there a particular reason that you've defined mob.Name, as opposed to using the existing atom.name variable?
What exactly is the difference between the two? Name is the player's inputted name, as defined here:
        New
icon='done.dmi'
Click()
var/char_name
while(!char_name)
char_name=input("Choose your name:","Name") as null|text
usr.Name=char_name
usr.loc=locate(6,6,2)
Well, that's what I'm asking you! ^_^

atom.name is a variable that's defined by default, to denote the printable / viewable name of an atom. By the sounds of it, for your player mobs, the character name is what should be it's value.

Given that, I'd remove the Name variable, and just use name.
How would I change the above code to allow that? I have never worked with atoms before, so I don't even know how to call it.
You're already doing it, for loc. loc is an atom variable. mobs are sub-types of atoms, and so ... you're working with atoms all the time!

New
icon='done.dmi'
Click()
var/char_name
while(!char_name)
char_name=input("Choose your name:","Name") as null|text
usr.name=char_name
usr.loc=locate(6,6,2)


And remove var/Name off mob.
Scratch that. I have, but without actually knowing about it. I have some alterations to make, so I'll let you know what happens in a little bit.
runtime error: Failed to write variable Race to savefile players/Alaricus.sav.  The value being written was "Human".
proc name: Write (/mob/Write)
usr: Test (/mob)
src: Test (/mob)
call stack:
Test (/mob): Write(players/Alaricus.sav (/savefile))
Test (/mob): SaveC()
Test (/mob): Save()


It solved the problem for a second, but now it seems we have awakened an entirely new beast.

(Edit: Actually now that I look at it, the problem was not fixed. I was simply tabbed to a different channel.

Apparently, removing Name just makes the error go to another variable x_x)
Can you show me all the Write() procs you've got in your project?
That's the only one.

However... I think it MAY be fixed? Loading as well. This is what I have now:
mob
Write(var/savefile/F)
..(F)
F["x"] << x
F["y"] << y
F["z"] << z

Read(var/savefile/F)
..(F)
var/x
var/y
var/z
F["x"] >> x
F["y"] >> y
F["z"] >> z
loc = locate(x,y,z)

mob/var/tmp/cansave=1

mob
proc
SaveC()
if(src.cansave)
var/savefile/F=new("players/[src.key].sav")
Write(F)

LoadC()
if(fexists("players/[src.key].sav"))
var/savefile/F=new("players/[src.key].sav")
Read(F)
src<<output("Load successful.","system")
src.cansave=1
src.cantattack=0
spawn() ReiRegen()
spawn() HPRegen()
else
src<<"You have no savefile."

DelC()
if(fexists("players/[src.key].sav"))
var/conf=input("Are you sure you want to delete your savefile?")in list("Yes","No")
if(conf=="Yes")
fdel("players/[src.key].sav")
src<<output("Savefile deleted sucessfully.","system")
else
src<<output("Deletion cancelled.","system")
else
src<<output("You have no save file.","system")

obj
Menu
Load
icon='done.dmi'
Click()
usr.LoadC()

mob/verb
Save()
usr.SaveC()
usr<<output("Save successful.","system")


Somehow, adding an F to the ..() in both Write() and REad() fixed it? I have no clue why, though I suppose it was because nothing was being specified. Still though... wat?
Well, it does mean you were not passing the savefile to the default proc, yes, so it doesn't know where to save/load.

http://www.byond.com/forum/?post=1557368#comment9817872

I recommended that there.

Also, I do still really recommend you don't call Write() directly.
Well when I try to use "F << src", it says "runtime error: bad output" every time.
Best response
This'll be due to your saving of icons, overlays and underlays. I guess I'll leave you as you are for now, but strongly recommend you implement the steps talked about here:

http://www.byond.com/forum/?post=1187245
http://www.byond.com/forum/?post=1187381

As it will greatly improve 1. the performance of saves/loads when you 50+ players 2. your ability to debug saving/loading issues.
Your comment about saving overlays and underlays got me thinking.

mob
var/tmp
effect/lvlup/l=new()
list/cooldowns
effect/shunkou/s=new()
effect/shunkoufire/f=new()
effect/shunkouice/i=new()
effect/shunkoulightning/e=new()
effect/shunkouwind/w=new()


I read through Ter's tutorial, and got some ideas with tmp variables. Those were all just normal variables being saved, which when using "F << src" was giving a bad output. However, when changing them to temp, it started working properly.

Man this was a headache lol. Regardless, thanks for the aid.
No problem! Hope all goes well with your game.
Page: 1 2