Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
everennui

Custom weapons...

Recommended Posts

I'm having a problem with my gun. I followed the tutorial at GunLabs and I've just used that code and modified it to - in theory - show my gun. A single frame called, "TSTGA0.png" From what I understand, the input for the frames can only be 4 Characters (Letters) long and the last two represent the frame letter (from A-Z) and the last number represent the angle. 0 = First person and would be used for all guns.

My DECORATE(.txt) is as follows:

ACTOR TestGun : Weapon replaces Chainsaw

{
AttackSound "weapons/pistol"
Inventory.PickupMessage "You got the MP18/I!"
Weapon.AmmoType "Ammo"
Weapon.AmmoUse 1
Weapon.SlotNumber 4
Weapon.AmmoGive 16
States
{
Spawn:
SHOT A -1
Stop
Ready:
TSTG A 0 A_WeaponReady
Loop
Select:
TSTG A 1 A_Raise
Loop
Deselect:
TSTG A 1 A_Lower
Loop
Fire:
TSTG A 1 A_FireBullets(0, 0, 1, 10, "BulletPuff", FBF_NORANDOM|FBF_USEAMMO)
TSTG A 0 Offset(0,40) 
TSTG A 1 Offset(0,48)
TSTG A 1 Offset(0,44)
TSTG A 1 Offset(0,40)
TSTG A 1 Offset(0,37)
TSTG A 1 Offset(0,35)
TSTG A 3
Goto Ready
Flash:
SHTF A 2 BRIGHT A_Light2
SHTF B 2 BRIGHT A_Light1
TNT1 A 1 A_Light0
Goto LightDone
}
}

This code is from GunLabs, "How to make your very first gun" (A tutorial that uses the resources that are included in Doom 2. You create a new Zip Archive and save it with the extension *.pk3*. Create a new Decorate file in the archive and give it the above code minus a few deviations.) and GunLabs tutorial, "New Sprites And How They Work For Guns" ... In these tutorials he uses two different programs (GraphicsGale and Irfanview)

So... I think that I'm not using the right color pallet or not converting it to a format Doom can read. One can use gimp and it looks like you are able to do it, but I'm lost on that step.

I know that my decorate file is working, because MAP01's Chainsaw is replaced with SHOTA0, but I am not able to pick it up. I can, "summon" it through the console, but again, I can't pick it up.

I found a file that Gez linked on a zdoom forum for Gimp and I placed it in the right file, but I don't really know what to do with this.

I tried converting the graphic in Slade3, but this made the gun go to grayscale and still didn't show up.

I'm missing a step somewhere and I'm not sure what it is.

If I replace all the instances of TSTG and replace it with SHTG (or whatever the Doom shotgun is) it will show the default doom shotgun.

I can't find any tutorials that use Gimp that explain it clear enough... for me.

Addendum:
The four characters that define a sprite for the engine do not have to all be letters (the health bonus for example is BON1) and the frames go further than just A-Z you can also use, "[" "\" and "]" (but these can evidently cause some kind of issue that I'm not full aware of).

I did create a .pk3 archive so as, "Scifista42" points out directories are used instead of sprite markers. This is accomplished by adding a directory in Slade3 which is rather intuitive, but may require some looking (Hint: It's an icon that looks like a folder.)) Name it, Sprites

This will create a new entry to your .pk3 file (a folder named, Sprites). Double click the folder to enter it. (You can go back by selecting the folder with the arrow in the top right of you current window/frame.

From the menu, select Archive > Import files (or Ctrl + Shift + I) and import your image.

Each frame will need to be saved with a new character (typically A-Z). Saving them sequentially in an ascending order is not required, but will make the animation process a lot easier.

Share this post


Link to post
everennui said:

Weapon.AmmoType "Ammo"
I am not able to pick it up. I can, "summon" it through the console, but again, I can't pick it up.

Give it a stock or custom ammo type inherited from Ammo, not "Ammo" itself.

everennui said:

So... I think that I'm not using the right color pallet or not converting it to a format Doom can read.

Did you put the sprites between sprite markers? http://zdoom.org/wiki/Namespace

everennui said:

I tried converting the graphic in Slade3, but this made the gun go to grayscale and still didn't show up.

That's just how it shows in SLADE3 because you didn't set Base Resource or Palette - https://www.doomworld.com/vb/post/1317441. Regardless of this, the graphic should show up correctly in the game anyway.

Share this post


Link to post
scifista42 said:

Give it a stock or custom ammo type inherited from Ammo, not "Ammo" itself.
Did you put the sprites between sprite markers? http://zdoom.org/wiki/Namespace
That's just how it shows in SLADE3 because you didn't set Base Resource or Palette - https://www.doomworld.com/vb/post/1317441. Regardless of this, the graphic should show up correctly in the game anyway.


1.) I did have it as clip, must have brain farted when I was monkeying with it. Did not solve my problem though.

2.) The sprite is between S_START and S_END (I'm going to try SS_START and SS_END right now. (Did not have an effect.)

3.) I will also check out that post. (In regards to the base resource... I'm using a copy of Doom2, right?) Also... when I select said copy of Doom, it's not showing an option for the color pallet.

The Slade3 Archive looks like this.

DECORATE
S_START
TSTGA0
S_END

Share this post


Link to post

If you are using a pk3 instead of a wad, don't use markers, use directories - see the "Namespace" wiki page. Your sprites should be in "sprites" directory.

Share this post


Link to post
everennui said:

My DECORATE(.txt) is as follows:

TSTG A 0 A_WeaponReady
Loop


That should be the problem, it should be at least 1 tic long.

TSTG A 1 A_WeaponReady
Loop
Along with what was said earlier.

Share this post


Link to post
YukiHerz said:

That should be the problem, it should be at least 1 tic long.

TSTG A 1 A_WeaponReady
Loop
Along with what was said earlier.

I might be wrong, but I think for weapon ready it should be -1 to make it infinite. Some of that code was fiddled around with in an attempt to get it to work... but I will try 1, too. ...haven't had a chance to really look at anything today.

Share this post


Link to post
everennui said:

I might be wrong, but I think for weapon ready it should be -1 to make it infinite.

WeaponReady needs to be called repeatedly in an infinite loop, to register when the player presses the fire button. Its duration should ideally be 1. Duration -1 would make the function called only once and then become useless, duration 0 would result in a crash, and greater durations than 1 would result in an erratic reaction time of the weapon.

Share this post


Link to post

Shit just got real!

Thank you soooooo much, Scifista42 (Again!) and YukiHerz.



Not the best gun ever made, but it looks cool to me.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×