Duke4.net Forums: Duke Nukem 3D making own weapons sprites - Duke4.net Forums

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Duke Nukem 3D making own weapons sprites  "Sprites tutorial"

User is offline   Nfsfan83 

#31

It was only test. I want replace and add some more in HRP or that I will be works with HRP.

But I need some tips:

1. How to set and where position of sprites on screen? like you see on M202 is a rest of N64 rpg (red light and some things on up)

2. I use png with my mode, open with gimp than export to png with transparent background, and change to 256 colors. Once it is works now in Duke I have black background. What's a problem?

I really need someone who can help me set this in all config files :(
0

User is offline   jimbob 

#32

for X and Y position you should use
setvar digx #
setvar digy #

with # being a coordinate, or rather it seems the amount of pixels, for instance for one of my weapons i use

setvar digx 145
setvar digy 237

for the default weapon pic, just mess with those settings under your state weapondisplay code.


heres a full piece of code for my weapon

state thompson_display
 switch weaponcount
  case 0 
   setvar digz 65536 // fullsize, no scaling
   setvar digx 145 // X position
   setvar digy 235 // Y position
   setvar picnum 2536 // tile number of the weapon
   setvar orientation 0 // no clue to be honest, used for flags i think, like Cstat etc
   state initweapondisplay 
   rotatesprite digx digy digz angvar picnum shade pal orientation 0 0 xdim ydim
  break

0

User is offline   Nfsfan83 

#33

Thanks jimbob for advice.

Still working on make better sprites:



So what I want to do. I want replace (adding more guns can be wait for later), replace only glock, chaingun and rpg with my models.

But, I test it my work on Duke64 mod and on this mod all sprites are in png in separate folder also I have many config files like texture.def or weapons.con. In HRP all textures also in png, 3D models textures also in png, but how to make that I will be have Duke sprites from duke.grp in png in separate folder?
0

#34

I can only suggest you to give a look to this topic: Here

Also, maybe you can try to ask on the Discord channel, some people are more active there than here.

0

#35

Hi nfsfan83, sorry for not having answered you in PMs about this, but at this point it is useful to tell these guidelines to the whole community:

0 - HRP will always use its models for weapons, indipendently from which 2d sprites you are using. To remove models and show 2d pictures like what you want, it is needed to remove some lines from one of the ".def" files in the HRP. We will eventually see this in future.

1 - Duke3d screen area is thought as a 320x200 space, for an old 4:3 monitor , indipendently from which resolution you are using. So you can use a 320x200 pixel rectangle for scaling and positioning the weapon sprites as you want.
A 5:4 monitor will use this 4:3 formula anyway, but not widescreen like 16:9 and 16:10. So if you are making these modifies not just for yourself, you HAVE to think it widescreen and work on something like 400x200 rectangle instead.
(It is important that 320/200 is not 4/3 indeed by math, but don't make questions because Duke3D works with that :P )

2 - Don't touch the code at the moment (i mean CON code), so you can only replace single arts slot you have in ART files.
You are right about 256 colors, but you need them only if you want the same Duke palette which has specified 256 colors. To make that, put your image in a software like ImageAnalyzer and import the palette from a proper .pal file.
Now you have two options:

2A- PNG method
Put a transparent background on your PNG. Then you use two methods: as a general "high-res" texture, with whatever size and colors you want, or if is exactly as an original sprite in the ART files, for which you need 256 colors in duke palette and NO semitransparent pixels at all (or Eduke will render bad colors and alpha channel).
For these two methods, there are two different .def commands: texture (with eventually dummytile for creating a blank space) and tilefromtexture. We will eventually see this in future, but https://wiki.eduke32...ry:DEF_commands you can start read from this.
Also off-centering PNGs as it's done in ART files can be done in def files.

2B- ART method
There are a bunch of software to work on ART files: EDITART (dos, to be used with DosBox eventually), DukeRes, BastART, and maybe i'm forgetting some other.
I use this method, but sure there are better: i put a solid color for background (not the purple), then i change the palette in ImageAnalyzer (it is mandatory in this case), then i copy the picture in the clipboard and paste on DukeRes in the proper ART file slot. Then i open in EDITART and make that solid color "transparent" by filling that area with the 252-0-252 purple you call in EDITART with backspace.
To offset the sprite, I press \ under escape key to offset the sprite in EDITART or use the arrow buttons in DukeRes.

Job done (IIRC :P)

Important:
me and other people surely saw you have a bad english, that you are approaching duke "modding" now , and that there is a sort of over-enthusiasm (great, but not so much).

But all these are not an excuse to behave like rude/asshole/kid as someone can percept, and be offended or bothered, misunderstandings apart. Good stay ;) :thumbup:

This post has been edited by RichardStorm: 09 December 2020 - 04:42 AM

2

User is offline   Nfsfan83 

#36

Yes I know, my english is sometimes hard to read but I try not to use google translator, but maybe I should ;)

Richard thanks for this tips.

Ok so what I can do:

1. I can do sprites in png format with transparent background like sprites in Duke 64 Mod.

This is best for me at now way to replace sprites.

2. You write biggest size of texture for sprites can be 320x200 or 400x200 (widescreen)

but if I use for example 320x200 sprite on game in 800x600 resolution, weapon sprite covers 1/3 of the screen, if I use size like original (96x92 - pistol sprites D64 mod) the edges are jagged and it looks ugly

https://i.imgur.com/jOjFdN3.png

Here is good looking DEagle animation gif 234x200

https://i.imgur.com/icnOufb.gif

So Is it any way to have sprite size 320x200 but how to set that game scales down or somthing?

2. So if HRP only use 3D wepons models can it possible to add another folder where they will be all original weapons sprites in PNG?

This post has been edited by Nfsfan83: 09 December 2020 - 05:48 AM

0

#37

Quote

You write biggest size of texture for sprites can be 320x200 or 400x200 (widescreen)


no, there is no maximum size... i meant that you use 320x200 as a reference to downscale your sprites, to see how they would result on screen... for example that Deagle would be be good in something like 100x100

Quote

So if HRP only use 3D wepons models can it possible to add another folder where they will be all original weapons sprites in PNG?


yes but is not needed... you first need to remove the line in the .def file that forces the use of HRP models.


You also have a few problem at proper reading english (where the hell are you from ? :P), anyway we try to explain as best as you can understand

This post has been edited by RichardStorm: 09 December 2020 - 06:02 AM

0

User is offline   Nfsfan83 

#38

But in game 100x100 looks ugly, I know is it also problem with model... M202 looks fine even in 160x140


I want HRP textures ( new levels textures , skybox), I know I can turn off 3D models (enemies and weapons) will be 2D but I want add my 2D for replace.

So only way to replace original sprites by new is replace they in duke3d.grp?

I would love replace HRP 3D weapons models by my, but this is more for me hard to do it.

I have all models in 3D with textures etc... but I understand you Guys are too busy...and have own works.

This post has been edited by Nfsfan83: 09 December 2020 - 06:13 AM

0

#39

100x100 was an example.

you can turn off models one by one in the def file of the HRP, then add in the HRP the line for whatever PNGyou want.

Adding 3d models for weapons for HUD is way difficult IIRC, i never tried... you have to convert them in MD3 and learn the whole DEF part for 3d models. Avoid that.

This post has been edited by RichardStorm: 09 December 2020 - 06:11 AM

0

User is offline   Nfsfan83 

#40

Convert to MD3 is a quick moment :) problem is set all animations frames etc and all "whole DEF part for 3d models." Right.

Richard tell me one thing in your mod:

https://forums.duke4...8-kickass-duke/

where you add new weapons? to main duke.grp files or to any folder?

This post has been edited by Nfsfan83: 09 December 2020 - 06:21 AM

0

#41

Quote

where you add new weapons? to main duke.grp files or to any folder?


It's not problem of GRP or folder.
I did by adding new sprites (some in PNGs, some in ART files) and sounds here and there, but with a MASSIVE code part as for quantity as for complexity. I wrote all weapons from scratch, as Duke has not a built-in weapon code.

Just. Forget. It. :P

This post has been edited by RichardStorm: 09 December 2020 - 06:30 AM

0

User is offline   Nfsfan83 

#42

I understand now why there are so few Duke mods that change original weapons. Only fFew people know how to do this. And only few know how to do this GOOD ;)

For Doom with Gzdoom there are many weapons mods (Brutal Doom and VietDoom for me are the best) and Doom engine is older but now still developed.

I will be still collect best 3D models... maybe in future I find someone to help...

This post has been edited by Nfsfan83: 09 December 2020 - 09:18 AM

0

User is offline   Nfsfan83 

#43

Minigun sprites animation, based on 3D model.

https://i.imgur.com/uw8eKNE.gif

And cool RPG from HL HD pack: with Nuke sign on lcd

https://i.imgur.com/aE6W5bu.gif

And Displacer Cannon, I love it how it is look ;)

https://i.imgur.com/WNpBWGu.gif

This post has been edited by Nfsfan83: 09 December 2020 - 11:32 AM

2

User is offline   Nfsfan83 

#44

I collect some models of real guns for my future projects. HL RPG HD has a little change on back. M202 need also better textures (with shine effect)

Remington 870 Police Magnum is one of my favourite shotgun since Turok Dinosaur Hunter


If you need something, jus ask ;)

https://i.imgur.com/W127vey.png

This post has been edited by Nfsfan83: 15 December 2020 - 10:49 AM

1

Share this topic:


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options