var/list/Item/ListOfItemImported=dd_file2list('Texts/Item.txt')
var/list/Item/ListOfItemNumbered
var/list/Item/ListOfItemNumbered.len = 0
mob/verb/test_list()
var/seperator=27
var/number=0
var/max=1
var/total=0
for(var/V in ListOfItemImported)
if(total>=max)
return
ListOfItemNumbered.len+=1//this is line 132
ListOfItemNumbered[ListOfItemNumbered.len]=ListOfItemImported[V]
src<<"[V]=[ListOfItemImported[V]]"
number+=1
if(number>=seperator)
sleep(1)
number=0
total+=1
Problem description:
I have a list of items in a text box for quick and easy edits without having to re-compile the entire source (which for some reason lags horribly, but that is another problem I will solve later.) It is formatted like so, without the comments:
[0]//Item Number
potion_1//item name
HP+=50//what it does
[1]//Item Number
potion_2//item name
HP+=150//what it does
What I am trying to do is reference each line to a number, in this case:
(1="[0]",2="potion_1") etc
for some reason though, the debugging output is wrote:
runtime error: Cannot read null.len
proc name: test list (/mob/verb/test_list)
source file: Player.dm,132
usr: KingCold999 (/mob)
src: KingCold999 (/mob)
call stack:
KingCold999 (/mob): test list()
even though it is referenced to an actual list. Without trying to increase the length though, it wrote:
list index out of bounds
Does anyone see what I am doing wrong?
I am using Deadron.texthandling
var/list/Item/whatever
The "Item" in there is probably messing everything up, unless you can declare subtypes of /list, which I don't think you can do.