header general

How to make a range gun available only in berserk

  • CaptainManiac
  • CaptainManiac's Avatar Topic Author
  • Cacodemon
  • Cacodemon
More
8 years 10 months ago #1 by CaptainManiac
I am making a shotgun that shoots blasts of hellfire,but i want it to be available only in berserk mode(need berserk power to get the weapon ready,even if it is picked up).When i put the jumpifinventory actor function to make the gun ready only if the player has berserk power and because of that,an error named "sprite names must be exactly 4".I have 2 sprites for the ready animation.How to fix that?

Please Log in or Create an account to join the conversation.

  • Blue Shadow
  • Blue Shadow's Avatar
  • Administrator
  • Administrator
More
8 years 10 months ago #2 by Blue Shadow
Replied by Blue Shadow on topic How to make a range gun available only in berserk
Post your code so we can see what's wrong.

Please Log in or Create an account to join the conversation.

  • CaptainManiac
  • CaptainManiac's Avatar Topic Author
  • Cacodemon
  • Cacodemon
More
8 years 10 months ago #3 by CaptainManiac
Replied by CaptainManiac on topic How to make a range gun available only in berserk
Code:
ACTOR HellFireSG : Shotgun //2405 { Tag "HellFire Shotgun" +FLOORCLIP +NOGRAVITY +WEAPON.EXPLOSIVE +Weapon.AMMO_OPTIONAL +Weapon.DONTBOB +WEAPON.NOAUTOAIM Weapon.SelectionOrder 3000 Weapon.SlotNumber 3 //AttackSound "weapons/hfsgblast" //Inventory.Pickupsound "misc/hfsgpickup" Inventory.PickupMessage "You got the Hellfire shotgun.Liquidise with Hellfire!" Obituary "%k was liquidised by HellFire Shotgun" Scale 0.3 States { Spawn: HFSG ABC 8 BRIGHT Loop Ready: HFSG DE 2 A_WeaponReady loop } }
i wanted in the spawn state to be a_jumpifinventory("Powerstrenght",1,"Ready"),but it gave me that error and i deleted it

Please Log in or Create an account to join the conversation.

  • Blue Shadow
  • Blue Shadow's Avatar
  • Administrator
  • Administrator
More
8 years 10 months ago #4 by Blue Shadow
Replied by Blue Shadow on topic How to make a range gun available only in berserk
Post the erroneous code. I don't see any A_JumpIfInventory calls there.

Please Log in or Create an account to join the conversation.

  • MagicWazard
  • MagicWazard's Avatar
  • Moderator
  • Moderator
More
8 years 10 months ago - 8 years 10 months ago #5 by MagicWazard
Replied by MagicWazard on topic How to make a range gun available only in berserk

CaptainManiac wrote: i wanted in the spawn state to be a_jumpifinventory("Powerstrenght",1,"Ready"),but it gave me that error and i deleted it

That could be a problem right there. "Spawn" is the state in which the item exists in the game world to be picked up. At this point, the item isn't in the player's inventory, so checking the player's inventory for "PowerStrength" at that time wouldn't be meaningful--it'll never find it. You also misspelled "PowerStrength" in the excerpt above, which could also give you trouble if the misspelling was also in the original code. What you probably want to do is put the A_JumpIfInventory into the "Ready" state itself, and then make a similar state ("Berserk"? "Powered"?) that contains the weapon attack and readiness check. Something like so:
Code:
States { Spawn: HFSG ABC 8 BRIGHT Loop Ready: HFSG DE 2 A_JumpIfInventory("PowerStrength", 1, "Powered") //no attack function OR weapon readiness in this state loop Powered: HFSG DE 2 A_WeaponReady //attack function here loop } }

Bear in mind that I haven't tested this to see if it's airtight, but it gets the general point across.
Last edit: 8 years 10 months ago by MagicWazard.

Please Log in or Create an account to join the conversation.

  • CaptainManiac
  • CaptainManiac's Avatar Topic Author
  • Cacodemon
  • Cacodemon
More
8 years 10 months ago - 8 years 10 months ago #6 by CaptainManiac
Replied by CaptainManiac on topic How to make a range gun available only in berserk
Then i need to repair my sprites for ready or at least to put it in the powered mode,cus i put flame things on the ready animation to indicate that the weapon is active.YOU WILL SEE MY CRAP NOW.I CAN'T DRAW CORRECTLY AND BECAUSE OF THAT WEAPON WILL BE SIMILAR TO A JOKE WEAPON THAN LIKE A SAWED-OFF HELLISH SHOTGUN THAT FIREC CUSTOM SHOOTABLE BLASTS OF HELLFIRE.LOOK
PS:Sorry for the late reply,but yesterday was evening in my region and i was made to go to bed and today there was a work to do.
Last edit: 8 years 10 months ago by CaptainManiac. Reason: I missed something

Please Log in or Create an account to join the conversation.

  • CaptainManiac
  • CaptainManiac's Avatar Topic Author
  • Cacodemon
  • Cacodemon
More
8 years 10 months ago #7 by CaptainManiac
Replied by CaptainManiac on topic How to make a range gun available only in berserk
Thanks you

Please Log in or Create an account to join the conversation.