Gun sprite isn't showing
Posted: Tue Oct 11, 2016 3:34 pm
So I tried to add in a new gun in my personal little server, I made sprites for its icon state and item state.
http://i.imgur.com/5lwm6C2.png
http://i.imgur.com/Nys0CjH.png
http://i.imgur.com/uhfB72P.png
Then I copied pasta the sniper's code for gun because I wanted players to aim down while using the AK54:
http://i.imgur.com/KfffbQJ.png
// AK54 //
/obj/item/weapon/gun/projectile/automatic/AK54
name = "AK54 Rifle"
desc = "Ten years old Kashlanikov model, cheap but reliable"
icon_state = "AK54"
item_state = "AK54"
mag_type = /obj/item/ammo_box/magazine/wt550m9
burst_size = 0
fire_sound = 'sound/weapons/ak47_01.ogg'
origin_tech = "combat=7"
can_unsuppress = 1
can_suppress = 1
zoomable = TRUE
zoom_amt = 7 //Long range, enough to see in front of you, but no tiles behind you.
actions_types = list()
/obj/item/weapon/gun/projectile/automatic/AK54/update_icon()
if(magazine)
icon_state = "AK54-e"
else
icon_state = "AK54"
But after compiling everything and running the game, when I spawn an AK54, there's no icon sprite, only item sprite.
http://i.imgur.com/ATMGKvP.png
http://i.imgur.com/d1rUfOT.png
Where did I go wrong in the code ? Is there a fix to this ?
Also, sorry for the urls instead of Img BBcode, it kept showing the error message "unable to determine image dimension" whenever I use [img] BBcode
http://i.imgur.com/5lwm6C2.png
http://i.imgur.com/Nys0CjH.png
http://i.imgur.com/uhfB72P.png
Then I copied pasta the sniper's code for gun because I wanted players to aim down while using the AK54:
http://i.imgur.com/KfffbQJ.png
// AK54 //
/obj/item/weapon/gun/projectile/automatic/AK54
name = "AK54 Rifle"
desc = "Ten years old Kashlanikov model, cheap but reliable"
icon_state = "AK54"
item_state = "AK54"
mag_type = /obj/item/ammo_box/magazine/wt550m9
burst_size = 0
fire_sound = 'sound/weapons/ak47_01.ogg'
origin_tech = "combat=7"
can_unsuppress = 1
can_suppress = 1
zoomable = TRUE
zoom_amt = 7 //Long range, enough to see in front of you, but no tiles behind you.
actions_types = list()
/obj/item/weapon/gun/projectile/automatic/AK54/update_icon()
if(magazine)
icon_state = "AK54-e"
else
icon_state = "AK54"
But after compiling everything and running the game, when I spawn an AK54, there's no icon sprite, only item sprite.
http://i.imgur.com/ATMGKvP.png
http://i.imgur.com/d1rUfOT.png
Where did I go wrong in the code ? Is there a fix to this ?
Also, sorry for the urls instead of Img BBcode, it kept showing the error message "unable to determine image dimension" whenever I use [img] BBcode