obj
clickable
equip
icon='visual.dmi'
icon_state="equip"
Click()
world<<"1"
var/templist[]=new
for(var/n in usr.weapons)
world<<n
templist+=n
world<<templist
var/q=input("Select from your weapons.") in templist
usr.selected_weapon=q
var/obj/gun/w=new usr.selected_weapon()
w.equip(usr)
Problem description:
The general idea is just to select an item from a type path to use. I hope the code explains it better than I do. Sorry for the spam of questions, this is the last for the night; promise! :p
This is the gun procedure:
obj
gun
var
bullet_type
proc
equip(mob/m)
m.equipped=1
m.selected_weapon=src
dequip(mob/m)
if(!m.equipped)
return
m.selected_weapon=null
pistol
icon='gun.dmi'
icon_state="pistol"
bullet_type=/obj/bullet/pistol
save the type thing as a string
"/obj/bullet/pistol"
and then you can used text2path to return it at a later time.
(maybe when your creating bullets)