Reloading scripts
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Reloading scripts
I now how to make a clip type weapon reload after several shot but how do make a reloading script for somthing that is reloaded by loading each indivisual round into the gun(like a shotgun). Could some one enlighten mr on the subject?
- wildweasel
- Posts: 21706
- Joined: Tue Jul 15, 2003 7:33 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): A lot of them
- Graphics Processor: Not Listed
- Contact:
Re: Reloading scripts
Assuming your type of reload is the type that just loops, adding one bullet at a time until the weapon is full, the only difference between those is that there are animation frames within that sequence that have a duration greater than 0.
Re: Reloading scripts
I don't quite fallow youwildweasel wrote:Assuming your type of reload is the type that just loops, adding one bullet at a time until the weapon is full, the only difference between those is that there are animation frames within that sequence that have a duration greater than 0.

- TheDarkArchon
- Posts: 7656
- Joined: Sat Aug 07, 2004 5:14 am
- Location: Some cold place
Re: Reloading scripts
Something along the lines of this
Code: Select all
Reload:
BLRG A 0 A_JumpIfInventory("ClipAmmo",0,Ready)
BLRG A 0 A_JumpIfInventory("SpareAmmo",1,1)
Goto Ready
BLRG ABCD 4
ReloadLoop:
BLEG EFGH 6
BLEG H 0 A_GiveInventory("ClipAmmo",1)
BLEG H 0 A_TakeInventory("SpareAmmo",1)
BLEG H 0 A_JumpIfInventory("ClipAmmo",0,2)
BLEG H 0 A_JumpIfInventory("SpareAmmo",1,ReloadLoop)
BLEG IJKLMNOFUCKTHIS 3
Goto Ready
Re: Reloading scripts
TheDarkArchon wrote:Something along the lines of this
Code: Select all
Reload: BLRG A 0 A_JumpIfInventory("ClipAmmo",0,Ready) BLRG A 0 A_JumpIfInventory("SpareAmmo",1,1) Goto Ready BLRG ABCD 4 ReloadLoop: BLEG EFGH 6 BLEG H 0 A_GiveInventory("ClipAmmo",1) BLEG H 0 A_TakeInventory("SpareAmmo",1) BLEG H 0 A_JumpIfInventory("ClipAmmo",0,2) BLEG H 0 A_JumpIfInventory("SpareAmmo",1,ReloadLoop) BLEG IJKLMNOFUCKTHIS 3 Goto Ready
I was hoping to be able to modify thits code here to do that.
Code: Select all
ACTOR Berreta : DoomWeapon
}
Fire:
BERF A 0 a_GunFlash
BERF A 3 A_FireBullets(1, 2, 1, 9, "BulletPuff", 1)
BERT E 3
BERT E 0 A_FireCustomMissile("BulletCasing",0,0,1,4)
BERT B 3
BERT A 1 A_CheckForReload(12, "Rest")
BERR A 0 A_PlaySound("weapons/Preload")
BERR BCDF 5
BERR DF 5
BERR G 5 A_FireCustomMissile("EPTPISMAG",0,0,1,1)
BERR HI 5
BERR FDCB 5
BERT A 5 A_ResetReloadCounter
BERT A 5 A_ReFire
Goto Ready
Rest:
BERT A 1
BERT A 1 A_Refire
Goto Ready
- TheDarkArchon
- Posts: 7656
- Joined: Sat Aug 07, 2004 5:14 am
- Location: Some cold place
Re: Reloading scripts
Just repeat the animation the clip size amount of times
Re: Reloading scripts
I have been enlightened thankTheDarkArchon wrote:Just repeat the animation the clip size amount of times