[R] Weapon Bink

Moderator: Graf Zahl

Locked
User avatar
Chronoteeth
Posts: 824
Joined: Wed Jul 06, 2005 10:01

[R] Weapon Bink

Post by Chronoteeth »

A feature that I learned from soldat, though unfortinately I couldn't quite understand it. Either it was a weapons ability to gradually spread (Take a minigun, after continuous fire, the spread of the bullets slowly increase) or that hitscans were effected by gravity. My guess is choice A.
User avatar
TheDarkArchon
Posts: 1000
Joined: Wed Jul 06, 2005 11:58
Location: What's that fucking smell
Contact:

Post by TheDarkArchon »

It's the effect per shot on the accuracy of a weapon. For example, every shot of the minigun makes it slightly less accurate until it's very innaccurate.
User avatar
wildweasel
DRD Team Admin (Inactive)
Posts: 2132
Joined: Wed Jun 29, 2005 22:00
Location: the Admincave!
Contact:

Post by wildweasel »

So this would end up being a more realistic handling of refire inaccuracy?
User avatar
Chronoteeth
Posts: 824
Joined: Wed Jul 06, 2005 10:01

Post by Chronoteeth »

Exactly. This shoud be useable like maybe A_bink and then a set amount on how far to spread the attack?
User avatar
TheDarkArchon
Posts: 1000
Joined: Wed Jul 06, 2005 11:58
Location: What's that fucking smell
Contact:

Post by TheDarkArchon »

I'd make an argument of A_FireBullets et al.
User avatar
Epoch
Posts: 69
Joined: Sat Nov 05, 2005 14:38
Location: Somewhere

Post by Epoch »

This is actually really easy to do by simply giving the player an item every time the weapon is fired, and then using a state jump based on the quantity of the item. Then have the ready state slowly take the item away. A similar effect is often used to make weapons overheat, etc. It is inefficient, but it's also much easier than coding an extra parameter for the bullet attack.

(Note: this code is not guaranteed to work, it is simply an example)

Code: Select all

     Ready:  
        CHGG BA 3 A_WeaponReady 
        CHGG B 0 A_takeinventory("Bink",1)
        Loop
     Fire: 
        CHGG A 0 A_GunFlash
        CHGG A 0 A_Jumpifinventory("Bink",1,4)
        CHGG A 2 A_FireBullets(2,2,-1,6,0,1) 
        CHGG B 2 A_giveinventory("Bink",1)
        CHGF A 0 A_Refire
        GOTO Ready
        CHGG A 0 A_Jumpifinventory("Bink",2,4)
        CHGG A 2 A_FireBullets(3,3,-1,6,0,1) 
        CHGG B 2 A_giveinventory("Bink",1)
        CHGF A 0 A_Refire
        GOTO Ready
        CHGG A 0 A_Jumpifinventory("Bink",3,4)
        CHGG A 2 A_FireBullets(4,4,-1,6,0,1) 
        CHGG B 2 A_giveinventory("Bink",1)
        CHGF A 0 A_Refire
        GOTO Ready
        CHGG A 2 A_FireBullets(5,5,-1,6,0,1) 
        CHGG B 2 A_giveinventory("Bink",1)
        CHGF A 0 A_Refire
        GOTO Ready
User avatar
wildweasel
DRD Team Admin (Inactive)
Posts: 2132
Joined: Wed Jun 29, 2005 22:00
Location: the Admincave!
Contact:

Post by wildweasel »

Yes, but that's a very difficult workaround and makes the code unnecessarily messy - just like how DoomRater did it with his Glock.
User avatar
DoomRater
Posts: 397
Joined: Tue Jul 19, 2005 4:14
Location: Programmer's Room, talking to Will Harvey
Contact:

Post by DoomRater »

Not to mention that code is highly repetitive. You could just jump over each Bink and such.

Code: Select all

     Fire:
        CHGG A 0 A_GunFlash
        CHGG A 0 A_Jumpifinventory("Bink",1,2)
        CHGG A 2 A_FireBullets(2,2,-1,6,0,1)
        GOTO Fire + 8
        CHGG A 0 A_Jumpifinventory("Bink",3,2)
        CHGG A 2 A_FireBullets(3,3,-1,6,0,1)
        GOTO Fire + 8
        CHGG A 0 A_Jumpifinventory("Bink",8,2)
        CHGG A 2 A_FireBullets(4,4,-1,6,0,1)
        GOTO Fire + 8
        CHGG A 2 A_FireBullets(5,5,-1,6,0,1)
        //Fire + 8
        CHGG B 2 A_giveinventory("Bink",1)
        CHGF A 0 A_Refire
        GOTO Ready 
Of course, I changed the amount of accuracy a bunch... but the same idea applies.
User avatar
wildweasel
DRD Team Admin (Inactive)
Posts: 2132
Joined: Wed Jun 29, 2005 22:00
Location: the Admincave!
Contact:

Post by wildweasel »

It may use fewer lines, but DoomRater's example is actually a little more difficult to understand.

This is why I will never again make a reloading weapon in GZDoom.
User avatar
DoomRater
Posts: 397
Joined: Tue Jul 19, 2005 4:14
Location: Programmer's Room, talking to Will Harvey
Contact:

Post by DoomRater »

At least until custom lines come out, right weasel?

Yes, this method requires more math on the creator's part.
Locked

Return to “Closed Feature Suggestions”