I think i messed up weapon offset...

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
XASSASSINX
Posts: 374
Joined: Tue Dec 20, 2016 4:53 pm
Location: MURICAA BROTHER! Just kidding, Brazil.

I think i messed up weapon offset...

Post by XASSASSINX »

So i'm making a weapon that summons a friendly skeleton, but then after some time, the weapon simply doens't appear anymore! Also i can't change to another weapon when i select it. This was after trying to use offset to make some sorta of recoil effect. I already tried using the Doom 2 shotgun sprite but it doens't work either! So that mean it's not the sprite problem. It's something else, in case you want: Here's the weapon code:

Code: Select all

Actor TheAncientSkeletonBook : Weapon 7512
{
  Inventory.PickupSound "misc/w_pkup" 
  Weapon.AmmoGive 12
  Weapon.AmmoUse 4
  Weapon.SlotPriority 0.1
  Weapon.AmmoType "DoomedSouls"
  Weapon.SlotNumber 8
  Weapon.SelectionOrder 750
  Inventory.PickupSound "misc/w_pkup" 
  Inventory.PickupMessage "Sweet! A magic dark book! I hope you know how to read..."
  +FloatBob
  States
  {
  Spawn:
    NCRO A -1 
    Loop
  Ready: 
    NECR A 1 A_WeaponReady 
    Loop
  Deselect: 
    NECR A 1 A_Lower 
    Loop
  Select: 
    NECR A 1 A_Raise 
    Loop
  Goto NoAmmo
    NECR A 4 A_SetBlend("Red", 1, 20)
	TNT1 A 0 A_XScream
	TNT1 A 0 A_SpawnItemEx("AncientBookNoAmmoDamage")
	Goto Ready
  Fire:
    TNT1 A 0 A_JumpIfInventory("DoomedSouls", 4, "TrueFire")
	Goto NoAmmo
	TrueFire:
	NECR A 30 A_Playsound("Weapons/Incant")
    NECR B 10
    NECR C 8
    NECR D 2
    NECR E 16 	 
	TNT1 A 0 A_SpawnItemEx("CustomFog")
    NECR A 0 A_Spawnitemex("FriendlyMrSpooky", random(-10, 10), random(-10, 10), random(-10, 10), 0, 0, 0, 0, SXF_SetMaster| SXF_NOCHECKPOSITION)
    NECR D 4
    NECR C 4
    NECR B 4
    NECR A 4
    Goto Ready
  }
}
User avatar
Mikk-
Posts: 2274
Joined: Tue Jun 30, 2009 1:31 pm
Location: Somewhere off Kanagawa

Re: I think i messed up weapon offset...

Post by Mikk- »

There's no NoAmmo state, perhaps that's why?
XASSASSINX
Posts: 374
Joined: Tue Dec 20, 2016 4:53 pm
Location: MURICAA BROTHER! Just kidding, Brazil.

Re: I think i messed up weapon offset...

Post by XASSASSINX »

Mikk- wrote:There's no NoAmmo state, perhaps that's why?
Well, There IS the no ammo state. But look at this thing: I just opened Slade after (i think) my PC shutted down by it's own. Now the file organization is fucked up! And the worse when i try for example to put a file up (CRTL+ D) it doens't work!

EDIT: Now i can press CRLT+D. Well, time to organize all my sprites again...

EDIT2: Well fixed the wad organization. Still not appearing the sprite and not being able to change the weapon while selecting it. the weird part is that i COULD use the weapon normally. But then from nowhere it stopped working.

EDIT3: Already fixed by making the code again.
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

Re: I think i messed up weapon offset...

Post by Nevander »

He meant that the code does Goto NoAmmo but that state was not in the actor states, so it screws up the weapon.
XASSASSINX
Posts: 374
Joined: Tue Dec 20, 2016 4:53 pm
Location: MURICAA BROTHER! Just kidding, Brazil.

Re: I think i messed up weapon offset...

Post by XASSASSINX »

Nevander wrote:He meant that the code does Goto NoAmmo but that state was not in the actor states, so it screws up the weapon.
yeah... But don't worry, fixed that a long time ago.

Return to “Scripting”