Marine Holds Weapons?

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
LordBoarmont

Marine Holds Weapons?

Post by LordBoarmont »

Hello, I'm new here and new to the idea of posting in a forum, but I've been busy finding, playing, dissecting, and making wads for ZDoom, GZDoom and Skulltag for a while now (without distributing them).

I've been looking, but I haven't found anything that shows what weapon the Doom Marine is holding during the game. I understand that in solo gaming, this isn't really an issue, but my friends and I do a lot of DM and coop, and it would be nice to see what weapon I'm fighting alongside or against.

Is there any wad out there that displays what the marine is holding? I found wads with classes in it that show ONE weapon, but I couldn't find anything else.

So, I created a wad with a playable marine class whose sprite changes when holding each of the vanilla weapons. Everything is done in DECORATE so that no level scripting or changes are necessary. If there's nothing else out there that can do this, I suspect it could be useful to the community.

The DECORATE file is fairly complicated, but the coding is done. I just need to know how I should distribute this, or if I should even bother with it if there's something better out already.
User avatar
Unknown_Assassin
Posts: 2468
Joined: Wed Apr 12, 2006 5:17 pm
Location: Where dead carcasses lie
Contact:

Re: Marine Holds Weapons?

Post by Unknown_Assassin »

I don't think anyone have done this yet.
You'd probably be the first one.
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Marine Holds Weapons?

Post by Xaser »

Hmm, I was entertaining the idea of doing this myself, but it seems I've been beaten. ;)

By all means, pop up a thread in the Projects forum and put up a beta. It's a good place to start, as people will be able to bugtest the wad to make sure it's all ironed-out before release. I can see some big use coming from this on Skulltag.

Have you happened to check out Xim's marine sprites yet? It's possible those are the same ones you've used, but it's worth a look anyway just in case.
Sinfis
Posts: 40
Joined: Thu Oct 02, 2008 3:51 am
Location: Oulu, Finland

Re: Marine Holds Weapons?

Post by Sinfis »

I'm very excited about this, if you really got it work. :o I'm making a mod, which point of view is 3rd person, so it will be useful and important to have different sprite set for each weapon in solo gaming.
User avatar
Ryan Cordell
Posts: 4349
Joined: Sun Feb 06, 2005 6:39 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Capital of Explodistan

Re: Marine Holds Weapons?

Post by Ryan Cordell »

AFAIK, I and Daniel (ARSENAL and ARMAS series mod maker) have done such wads. However, I don't know what happened to mine. :?
It's pretty easy, actually.
Sinfis
Posts: 40
Joined: Thu Oct 02, 2008 3:51 am
Location: Oulu, Finland

Re: Marine Holds Weapons?

Post by Sinfis »

Well, could you tell me how is it done? I know it could be done with morphing, but it would be cool that the only coding happens in Decorate, like the starter of this topic said.
User avatar
Captain Ventris
Posts: 4608
Joined: Mon Jul 31, 2006 4:25 pm
Location: San Antonio, TX

Re: Marine Holds Weapons?

Post by Captain Ventris »

It is actually easy. Modify the default weapons to give a custom inventory item when selected, and to have it taken when deselected. Each of the Player's states checks for these items, and when it finds the item currently in possession, is jumps to the version of that state that has the correct graphics. I don't know if that's how he did it, and there could be much more efficient ways to do it.
User avatar
Ryan Cordell
Posts: 4349
Joined: Sun Feb 06, 2005 6:39 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Capital of Explodistan

Re: Marine Holds Weapons?

Post by Ryan Cordell »

And as far as I know, if you want to have it cut as short as possible, you can use just one dummy item with a large max amount (pertaining to the max. amount of weaponry you have.) and check for it in the Spawn (If you have standing frames) or See (Walking frames) states.

I could also try and define every number with it's own name to make it easier to know which amount of said item equals which weapon, but I'm not sure if that'd work.
Sinfis
Posts: 40
Joined: Thu Oct 02, 2008 3:51 am
Location: Oulu, Finland

Re: Marine Holds Weapons?

Post by Sinfis »

Mr. Green has already tried to do it like that, but there's an inexplicable bug.

The Decorate in his testwad looks like this:
Spoiler:
When the shotgun is selected, the See state is not working. It is just looping the PLA 3 A sprite in the Spawn state when the player is moving. That's the bug. :? However, Missile, Melee and Pain states are working fine.

Mr.Green's test wad can be downloaded here: http://www.sendspace.com/file/u866d2

A solution to that would be veeery nice. :)
User avatar
Xim
Posts: 2094
Joined: Fri Feb 20, 2009 2:46 pm
Location: somewhere with trees

Re: Marine Holds Weapons?

Post by Xim »

Code: Select all

Spawn:
PLA2 A 0 A_JumpIfInventory ("ShotgunThing",1,2)
PLA2 A 10
Loop
PLA3 A 10
Goto Spawn+4

Code: Select all

Spawn:
PLA2 A 0 A_JumpIfInventory ("ShotgunThing",1,"ShotgunSpawn")
PLA2 A 10
loop
ShotgunSpawn:
PLA3 A 10
loop
Haven't tested those ideas yet, but those are my shots in the dark.
Sinfis
Posts: 40
Joined: Thu Oct 02, 2008 3:51 am
Location: Oulu, Finland

Re: Marine Holds Weapons?

Post by Sinfis »

Didn't work. :( The first one just looped the sprites althought the player wasn't moving and the second one gave me the same result as was the original.

Thanks for the shots anyway. :)
Sinfis
Posts: 40
Joined: Thu Oct 02, 2008 3:51 am
Location: Oulu, Finland

Re: Marine Holds Weapons?

Post by Sinfis »

Omg, I did it!!! 8-)

Code: Select all

Spawn:
        //Here A_JumpIfInventory for a PistolThing, so it goes straight to PLA2-sprites when the game starts.
        PLA3 A 10
	PLA2 A 0 A_JumpIfInventory ("ShotgunThing",1,2)
	PLA2 A 10
	Goto Spawn+1
	PLA3 A 0
	Goto Spawn
    See:
       PLA2 A 0 A_JumpIfInventory ("ShotgunThing",1,5)
       PLA2 ABCD 4
       Goto Spawn+1
       PLA3 ABCD 4
       Goto Spawn
Last edited by Sinfis on Thu Apr 16, 2009 9:50 am, edited 2 times in total.
User avatar
Xim
Posts: 2094
Joined: Fri Feb 20, 2009 2:46 pm
Location: somewhere with trees

Re: Marine Holds Weapons?

Post by Xim »

Awesome, and now for all the other weapons. I got all the sprites collected together in the Helper Marines wad.
User avatar
Ryan Cordell
Posts: 4349
Joined: Sun Feb 06, 2005 6:39 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Capital of Explodistan

Re: Marine Holds Weapons?

Post by Ryan Cordell »

Alternatively, if you're too lazy to dabble with jumping via frames, you can just, say, use..

I tweaked your code to also be broken/fixed/bastardized/whatever, considering I found a particular flaw before.

Code: Select all

Spawn:
        //First frame of Spawn does NEVER, EVER allow for any action to work, except when it goes into loop.
        //So, this is why we introduce a "filler" frame, to not give a hernia to all those other poor action functions.
   PLA2 A 0
   PLA2 A 0 A_JumpIfInventory ("ShotgunThing",1,"Spawn.Shotgun")
   PLA2 A 10
   Goto Spawn+1
Spawn.Shotgun:
   PLA3 A 10
   Goto Spawn
See:
   PLA2 A 0 A_JumpIfInventory ("ShotgunThing",1,"See.Shotgun")
   PLA2 ABCD 4
   Goto Spawn+1
See.Shotgun:
   PLA3 ABCD 4
   Goto Spawn
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Re: Marine Holds Weapons?

Post by Ghastly »

Blade Nightflame wrote:First frame of Spawn does NEVER, EVER allow for any action to work, except when it goes into loop.
More accurately, functions on the first frame an actor exists are never executed. Better wait of explaining that.
Post Reply

Return to “General”