Reloading scripts

Archive of the old editing forum
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.
Locked
User avatar
WWII44
Posts: 169
Joined: Thu Nov 25, 2010 5:32 pm

Reloading scripts

Post by WWII44 »

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?
User avatar
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

Post by wildweasel »

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.
User avatar
WWII44
Posts: 169
Joined: Thu Nov 25, 2010 5:32 pm

Re: Reloading scripts

Post by WWII44 »

wildweasel 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.
I don't quite fallow you :|
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Re: Reloading scripts

Post by TheDarkArchon »

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
User avatar
WWII44
Posts: 169
Joined: Thu Nov 25, 2010 5:32 pm

Re: Reloading scripts

Post by WWII44 »

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
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Re: Reloading scripts

Post by TheDarkArchon »

Just repeat the animation the clip size amount of times
User avatar
WWII44
Posts: 169
Joined: Thu Nov 25, 2010 5:32 pm

Re: Reloading scripts

Post by WWII44 »

TheDarkArchon wrote:Just repeat the animation the clip size amount of times
I have been enlightened thank
Locked

Return to “Editing (Archive)”