Duke4.net Forums: Duke Nukem 3D Savior Of Babes dev help - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Duke Nukem 3D Savior Of Babes dev help  "New mod for Eduke32 designed for mayhem and OP gameplay"

User is offline   VGames 

#1

Hello everybody I'm working on a mod for Eduke32 that's gonna be a complete OP experience with slaughtermap like gameplay. Anyways I'm pretty new to EDuke32 scripting and I need some help already. I've dabbled in Eduke 2.0 way back when but this is much more complex. Anyways I got this new chaingun that I want to use 10 frames for the firing animation. The gun shoots but it shoots rather slow. I'd like it to shoot much faster. I tried using the TOTALTIME command but setting it lower then 10 cuts off the firing animation. And when you stop shooting I can't get it to cycle through the rest of the shooting frames until it gets back to the idle frame. Some help would be much appreciated. Here's the code:


state draw_chaingun // CHAINGUN_WEAPON:
    // hud_temp4 = FIREDELAY

	stopactorsound THISACTOR CHAINGUN_FIRE

    state reset_hud_weapon_y_coordinate

    setvar hud_tilenum 5125 // MEAT GRINDER IDLE

    addvar hud_totaltime 1
    ifvarvarl weaponcount hud_totaltime
    {
        setvar hud_x 230 // 195-12
        addvarvar hud_x weapon_xoffset
        subvarvar hud_x looking_angSR1

        addvar hud_y 238

        ifvarl weaponcount 10
        	addvarvar hud_tilenum weaponcount

        setvar hud_orientation 2

        guniqhudid currentweapon

        state G_DrawWeaponTile

        guniqhudid 0
    }	
ends


1

User is online   Danukem 

  • Duke Plus Developer

#2

Instead of changing the totaltime for the chaingun, you might want to change WEAPON3_FLAGS.

https://wiki.eduke32...i/WEAPONx_FLAGS

Note that if you have it firing every other tic AND every third tic, then it is firing on most tics.
1

User is offline   VGames 

#3

I’ve tried messing around with the flags but it causes the gun to shoot very very slow and use only 1 round of ammo when it should be using 2 at a time. But I’ll give your flag idea a try by combining the 2 flags u mentioned.
1

User is online   Danukem 

  • Duke Plus Developer

#4

View PostVGames, on 15 July 2022 - 09:09 PM, said:

I’ve tried messing around with the flags but it causes the gun to shoot very very slow and use only 1 round of ammo when it should be using 2 at a time. But I’ll give your flag idea a try by combining the 2 flags u mentioned.


I'm saying you should combine those flags and leave the totaltime of the gun alone. If you reduce totaltime to a small number then the gun is constantly reseting to frame 1 and you don't get the benefit of the other flags.

the best flags setting is probably 8220 and leave the totaltime at 12

EDIT: also if you want it using 2 ammo per shot then set SHOTSPERBURST to 2 and add the flag for AMMOPERSHOT

This post has been edited by Danukem: 15 July 2022 - 10:15 PM

1

User is offline   VGames 

#5

I’ll try it out ASAP. Thanks for the tips. I’ll report back for sure.
1

User is offline   VGames 

#6

@Danukem Works great. Thanks for the help again.

I have another issue. I'm trying to get Explosion2 to create some new big smoke effects I made but when they're spawned they don't get removed after the last animation frame like they should. I use a similar smaller smoke effect for bullets and they work just fine. But if theyr'e spawned by Explosion2 it looks like more than just 1 is being spawned and they don't disappear after the last frame. They get removed after a set time which makes it look dumb. I also used the ifactioncount 1 and ifcount 1 commands to make sure only 1 smoke effect is being spawned and it doesn't help. Is something wrong with EXPLOSION2? I also tried using a state to spawn the effect and it does the same. I even made EXPLOSION2 spawn a user actor I made that simply spawns the smoke itself and then deletes itself. No change. Please help if possible.

One more question for now. Is there by chance a simple snippet of code that can be used somewhat universally to add a muzzle flash to any weapon?
1

User is online   Danukem 

  • Duke Plus Developer

#7

Honestly it sounds like there are mistakes in your code, definitely in your smoke actor and probably in the way you are spawning it too. I don't want to try to guess what your mistakes are without seeing your code.

I personally have never tried writing a universal muzzleflash display routine. Mainly because the look, positioning and timing of the muzzleflash is specific to each weapon.
1

User is offline   VGames 

#8

View PostDanukem, on 16 July 2022 - 04:17 PM, said:

Honestly it sounds like there are mistakes in your code, definitely in your smoke actor and probably in the way you are spawning it too. I don't want to try to guess what your mistakes are without seeing your code.

I personally have never tried writing a universal muzzleflash display routine. Mainly because the look, positioning and timing of the muzzleflash is specific to each weapon.


ok here's the code for explosion2


action EXPLOSION_FRAMES 0 20 1 1  4
actor EXPLOSION2 1 EXPLOSION_FRAMES
  ifactioncount 1
    spawn EXPLOSIONSMOKE1
  ifactioncount 2
    spawn EXPLOSIONSMOKE2
  ifactioncount 20
    killit
enda



And here's the code for the smoke effects


define EXPLOSIONSMOKE1 5192
define EXPLOSIONSMOKE2 5213

action EXPLOSIONSMOKE1FRAMES 0 21 1 1 10
actor EXPLOSIONSMOKE1 0 EXPLOSIONSMOKE1FRAMES
  sizeto 256 256
  sizeto 256 256
  sizeto 256 256
  cstat 2
  ifactioncount 21
    killit
enda

action EXPLOSIONSMOKE2FRAMES 0 21 1 1 10
actor EXPLOSIONSMOKE2 0 EXPLOSIONSMOKE2FRAMES
  sizeto 256 256
  cstat 2
  ifactioncount 21
    killit
enda



Thanks for the help. I think I'll just add the muzzle flashes to the sprites themselves the old fashioned way.

This post has been edited by VGames: 16 July 2022 - 04:37 PM

1

User is online   Danukem 

  • Duke Plus Developer

#9

Maximum size for a sprite is 255 255 (not 256). I don't know if that is causing a problem for you are not.

Your EXPLOSION2 is constantly spawning your smokes once it reaches actioncounts 1 and 2.

So here's a thing you don't understand: ifactioncount X is true as long as the actioncount is X **or greater**

You could use an "ifcount X+1 nullop else ifcount X spawn ___ " construction, you could have the EXPLOSION2 spawn your smokes when "ifmove 0" is true (and then give it a move!), or you could do it some other way using a gamevar
1

User is offline   VGames 

#10

I gotcha. I seem to be misunderstanding some of these variables. I’ll give it another go. Thanks buddy
1

User is offline   VGames 

#11

I used the gamevar method and it worked. Good idea.

The smoke is perfect now.

Is there any way to keep small smoke from spawning when u shoot enemies with bullet projectiles? I want the smoke to only appear when it hits walls and floors not enemies
1

User is online   Danukem 

  • Duke Plus Developer

#12

View PostVGames, on 16 July 2022 - 07:50 PM, said:

Is there any way to keep small smoke from spawning when u shoot enemies with bullet projectiles? I want the smoke to only appear when it hits walls and floors not enemies


Yes. Adding this code to the start of the SMALLSMOKE actor should make the smoke delete immediately when spawned in that situation.


actor SMALLSMOKE 0 SMOKEFRAMES

  ifspawnedby SHOTSPARK1
	ifn sprite[].owner -1
        ifn sprite[sprite[].owner].htg_t 8 -1
          killit


https://wiki.eduke32.com/wiki/Htg_t
1

User is offline   VGames 

#13

Very cool. Thanks for the code.

Are there any mods that have a shield generator alt fire mode like the one in Doom eternal that can be spawned by the chaingun? I’d like a feature like this if possible.

This post has been edited by VGames: 16 July 2022 - 11:09 PM

1

User is online   Danukem 

  • Duke Plus Developer

#14

Make sure you understand why it works, though.
1

User is offline   VGames 

#15

View PostDanukem, on 16 July 2022 - 11:06 PM, said:

Make sure you understand why it works, though.


I will for sure
1

User is offline   VGames 

#16

Ok so I added some new spark impact effects for bullets when they hit walls and floors because I wanted them to be more visible but now, I can see that they're showing up when enemies are hit by bullets too. I tried using the code above to remove the SMALLSMOKE when bullets hit enemies, but it didn't work for SHOTSPARK1. I'm missing something here.
1

User is online   Danukem 

  • Duke Plus Developer

#17

If the SHOTSPARK1 actor were already deleted by the time the SMALLSMOKE actor runs actor code, that would prevent the code I gave you from working. I wouldn't expect that result unless you have the shotsparks deleting early. It may be necessary to have the smoke turn itself invisible in EVENT_EGS when its being spawned by a shotspark that is hitting a sprite.
1

User is offline   VGames 

#18

View PostDanukem, on 17 July 2022 - 01:28 PM, said:

If the SHOTSPARK1 actor were already deleted by the time the SMALLSMOKE actor runs actor code, that would prevent the code I gave you from working. I wouldn't expect that result unless you have the shotsparks deleting early. It may be necessary to have the smoke turn itself invisible in EVENT_EGS when its being spawned by a shotspark that is hitting a sprite.


I think I may have worded what I said before wrong. The SMALLSMOKE goes away just fine. Now I want the default SHOTSPARK1 spark effects not to show up when bullets hit enemies just like the SMALLSMOKE you helped me with before.
1

User is online   Danukem 

  • Duke Plus Developer

#19

Then I would just make it turn invisible with cstat 32768 at the time it spawns in EVENT_EGS. In the actor code you then make it visible only if it's NOT hitting a sprite (refer to the htg data to verify). For the shotspark I do not recommend deleting it immediately since it is useful for various things.
1

User is offline   VGames 

#20

View PostDanukem, on 17 July 2022 - 03:44 PM, said:

Then I would just make it turn invisible with cstat 32768 at the time it spawns in EVENT_EGS. In the actor code you then make it visible only if it's NOT hitting a sprite (refer to the htg data to verify). For the shotspark I do not recommend deleting it immediately since it is useful for various things.


OK I see what you're saying. I'll give it a try. Thanks again. This is coming along nicely.
1

User is offline   VGames 

#21

Is there a way to detect if the floor is being shot? I can get the spark effects to show up when a wall is being shot but not a floor. And a check to see if a sector is hit causes the sparks to show up on enemies too.
1

User is online   Danukem 

  • Duke Plus Developer

#22

Yes. You can use the htg_t members in the SHOTSPARK1 actor and I already linked the wiki page above. There are numerous examples in various mods going back almost 20 years now.

Since this thread has really only been about code questions so far, I recommend that you start posting them in the neighboring EDuke32 Scripting thread to keep the forum more easily searchable.
1

User is offline   VGames 

#23

Ok I’ll do that. Thank u.
1

User is offline   VGames 

#24

What's the best way to go about converting an MP4 to an IVF video?
1

User is online   Mark 

#25

A command line program call FFMPEG. There are tutorials on Youtube for how to use it.
1

User is offline   VGames 

#26

View PostMark, on 31 August 2022 - 04:34 AM, said:

A command line program call FFMPEG. There are tutorials on Youtube for how to use it.


Thanks
1

User is offline   VGames 

#27

Could somebody delete this whole thread? I’m fixing to show off the mod and post pics and I’d like to start fresh.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #28

View PostVGames, on 02 December 2022 - 06:34 AM, said:

Could somebody delete this whole thread? I’m fixing to show off the mod and post pics and I’d like to start fresh.

You can start a new thread.
0

User is offline   VGames 

#29

Ok thanks for changing the title.
0

Share this topic:


Page 1 of 1
  • 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