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
Duke Nukem 3D Savior Of Babes dev help "New mod for Eduke32 designed for mayhem and OP gameplay"
#1 Posted 15 July 2022 - 07:17 PM
#2 Posted 15 July 2022 - 07:58 PM
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.
#3 Posted 15 July 2022 - 09:09 PM
#4 Posted 15 July 2022 - 10:11 PM
VGames, on 15 July 2022 - 09:09 PM, said:
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
#5 Posted 15 July 2022 - 11:39 PM
#6 Posted 16 July 2022 - 03:14 PM
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?
#7 Posted 16 July 2022 - 04:17 PM
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.
#8 Posted 16 July 2022 - 04:36 PM
Danukem, on 16 July 2022 - 04:17 PM, said:
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
#9 Posted 16 July 2022 - 05:06 PM
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
#10 Posted 16 July 2022 - 05:39 PM
#11 Posted 16 July 2022 - 07:50 PM
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
#12 Posted 16 July 2022 - 11:02 PM
VGames, on 16 July 2022 - 07:50 PM, said:
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
#13 Posted 16 July 2022 - 11:05 PM
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
#15 Posted 16 July 2022 - 11:10 PM
Danukem, on 16 July 2022 - 11:06 PM, said:
I will for sure
#16 Posted 17 July 2022 - 01:23 PM
#17 Posted 17 July 2022 - 01:28 PM
#18 Posted 17 July 2022 - 02:13 PM
Danukem, on 17 July 2022 - 01:28 PM, said:
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.
#19 Posted 17 July 2022 - 03:44 PM
#20 Posted 17 July 2022 - 03:59 PM
Danukem, on 17 July 2022 - 03:44 PM, said:
OK I see what you're saying. I'll give it a try. Thanks again. This is coming along nicely.
#21 Posted 17 July 2022 - 04:34 PM
#22 Posted 17 July 2022 - 10:25 PM
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.
#24 Posted 10 August 2022 - 03:14 PM
#25 Posted 31 August 2022 - 04:34 AM
#26 Posted 02 September 2022 - 04:14 PM
Mark, on 31 August 2022 - 04:34 AM, said:
Thanks
#27 Posted 02 December 2022 - 06:34 AM
#28 Posted 02 December 2022 - 01:18 PM
VGames, on 02 December 2022 - 06:34 AM, said:
You can start a new thread.