ID:2468583
 
Code:
#include <deadron/characterhandling>
#include <dantom/htmllib>

Overseer
parent_type = /mob
var

Creations = 5

tmp
Party/Battle

Logout()
for (var/obj/playable/P in Battle.Members)
if (P.loc != P.owner)
P.loc = P.owner
..()

New()
..()
obj/playable
icon = 'Battle.dmi'
icon_state = "Humaniod"
var
owner // Who controls this Token

Species
SubSpecies
Type = "Force"

Health = 10
THealth = 10

Energy
TEnergy

Stamina
TStamina

Attribute
Strength
Agility
Body
Mind
Willpower
Soul
Luck
Rating = 0
list
obj/Battle/Attack = new()
obj/Battle/Defense = new()
obj/Battle/Support = new()
obj/Battle/Movement = new()

tmp/
Party/Team
//Battle Variables
obj/playable/Target
Init
Battle
Turn
Alive
Timer

New(Overseer/O)
..()
owner = O
Strength = new/Attribute(src)
Agility = new/Attribute(src)
Body = new/Attribute(src)
Mind = new/Attribute(src)
Willpower = new/Attribute(src)
Soul = new/Attribute(src)
Luck = new/Attribute(src)

Attack.Add(new/obj/Battle/Attack/UnarmedAttack(src))
Movement.Add(new/obj/Battle/Movement/North(src))
Movement.Add(new/obj/Battle/Movement/South(src))
Movement.Add(new/obj/Battle/Movement/West(src))
Movement.Add(new/obj/Battle/Movement/East(src))

Attribute
parent_type = /obj/
var
obj/playable/owner
Score = 12
Exp = 0

list/Abilities = new()

New(obj/playable/P)
..()
owner = P
loc = P

Ability
parent_type = /obj/
var
Score = 2
creator = "Default"
Attribute/owner

Type = ""

New(Attribute/Owned,use)
..()
owner = Owned
Type = use
loc = owner

Humaniod
parent_type = /obj/playable/
Species = "Humaniod"
New()
..()
Strength = new/Attribute/Strength/Humaniod(src)
Agility = new/Attribute/Agility/Humaniod(src)
Body = new/Attribute/Body/Humaniod(src)
Mind = new/Attribute/Mind/Humaniod(src)
Willpower = new/Attribute/Willpower/Humaniod(src)
Soul = new/Attribute/Soul/Humaniod(src)
Luck = new/Attribute/Luck/Humaniod(src)
Human
SubSpecies = "Human"
New()
..()


Problem description:
runtime error: cannot append to list
proc name: Read (/mob/Read)
usr: (src)
src: Sleinth (/Overseer/Human)
src.loc: null
call stack:
Sleinth (/Overseer/Human): Read(players/s/sleinth.sav (/savefile))
Sleinth (/client): base LoadMob("Sleinth")
ChoosingCharacter (/mob/BaseCamp/ChoosingCharacter): ChooseCharacterResult("Sleinth")
ChoosingCharacter (/mob/BaseCamp/ChoosingCharacter): Topic("menu=choosing_character;choice...", /list (/list))


When the mob is saved obj/playable exists inside the mob. When the mob is loaded back into the game obj/playable will not load.

I am not sure if I am missing something needed to save or load the obj. Maybe the library doesn't support saving obj types in the mob?
list
obj/Battle/Attack = new()
obj/Battle/Defense = new()
obj/Battle/Support = new()
obj/Battle/Movement = new()


These aren't lists. You are creating a single object.

DM does not support typed arrays.
I changed the lists to read as follows.
obj/playable
var
list/Attack = new()
list/Defense = new()
list/Support = new()
list/Movement = new()

After doing this the Error still occurs. I am checking for similar problems, but haven't found any.
(On a side note, the lists were holding obj/Battle just fine from what i can see in game before the change.)
Gonna need you to turn DEBUG on to point out the line number of the offending runtime error.
runtime error: cannot append to list
proc name: Read (/mob/Read)
source file: implementation.dm,58
usr: (src)
src: Human (/Overseer/Human)
src.loc: null
call stack:
Human (/Overseer/Human): Read(players/g/guest3952174267.sav (/savefile))
Guest-3952174267 (/client): base LoadMob("Guest-3952174267")
ChoosingCharacter (/mob/BaseCamp/ChoosingCharacter): ChooseCharacterResult("Guest-3952174267")
ChoosingCharacter (/mob/BaseCamp/ChoosingCharacter): Topic("menu=choosing_character;choice...", /list (/list))
    Read(savefile/F)
// Restore the mob's location if that has been specified and there is a map.
// Tries to use Move() to place the character, in case the game has special Move() handling.
// If that fails, forces the move by setting the loc.

// Call the default Read() behavior for mobs.
..() //Problem line is here

if (base_save_location && world.maxx)
var/last_x
var/last_y
var/last_z
F["last_x"] >> last_x
F["last_y"] >> last_y
F["last_z"] >> last_z
var/destination = locate(last_x, last_y, last_z)

if (!Move(destination))
loc = destination
return
I don't really understand how it is occurring, however when The mob is saved it also creates Human (which is the var/SubSpecies inside obj/playable). I don't know what is causing this but it is probably related to the problem.
obj/playable
New(Overseer/O)
..()
owner = O
Strength = new/Attribute(src)
Agility = new/Attribute(src)
Body = new/Attribute(src)
Mind = new/Attribute(src)
Willpower = new/Attribute(src)
Soul = new/Attribute(src)
Luck = new/Attribute(src)

//Attack.Add(new/obj/Battle/Attack/UnarmedAttack(src))
//Movement.Add(new/obj/Battle/Movement/North(src))
//Movement.Add(new/obj/Battle/Movement/South(src))
//Movement.Add(new/obj/Battle/Movement/West(src))
//Movement.Add(new/obj/Battle/Movement/East(src))



This fixed the problem.
(edit) so I think I just need to empty the lists containing all of the obj/Battle and recreate them when obj/playable is called from the savefile.

Login to reply.