when talking to NPC and try to buy the explosive tag tells me :
runtime error: Cannot create objects of type null.
proc name: DblClick (/mob/npc/Merchant2/DblClick)
usr: JAIDER (/mob)
src: Vendedor de Armas arrojadizas (/mob/npc/Merchant2)
call stack:
Vendedor de Armas arrojadizas (/mob/npc/Merchant2): DblClick(JAIDER (/mob))
JAIDER (/mob): HablarconF()
//-------------------------------------------//
this is the code of NPC
mob/npc
Merchant2
name = "Vendedor de Armas arrojadizas"
icon = 'waterwots.dmi'
icon_state="salesperson"
DblClick()
if(src in oview(2))
var/list/cosas
cosas = new/list()
cosas.Add(/obj/ExplodingTag)
var/list/cosas2=list()
for(var/F in cosas)
if(F==/obj/ExplodingTag)continue
var/obj/A=new F
A.dir=1
A.name="[A.name] - [A.price]"
cosas2+=A
var/obj/b=skinput(usr,"Que deseas comprar hoy?",options=cosas2,wait=6)
del cosas
del cosas2
if(!b)return
b.name=b.oname
if(b.name=="Sello Explosivo")
var/cuanto = skinwrite(usr,"Cuantos [b.name](s) quieres comprar?")//html
if(!cuanto)return
cuanto=text2num(cuanto)
if(!isnum(cuanto))
usr<<"Escribe solo numeros!"
return
if(usr.Yen >= cuanto*b.price&&cuanto>0)
var/contador=0
for(var/obj/ExplodingTag/Q in usr.contents)
if(Q.name==b.name)
contador+=1
if(b.name=="Sello Explosivo"&&contador>=20)
usr<<"Solo puedes tener 20 al mismo tiempo!"
return
if(b.name=="Bomba de Humo"&&contador>=20)
usr<<"Solo puedes tener 10 al mismo tiempo!"
return
usr.Yen -= cuanto*b.price
if(contador<=0)
var/obj/ExplodingTag/Q = "/obj/[b.name]"
Q=new Q
Q.loc = usr
Q.ammount+=cuanto
Q.name= "[Q.name] ([Q.ammount])"
goto com
else
for(var/obj/ExplodingTag/Q in usr.contents)
if(Q.name==b.name)
Q.ammount+=cuanto
Q.name= "[Q.name] ([Q.ammount])"
break
com
usr<<'monedas.ogg'
usr<<"Gracias por tu compra!"
usr.SaveT()
return
else
usr<<"No tienes suficiente dinero!"
return
and this is the code of obj:
obj
ExplodingTag
name = "Sello Explosivo"
oname = "Sello Explosivo"
icon = 'explodingtag.dmi'
worn = 0
price = 1000
verb
Poner_sello_explosivo()
if(usr.firing||usr.Frozen)
usr<<"No puedes hacer esto ahora"
return
if(usr.tagset>=5)
usr<<"Solo puedes tener equipados 5 a la vez."
return
if(!src.tagset)
var/obj/ExplodingTag/B = new/obj/ExplodingTag
B.loc = src.loc
B.Gowner=usr
B.tagset=1
usr.tagset+=1
B.icon_state="fire"
usr.verbs+= new /mob/tag/verb/Explode
for(var/obj/ExplodingTag/O in usr.contents)
O.ammount-=1
if(O.ammount<=0)
del(O)
else
src.name="[O.oname] ([O.ammount])"
usr.random=rand(1,3)
if(usr.random==3)
usr<<"Tu habilidad de trampas aumenta!"
usr.trapskill+=100
hope please help me as I'm about to go crazy ._.
var/obj/ExplodingTag/Q = "/obj/[b.name]"
translates to, with his next line:
Q = new "/obj/Sello Explosivo"
I doubt that's the intended way he wanted to do it, though. Which means he should be using the type variable instead.