[R] Weapon Bink
Moderator: Graf Zahl
- 
				Chronoteeth
														 - Posts: 824
 - Joined: Wed Jul 06, 2005 10:01
 
[R] Weapon Bink
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.
			
			
									
						
										
						- 
				TheDarkArchon
														 - Posts: 1000
 - Joined: Wed Jul 06, 2005 11:58
 - Location: What's that fucking smell
 
- 
				wildweasel
														 - DRD Team Admin (Inactive)
 - Posts: 2132
 - Joined: Wed Jun 29, 2005 22:00
 - Location: the Admincave!
 
- 
				Chronoteeth
														 - Posts: 824
 - Joined: Wed Jul 06, 2005 10:01
 
- 
				TheDarkArchon
														 - Posts: 1000
 - Joined: Wed Jul 06, 2005 11:58
 - Location: What's that fucking smell
 
- 
				Epoch
														 - Posts: 69
 - Joined: Sat Nov 05, 2005 14:38
 - Location: Somewhere
 
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)
			
			
									
						
										
						(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
- 
				wildweasel
														 - DRD Team Admin (Inactive)
 - Posts: 2132
 - Joined: Wed Jun 29, 2005 22:00
 - Location: the Admincave!
 
- 
				DoomRater
														 - Posts: 397
 - Joined: Tue Jul 19, 2005 4:14
 - Location: Programmer's Room, talking to Will Harvey
 
Not to mention that code is highly repetitive.  You could just jump over each Bink and such.
Of course, I changed the amount of accuracy a bunch... but the same idea applies.
			
			
									
						
										
						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 - 
				wildweasel
														 - DRD Team Admin (Inactive)
 - Posts: 2132
 - Joined: Wed Jun 29, 2005 22:00
 - Location: the Admincave!
 
- 
				DoomRater
														 - Posts: 397
 - Joined: Tue Jul 19, 2005 4:14
 - Location: Programmer's Room, talking to Will Harvey