hardcore_gamer Posted December 15, 2018 So I decided to have a go at coding my own custom weapon from scratch rather than just copy/pasting other peoples code. I get 2 errors though. The first problem is that gzdoom builder complains about missing sprites even though I put them into the sprites folder and I don't understand why. The second problem is that when gzdoom runs it complains about weapon selection order being an unknown property which is odd since the zdoom wiki says it's a real one. Screenshots in spoiled below. What is causing the errors? Spoiler 0 Share this post Link to post
-TDRR- Posted December 16, 2018 Your weapon doesn't inherit from the weapon actor itself. You need to do: "Actor testgun : Weapon 11004" Otherwise your code seems fine. 0 Share this post Link to post
hardcore_gamer Posted December 16, 2018 1 hour ago, -TDRR- said: Your weapon doesn't inherit from the weapon actor itself. You need to do: "Actor testgun : Weapon 11004" Otherwise your code seems fine. Tried that and I just got this error: "DECORATE warning in "simpleweapon.pk3\decorate", line 35. Unable to find "Weapon" class to inherit from, while parsing "testgun:11004"." 0 Share this post Link to post
-TDRR- Posted December 16, 2018 (edited) 24 minutes ago, hardcore_gamer said: Tried that and I just got this error: "DECORATE warning in "simpleweapon.pk3\decorate", line 35. Unable to find "Weapon" class to inherit from, while parsing "testgun:11004"." Send me the PK3 file, i really don't know what is going on with that weapon. EDIT: Your version of GZDoom is outdated, update to the latest one just in case. 0 Share this post Link to post
Nevander Posted December 16, 2018 Two issues I can see right away... as said you need to at least inherit from Weapon base class. Secondly, you are missing Loop on Select and Deselect. 0 Share this post Link to post
hardcore_gamer Posted December 16, 2018 4 minutes ago, Nevander said: Two issues I can see right away... as said you need to at least inherit from Weapon base class. Secondly, you are missing Loop on Select and Deselect. 50 minutes ago, -TDRR- said: Send me the PK3 file, i really don't know what is going on with that weapon. EDIT: Your version of GZDoom is outdated, update to the latest one just in case. I am using gzdoom 3.6 I think and I still get these errors. I added the loop to select and deselect and I still get errors. I have uploaded the pk3 simpleweapon.zip 0 Share this post Link to post
-TDRR- Posted December 16, 2018 Your GZDoom installation must be busted, works perfectly fine in my GZDoom 1.8.6 install. One thing though, it's not FIR2AO, it's a zero, so it would be FIR2A0. That is why GZDoom Builder had those errors. 0 Share this post Link to post
hardcore_gamer Posted December 16, 2018 14 hours ago, -TDRR- said: Your GZDoom installation must be busted, works perfectly fine in my GZDoom 1.8.6 install. One thing though, it's not FIR2AO, it's a zero, so it would be FIR2A0. That is why GZDoom Builder had those errors. I changed the O's to 0's and now at least I don't get the sprite error. But I still get the "DECORATE warning in "simpleweapon.pk3\decorate", line 37. Unable to find "Weapon" class to inherit from, while parsing "testgun:11004"." error which can't have anything to do with gzdoom because this happens inside of Gzdoom builder rather than gzdoom of which I am using a very recent version. 0 Share this post Link to post
-TDRR- Posted December 16, 2018 30 minutes ago, hardcore_gamer said: I changed the O's to 0's and now at least I don't get the sprite error. But I still get the "DECORATE warning in "simpleweapon.pk3\decorate", line 37. Unable to find "Weapon" class to inherit from, while parsing "testgun:11004"." error which can't have anything to do with gzdoom because this happens inside of Gzdoom builder rather than gzdoom of which I am using a very recent version. You just ignore that, it won't affect mapping at all. 0 Share this post Link to post
hardcore_gamer Posted December 16, 2018 (edited) 7 minutes ago, -TDRR- said: You just ignore that, it won't affect mapping at all. Yea it does. It won't even run and I am using gzdoom 3.60 which I believe is the latest version. I just get this error: Execution could not continue. Script error, "simpleweapon.pk3:decorate" line 6: '@property@weapon.selectionorder' is an unknown actor property After changing the O's to 0's I did get rid of the sprite errors as I said, but for some reason both Gzdoom builder as well as Gzdoom complain about unknown classes and properties. EDIT: Never mind I deleted the : weapon from the decorate code by mistake. I still have some other problems that are unrelated but I think I can fix those unless I state otherwise. EDIT 2: For some reason nothing happens when I press the fire button and I can't change weapons after I pick up the gun. 0 Share this post Link to post
-TDRR- Posted December 16, 2018 31 minutes ago, hardcore_gamer said: Yea it does. It won't even run and I am using gzdoom 3.60 which I believe is the latest version. I just get this error: Execution could not continue. Script error, "simpleweapon.pk3:decorate" line 6: '@property@weapon.selectionorder' is an unknown actor property After changing the O's to 0's I did get rid of the sprite errors as I said, but for some reason both Gzdoom builder as well as Gzdoom complain about unknown classes and properties. Make sure you are doing "testgun : weapon" and reinstall GZDoom, because it's running fine on my PC. 0 Share this post Link to post
hardcore_gamer Posted December 16, 2018 13 minutes ago, -TDRR- said: Make sure you are doing "testgun : weapon" and reinstall GZDoom, because it's running fine on my PC. I still get the error and the weapon doesn't fire in-game or let me switch weapons. What version of Gzdoom are you using? 0 Share this post Link to post
-TDRR- Posted December 16, 2018 (edited) Tested in 1.8.6 and 3.6.0. You forgot the A_WeaponReady codepointer in the Ready state. Read one of wildweasel's tutorials at http://gunlabs.blogspot.com/ 0 Share this post Link to post
hardcore_gamer Posted December 16, 2018 1 minute ago, -TDRR- said: Tested in 1.8.6 and 3.6.0. You forgot the A_WeaponReady codepointer in the Ready state. And now my computer explod.....just kidding it worked now! I love it how sometimes it's just little things like these that can break everything....... 0 Share this post Link to post