ID:261477
 
I get this error when ever I click on the Channles verb.
runtime error: Cannot execute null.Add().
proc name: Channles (/mob/pc/verb/Channles)
usr: GLS (/mob/pc)
src: GLS (/mob/pc)
call stack:
GLS (/mob/pc): Channles()

now the code below uses the two vars namedchannle and hear.

Channles()
var/savefile/F = new("channles.sav")
var/list/Channle = new/list(30) // List of Channles menu
F["PlayChannles"] >> Channle
Channle.Add("Add Channle")
Channle.Add("Remove Channle")
var/channleselection = input("What channle would you like to hear?","Pick Channle",) in Channle
switch(channleselection) // Choice of channle
if("Add Channle")
usr:namedchannle = input("What would you like to name your channle?","Name Channle",)
Channle += "[usr:namedchannle]" // Add ur channle to the list
usr:hear = "[usr:namedchannle]"
Channle.Remove("Add Channle")
Channle.Remove("Remove Channle")
F["PlayChannles"] << Channle
if("Remove Channle")
if(usr:namedchannle=="")
usr << "You have no channle to remove."
else
Channle -= usr:namedchannle // Take your channle from the list
usr:namedchannle=""
Channle.Remove("Add Channle")
Channle.Remove("Remove Channle")
F["PlayChannles"] << Channle
else
usr:hear="[channleselection]" // So you can hear this channle
Green Lime wrote:
F["PlayChannles"] >> Channle

It seems like there is no Channle (sic) in PlayChannles, so when it executes the next line, you get an error. Right after it's loaded, test if Channle is null, and initialize it if you have to.
In response to Shadowdarke
Shadowdarke wrote:
Green Lime wrote:
F["PlayChannles"] >> Channle

It seems like there is no Channle (sic) in PlayChannles, so when it executes the next line, you get an error. Right after it's loaded, test if Channle is null, and initialize it if you have to.

Im not quite sure what ur saying. I tryed if(Channle==null) then var/list/Channle = new/list(30) // List of Channles menu. But it didnt seem to work and brought up some errors.
In response to Green Lime
Green Lime wrote:
Shadowdarke wrote:
Green Lime wrote:
F["PlayChannles"] >> Channle

It seems like there is no Channle (sic) in PlayChannles, so when it executes the next line, you get an error. Right after it's loaded, test if Channle is null, and initialize it if you have to.

Im not quite sure what ur saying. I tryed if(Channle==null) then var/list/Channle = new/list(30) // List of Channles menu. But it didnt seem to work and brought up some errors.

ok sorry Me fixed I just added if(isnull(Channle)) and then the initialize. Dang Im stupid not to have seen it before. Sorry again and thanks