DECORATE problem, GZDOOM g4.14.1

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!)
Post Reply
luckygreentiger
Posts: 5
Joined: Sun May 25, 2025 8:47 pm

DECORATE problem, GZDOOM g4.14.1

Post by luckygreentiger »

I have a mod that I created that has items spawn under certain conditions, but the items spawn, and then disappear as soon as they hit the ground, but sometimes one or two will stay. Is this a GZDoom issue or is this a DECORATE issue? here is my setup:

DECORATE
=============
#include "decorate/weapons.txt"
#include "decorate/items.txt"
#include "decorate/monsters.txt"
#include "decorate/players.txt"

WEAPONS
=============
actor Chainsaw2 : Chainsaw replaces Chainsaw {
Weapon.SlotNumber 1
States {
Fire:
SAWG AB 4 A_Saw("weapons/sawfull","weapons/sawhit",0,"ChainsawPuff")
SAWG B 0 A_ReFire
Goto Ready
}
}

actor ChainsawPuff : BulletPuff {DamageType Chainsaw}

ITEMS
=============
[FOR EXAMPLE, there are more objects]
actor AmmoRocketBonus : RocketAmmo {
Inventory.PickupMessage "Picked up some rockets."
Inventory.Amount 2
States {
Spawn:
RCKT A -1
Stop
}
}

MONSTERS
=============
// Former Human
actor ZombieMan2 : ZombieMan replaces ZombieMan {
DropItem "Clip", 0
Health 25
+MISSILEMORE
States {
Death:
POSS H 5 A_DropItem("Clip")
POSS I 5 A_Scream
POSS J 5 A_NoBlocking
POSS K 5
POSS L -1
Stop
Death.Chainsaw:
POSS H 5 {
A_SpawnItemEx("AmmoCellBonus",8,0,random(30,40), frandom(2,5),frandom(2,5),3,frandom(0,360));
A_SpawnItemEx("AmmoCellBonus",8,0,random(30,40), frandom(2,5),frandom(2,5),3,frandom(0,360));
A_SpawnItemEx("AmmoBulletBonus",8,0,random(30,40), frandom(2,5),frandom(2,5),3,frandom(0,360));
A_SpawnItemEx("AmmoBulletBonus",8,0,random(30,40), frandom(2,5),frandom(2,5),3,frandom(0,360));
A_SpawnItemEx("AmmoRocketBonus",8,0,random(30,40), frandom(2,5),frandom(2,5),3,frandom(0,360));
A_SpawnItemEx("AmmoRocketBonus",8,0,random(30,40), frandom(2,5),frandom(2,5),3,frandom(0,360));
A_SpawnItemEx("AmmoShellBonus",8,0,random(30,40), frandom(2,5),frandom(2,5),3,frandom(0,360));
A_SpawnItemEx("AmmoShellBonus",8,0,random(30,40), frandom(2,5),frandom(2,5),3,frandom(0,360));
}
POSS I 5 A_Scream
POSS J 5 A_NoBlocking
POSS K 5
POSS L -1
Stop
XDeath:
POSS M 5 {
A_DropItem("Clip");
A_SpawnItemEx("DropHealthBonus",8,0,random(30,40), frandom(2,5),frandom(2,5),3,frandom(0,360));
A_SpawnItemEx("DropHealthBonus",8,0,random(30,40), frandom(2,5),frandom(2,5),3,frandom(0,360));
A_SpawnItemEx("DropArmorBonus",8,0,random(30,40), frandom(2,5),frandom(2,5),3,frandom(0,360));
A_SpawnItemEx("DropArmorBonus",8,0,random(30,40), frandom(2,5),frandom(2,5),3,frandom(0,360));
}
POSS N 5 A_XScream
POSS O 5 A_NoBlocking
POSS PQRST 5
POSS U -1
Stop
}
}


...................

Any suggestions?
If I can find a previous version of GZDOOM I'll see if that works better, but not sure yet.
luckygreentiger
Posts: 5
Joined: Sun May 25, 2025 8:47 pm

Re: DECORATE problem, GZDOOM g4.14.1

Post by luckygreentiger »

Testing it it seems the items are spawning and landing underneath the floor.
I'm guessing this is probably a GZDOOM problem.
Anyone know a workaround?
luckygreentiger
Posts: 5
Joined: Sun May 25, 2025 8:47 pm

Re: DECORATE problem, GZDOOM g4.14.1

Post by luckygreentiger »

would an ACS script work better?
User avatar
Enjay
 
 
Posts: 27067
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: DECORATE problem, GZDOOM g4.14.1

Post by Enjay »

luckygreentiger wrote: Sun May 25, 2025 9:20 pm Testing it it seems the items are spawning and landing underneath the floor.
I'm guessing this is probably a GZDOOM problem.
Anyone know a workaround?
Have you created/included new sprites for your items?
If yes, have you given the sprites offsets?
If not, the sprites will be "underneath the floor".

This may help explain what I mean: viewtopic.php?t=56521
luckygreentiger
Posts: 5
Joined: Sun May 25, 2025 8:47 pm

Re: DECORATE problem, GZDOOM g4.14.1

Post by luckygreentiger »

well they are 16x16px for the drops
I gave the objects a radius of 8, and a height of 16
after some copilotness, it says I should offset it by defining it in TEXTURES
something like this:

Sprite ARMRA0, 16, 16 {
Offset 8, 8
Patch "ARMRA0", 0, 0
}

though that seems like it would center the sprite, so I guess the sprite offset would Offset 8, 16?
I'll check it tomorrow
thanks.
User avatar
Enjay
 
 
Posts: 27067
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: DECORATE problem, GZDOOM g4.14.1

Post by Enjay »

You don't need to do it in the TEXTURES lump (but you can). It is usually done directly in the sprite lump. The link I posted shows it being done in Slade (in an older version, but the principle is basically the same). And, yes, typical offsets for a symmetrical sprite are x=graphic width/2 y=graphic height but you may want a bit of adjustment to that to make it sit exactly how you want, depending on the specifics of the sprite.
luckygreentiger
Posts: 5
Joined: Sun May 25, 2025 8:47 pm

Re: DECORATE problem, GZDOOM g4.14.1

Post by luckygreentiger »

That worked! the offsets now have the graphics showing up correctly.
I'll have the pk3 upload probably on my itch page.
Post Reply

Return to “Scripting”