Jump to content
  • 0

Making My Own Item part2


Ghost_Ellis

Question

Heyo,

still can't figure out how to turn the pixel art sprite I made into an object within doom. What I've got so far:

- DECORATE.txt File:

ACTOR NOTE1
{
Inventory.PickupSound "NoteGrab"
Inventory.PickupMessage "Note Aquired"
Inventory.Icon "NOTE1"
Scale 0.25
+NOGRAVITY

States
    {
Spawn:
NOTE1 -1

stop
    }
}

 

The Image:

NOTE1  Size: 774  Graphic(Doom)

 

The Sound Effect:

NOTEGRAB  Size: 16.05kb Sound (mp3)

 

~End Of List~

 

What Is It Doing?

Absolutely nothing. When I open my map with this .wad file, I see no DECORATE tab in the Things menu. 

 

I saw many people saying to find the MAPINFO Lump and then to locate the DoomED numbers, however, I can't find anything called MAPINFO in my slade wad file or in the maps wad itself.

 

What Should The Item Do?

The item once placed on the map, should look like a note floating just off the ground. When the player walks over the item, It should disappear(be picked up), play it's sound effect, and that is it. I plan on writing scripts for each instance of the note the player picks up, by using Hud Message and Camera scripts.

 

Now For My Questions:

1. Why is this not working?

2. What Do I Need To Do To Make It Work?

 

Extra Info:

I'm using the latest version of Slade 3.

I'm using Ultimate Doom Builder.

I'm using a DOOM2.wad to create the map, as UDB will not let me start making a map without it, however, I plan to remake all the required textures, and delete the original DOOM2.wad's maps, sfx, etc.

So far, the only way I've been able to see my or any other custom item work in UDB, has been by replacing the Chainsaw sprite with my note, and the Pickup sfx with my own. This doesn't work though, as the replaced pickup noise, means guns, health etc. have the rustling paper pickup sfx.

1.png

2.png

New WinRAR ZIP archive.zip

Share this post


Link to post

11 answers to this question

Recommended Posts

  • 0

I'm not too familiar with Decorate, but I've been swearing at ZScript for a little while now and they're not that dissimilar.

 

I think the problem may be your sprite name. NOTE1 will work absolutely fine for the inventory icon, but the sprites that appear in the level need to be named in a specific way:

xxxxy#

 

Here the xxxx is your unique sprite name (NOTE will be fine here), the # is a number and the y is another letter to indicate the frame. These don't necessarily need to be in any order, but it's normal to start with A and then go B, C, D, etc as per your animation frames.

 

For objects that look the same from any angle (such as most decorations and corpses, and things like ammo boxes and medikits) you use the number 0. That is, your sprite should be named NOTEA0.

Sprites with different facing directions use the numbers 1-8 to indicate which direction. You can also combine them (such as NOTEA2A7) to have the frame for direction 2 "mirrored" for direction 7. This means you only need five frames instead of eight, as three of them are automatically flipped.

 

When you set up your script, you don't reference the entire frame. You use NOTE A -1. The engine then automatically checks to see whether you have a 0 frame or a set of 1-8 direction frames. Don't use both for the same frame.

(This way, if you have, say, an imp on the screen, you don't need to specify the direction it's facing in the script. The engine just wants to know the sprite name and which frame it should be displaying; it'll pick the relevant direction based on what way the imp is facing on the screen.)

 

TLDR version:

Rename your file to NOTEA0.

Change the Decorate script to spawn frame NOTE A -1.

 

EDIT: I had my filenames backwards. Updated above to correct this (thanks Gez!).

Edited by Artinum
Had my letters/numbers transposed. Oops.

Share this post


Link to post
  • 0

Why would DECORATE appear in UDB? That's just a definitions file for the custom items.

 

You need to assign a DoomEd number to the new object in MAPINFO. Then UDB will list it in the Things menu in a custom group at the end of the regular ones.

Share this post


Link to post
  • 0
8 hours ago, Artinum said:

because thats where custom things and items appear so you can place them in udb? And i dont have a map info file anywhere

 

 

Share this post


Link to post
  • 0

Um, your focus is now to get the item to show up in UDB. But in order to function the inventory item requires inheritance. Without it your code will just crash im GZDoom.

 

Please, see at least:

https://zdoom.org/wiki/Classes:CustomInventory (the example at the end)

 

And as others have said: To show up in map editor the item needs a DoomEdNumber and a valid sprite name. Both in decorate and the image itself. NOTE1 is not valid.

Share this post


Link to post
  • 0
2 hours ago, Ghost_Ellis said:

because thats where custom things and items appear so you can place them in udb? And i dont have a map info file anywhere

 

I've never seen someone quote me as saying their own reply before. That's new.

 

DECORATE and ZScript are difficult things to understand and often baffle people even when they know what they're doing - and I'm not that great myself! You may be trying to bite off more than you can chew if you don't even know about MAPINFO.

 

Your DECORATE file defines all your custom actors - what sprites they use, how they behave, their health and speed and size and so on. But they won't appear in UDB unless you give them a reference that UDB can find, and it gets those references from MAPINFO. If you don't have a MAPINFO file, you can easily create one; these are really handy as they let you assign stuff like map names, whether jumping/crouching is allowed, what music a level starts with, what sky textures to use, even which order your maps go in. You don't need to call them MAP01 and so on that way.

 

I'm not going to go into detail on MAPINFO here as the Doom wiki has all the information you need and repeating it all here would make for a long post. The key takeaway, however, is that you can assign DoomEdNums to your custom actors in the MAPINFO file, which you can easily edit in something like SLADE, and then you'll find those listed in UDB at the end of the Things list. There'll be a "custom" block that lists them all.

 

 

Edited by Artinum

Share this post


Link to post
  • 0

You should read this
https://zdoom.org/wiki/Creating_non-interactive_decorations

and then this
https://zdoom.org/wiki/Creating_new_inventory_items
your object should probably inherit from Inventory unless it's doing something specific

your sprite name is also malformed, sprites need to have a very specific format in zdoom, you should, in addition to the above, read this
https://zdoom.org/wiki/Creating_new_sprite_graphics

Basically what I am seeing, possible reasons your item is not working:
-Your item does not have an editor number
-Your sprite name is not formatted correctly, which is in turn causing your DECORATE to not be formatted correctly
-There are no editor keys to tell UDB or whatever where to put it in the thing menu

You can fix all of the above and it will probably start showing up.

Edited by TheHambourgeois

Share this post


Link to post
  • 0
On jeudi 11 avril 2024 at 4:45 PM, Artinum said:

I think the problem may be your sprite name. NOTE1 will work absolutely fine for the inventory icon, but the sprites that appear in the level need to be named in a specific way:

xxxx#y

 

<snip>

 

TLDR version:

Rename your file to NOTE0A.

 

Good explanation, but wrong order, the frame character goes before the rotation angle, not after, so it'd be NOTEA0.

 

https://zdoom.org/wiki/Sprite

https://doomwiki.org/wiki/Sprite

 

 

Share this post


Link to post
  • 0
3 hours ago, Gez said:

 

Good explanation, but wrong order, the frame character goes before the rotation angle, not after, so it'd be NOTEA0.

 

 

Damn. Memory let me down...

I've updated the original post!

Edited by Artinum

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...