Dual wielding mutator (work in progress, need help)

Developer discussion of experimental fixes, changes, and improvements.

Moderators: Nexuiz Moderators, Moderators

Dual wielding mutator (work in progress, need help)

Postby MirceaKitsune » Wed Apr 15, 2009 5:14 pm

I spent my day trying to implement a fun mutator in Nexuiz which I played with in other games and who's idea I like: Dual weapon wielding. The purpose of this mutator is to allow each player to carry two weapons of the same type in each hand, allowing him / her to shoot twice faster.

So far I managed to implement this by half, but am reaching my limits in coding and require help to continue further. There are still a few things I did not add and a few bugs as well, although the basics should work. Also be warned the code is very messy and may be incorrect in many places due to my low knowledge in coding (basically I wrote whatever made what I wanted to work then optimized as far as I could understand). Here is a list of what I have and haven't got working so far and a few screenshots.

Stuff that works:

- The player is visually holding two weapons in each hand, both in 1st person and 3rd person mode.

- Muzzle flash works in 1st person for the second gun.

- When dual wielding is enabled, the firing rate is double for any weapon simulating the shooting of both guns.

- Colors and other powerup effects work correctly for the 2nd weapon, both in 1st person and 3rd person mode.

- (V1.11) Players drop both weapons upon death.

- (V1.4) Weapons with continuous firing (UZI, Hagar, Electro alt. fire, etc) now fire faster as well.

- (V2.0) Each weapon shoots (spawns the projectile) after the other one, not randomly like before.

- (V2.0) Muzzle flashes display only on the shooting weapon, not both.

- (V2.0) Correct console messages when picking up or dropping a dual weapon.


Stuff that doesn't work & bugs:

- After respawning several times, floating weapon models get attached all over the players. - Fixed (V1.2)

- Muzzle flash only works for the 2nd weapon in 3rd person mode occasionally. - Fixed (V1.3)

- The projectile still appears as exiting from the right side when shooting, so in 1st person mode you still see the right gun spawning the projectile and the left one just moving. - Fixed, the projectile is now randomly spawned from either the left or right gun (V1.3)

- When the mutator is enabled, the player dual wields every weapon as long as they have it rather then starting with a single weapon and dual wielding it once they pick that weapon up again. - Fixed by MrBougo, dual weapons must be earned now (V2.0)

- No animation if you pick up a dual weapon while holding its single version, you just see it appearing there.


Image

Image

Image

Image

Patch located here. I will try to work on everything else I can later tonight but as I said I need help from more knowledgeable coders in order to finish this correctly. I would like hearing opinions on this as well :)
Last edited by MirceaKitsune on Sun Jun 07, 2009 12:45 am, edited 11 times in total.
MirceaKitsune
Keyboard killer
 
Posts: 593
Joined: Thu Aug 14, 2008 6:48 am
Location: Romania - Bucharest

Postby FruitieX » Wed Apr 15, 2009 5:31 pm

- After picking up too many weapons, something in the code gets broken and weapon models start getting attached all over the players.

:D
FruitieX
Keyboard killer
 
Posts: 588
Joined: Mon Nov 13, 2006 4:47 pm
Location: Finland

Postby [-z-] » Wed Apr 15, 2009 5:36 pm

THIS


IS



AWESOME!!!!
[-z-]
Site Admin and Nexuiz Ninja
 
Posts: 1794
Joined: Mon Nov 13, 2006 12:20 am
Location: Florida

Postby Sepelio » Wed Apr 15, 2009 7:19 pm

Very nice. I'm looking forward to seeing how far you can take this, perhaps so I can wield a mortar and a nex and not have to switch weapons :twisted:
Possibly not the worst mapper in the world.

A blog of random pish:
http://xeno.planetnexuiz.com/blog/?author=5
Sepelio
Forum addon
 
Posts: 1101
Joined: Tue Jun 27, 2006 7:57 pm
Location: Scotland

Postby alpha » Wed Apr 15, 2009 7:59 pm

dual nex... did someone say balance?

anyway do it... cant wait for dual electro :P
quit for good
alpha
Alien trapper
 
Posts: 492
Joined: Tue Jun 17, 2008 7:18 pm

Postby MirceaKitsune » Wed Apr 15, 2009 8:19 pm

Thanks, I'm glad people like it :) As I said this is a bigger challenge for me since I haven't tried coding at this level until now, so any help would be very appreciated even if someone can just point out what I need to change in the code to improve or fix a certain issue.

Since Sepelio mentioned wielding two weapons of different types: I have thought about that but it would be a very difficult thing to do, not only because it would require heavy work to implement but also because you'd need 4 firing keys and 4 weapon switching keys instead of 2. I have an UT2004 mutator which allows holding weapons of different types in each hand, but firing and switching both individually is a nightmare, so I don't think wielding different types can be implemented or doable.
MirceaKitsune
Keyboard killer
 
Posts: 593
Joined: Thu Aug 14, 2008 6:48 am
Location: Romania - Bucharest

Postby uluyol901 » Wed Apr 15, 2009 9:04 pm

MirceaKitsune wrote:Thanks, I'm glad people like it :) As I said this is a bigger challenge for me since I haven't tried coding at this level until now, so any help would be very appreciated even if someone can just point out what I need to change in the code to improve or fix a certain issue.

Since Sepelio mentioned wielding two weapons of different types: I have thought about that but it would be a very difficult thing to do, not only because it would require heavy work to implement but also because you'd need 4 firing keys and 4 weapon switching keys instead of 2. I have an UT2004 mutator which allows holding weapons of different types in each hand, but firing and switching both individually is a nightmare, so I don't think wielding different types can be implemented or doable.

How about just press normally to shoot with primary gun (on the right?) and and do ctrl+press for the secondary gun?
uluyol901
Member
 
Posts: 16
Joined: Sun Jan 25, 2009 7:39 pm

Postby MirceaKitsune » Thu Apr 16, 2009 1:02 am

Updated patch to version 1.11. Optimized the code a bit and made the second weapon dropable (players now drop both weapons when they die unless Pinata is enabled). Also cut the bug where weapon models get stuck around players to half, though this issue still occurs when players die since their weapon models apparently get stuck to other players when they respawn (happens for both the 1st person and 3rd person weapon models).

This is currently the mutator's worst issue, so if anyone can figure out why these entities get randomly attached to players before me it would solve a big problem (spent 4 hours trying to but no success, can be reproduced by playing with bots). If anyone happens to find the solution please feel free to modify and reupload the patch or post what needs to be done in this topic.

uluyol901 wrote:How about just press normally to shoot with primary gun (on the right?) and and do ctrl+press for the secondary gun?


That would be a good idea, once and if someone with experience tries to make such a thing separately someday (this would kill me in a few minutes :D )
MirceaKitsune
Keyboard killer
 
Posts: 593
Joined: Thu Aug 14, 2008 6:48 am
Location: Romania - Bucharest

Postby Darcshadow7 » Thu Apr 16, 2009 3:14 pm

WOAH! I cant believe i didnt see this thread! My friend Ranger will totall love this! :shock:
http://www.odf-online.org/ Home to Flight Back, D321GO!, and other Descent related projects, all open source!
Darcshadow7
Alien
 
Posts: 168
Joined: Fri Feb 13, 2009 4:34 pm
Location: Peoria, Arizona

Postby C.Brutail » Thu Apr 16, 2009 4:45 pm

Hehe, nice fun mod :)
"One should strive to achieve; not sit in bitter regret."
WE ARE NEXUIZ.
Image
Image
C.Brutail
Laidback mapper
 
Posts: 2357
Joined: Tue Feb 28, 2006 7:26 pm
Location: Ironforge

Next

Return to Nexuiz - Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron