First time adding a custom item [Solved]

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!)
Spaceshiporion
Posts: 24
Joined: Sun Dec 03, 2023 6:58 pm

First time adding a custom item [Solved]

Post by Spaceshiporion »

I'm trying to figure out how to make custom pickup items with Slade3,
not very successful so far...

I looked up 2 tutorials, I really thought I was close.

Can anyone help me get this Garfield to work?
You do not have the required permissions to view the files attached to this post.
Last edited by Spaceshiporion on Tue Dec 12, 2023 5:07 am, edited 1 time in total.
Jarewill
 
 
Posts: 1787
Joined: Sun Jul 21, 2019 8:54 am

Re: First time adding a custom item

Post by Jarewill »

What you have to do is make your item inherit from the Inventory base class to count as an item.
Change this:

Code: Select all

Actor Garfield 10005
Into this:

Code: Select all

Actor Garfield : Inventory 10005
However the sprite will also not show for two reasons:
1) It's not between S_Start and S_End markers, so the engine won't load it as a sprite.
If you are using SLADE, make sure your sprite is located between those two markers:

You can create those markers in SLADE by pressing on the "New Entry" button and typing in the marker name:


And 2) Your sprite has no offsets defined, so it will show as buried in the ground.
When you preview your sprite in SLADE, at the bottom there should be a toolbar like this:

Select "Modify Offsets" and then select either "Monster" or "Monster (GL-friendly)" and accept and it should apply proper offsets automatically.
You can always tweak the offsets manually for your need as well.
Spaceshiporion
Posts: 24
Joined: Sun Dec 03, 2023 6:58 pm

Re: First time adding a custom item

Post by Spaceshiporion »

Thanks, man! I got it to work! And I also managed to figure out the scale property to make the item sized to my liking.

Return to “Scripting”