Jump to content

I need help with creating two entities


Recommended Posts

Hello, I'm about to announce a project I've been working on, a Doom Machinima. 

I've completed the script but not the entities. I need to create two, a Hostile entity and a friendly entity. 

I don't want the entities to be complex, for example, I want the first entity to behave like an Imp. But I don't want to replace anything in the base game. 

For the second entity, I don't want it to be able to attack, I just want it to be able to move around. 

I've never created custom enemies before, let alone friendly ones. So how would I go about doing that? How would I assign sprites, sounds, etc? 

 

Share this post


Link to post

It depends on whether you're working in something that is

 

• Vanilla-compatible (most restrictive)

• Limit-removing

• Boom format

• GZDoom/UDMF format (least restrictive)

Share this post


Link to post

Well, for the first one (something that behaves just like an Imp), take a look at this page: https://zdoom.org/wiki/Classes:DoomImp

 

If you scroll to the bottom, you can see the exact DECORATE definition of the regular Imp. If you just want to make an actor that behaves the same but looks different, all you need to do is create a DECORATE entry for your new entity, give it a different Actor name (so something instead of "DoomImp"), give it an ID number (this will go right after the Actor name and should be something in the 10000 or 20000 range just to be safe), and copy over the rest of the imp's DECORATE entry.

 

The parts of the DECORATE entry with the sprite names can be found in the "States" block, and they should be easily identifiable - it's everything where you see "TROO" in the definition. Whatever new sprites you use should have their own unique four-character identifier, and you'll replace "TROO" with those.

 

Hopefully this helps!

Share this post


Link to post

I've run into two interesting problems. For one, I can't get my sound effects working. I have the right audio files.

And I also can't get my sprites working. I've changed TROO but still nothing. 1940435337_SLADE7_10_20223_34_21PM.png.9dd7aabcc810b4ef8c52d110c67dd0fa.png

Share this post


Link to post

For the sounds to work, you'll need to define them - more detail here: https://zdoom.org/wiki/SNDINFO. It's simple, just think of a name for the sound so you know which sound it is and the put the name of the sound file behind it, like so:

image.png.1bec053bb5c5123899e4f73cde961345.png

 

You can also use the game's predefined sounds.

 

As for the sprites - if you're gonna use the sprites already present in the base game, you don't need to have them in your wad, but more detail is needed. What exactly does not work? Are there error messages? 

 

 

 

 

Edited by Rifleman

Share this post


Link to post

Alright. I screwed around with the SNDINFO file and I got my sound effects working. All except one, how do I change the attack sound of the Imp? I ask because the imp uses the same attack sound as a few other monsters and I don't want to overwrite anything. Oh, and also, what code should I remove to remove the imps melee attack? I really don't want to screw around with these bastards to create a melee animation.

image.png.b0535ff3f1d516d8fa67dc316dfddbcb.png

 

Share this post


Link to post
6 hours ago, Player T said:

Alright. I screwed around with the SNDINFO file and I got my sound effects working. All except one, how do I change the attack sound of the Imp? I ask because the imp uses the same attack sound as a few other monsters and I don't want to overwrite anything. Oh, and also, what code should I remove to remove the imps melee attack? I really don't want to screw around with these bastards to create a melee animation.

image.png.b0535ff3f1d516d8fa67dc316dfddbcb.png

 

Take a long look at imp's decorate and I bet you'll figure it yourself. If you want to remove melee attack from imp, you have to remove the "melee:" from imp definition.

Share this post


Link to post

The imp attack sound is a part of the A_TroopAttack function. If you replace it with the one below, there should be no sound. Or you can of course put your own sound in between the empty quotes at the end:

A_CustomComboAttack("DoomImpBall", 32, 3 * random(1, 8), "")

 

Put your sprites in your WAD and either name your new sprites the same as the old ones, or replace the TROO in their name with some other four letters and then do the same change in your DECORATE.

Share this post


Link to post
On 7/12/2022 at 8:59 AM, Rifleman said:
3 hours ago, ramon.dexter said:

name it the same as the sound for imp ranged attack,

 

That works well, at first, but it also replaces the attack sound for the imps and maybe even the Barons, knights, and cacodemons. That's why I'm trying to give it its own sound. 

Share this post


Link to post

It's the projectile's spawn sound. You'd have to define a new projectile actor.

 

By the way, if you ever want to quickly make a friendly version of a non-friendly monster, you can use the "summonfriend" console command.

Share this post


Link to post
7 minutes ago, Scypek2 said:

You'd have to define a new projectile actor.

 

 

Where should I start with that? 

Share this post


Link to post

Same way you define the monster. Since you're using the imp ball as a base, your actor could inherit from it like this:

ACTOR AlienBall : DoomImpBall
{
  SeeSound "alien/attack"
}

Of course, "alien/attack" has to be defined in SNDINFO. You said you already added some sounds, but just in case, it's:

 

alien/attack YOURNAME

where YOURNAME is the name of the actual sound lump you're adding to the wad. Then you can replace the attack function in the alien's actor definition with something like...

A_SpawnProjectile ("AlienBall")

Which additionally won't replace the projectile with the scratch attack like the imp's attack does.

Share this post


Link to post

It's the same as new actor you created above. Or you can use inheritance, where you don't need to copy all the text - the below example should work, just replace the parts in italics. It will be identical to Imp ball in all other ways.

ACTOR yourprojectilename DoomImpBall

{

    SeeSound "yoursoundhere

}

Edited by Rifleman

Share this post


Link to post

Just below your Alien actor should do the trick. Also you need to replace the A_TroopAttack in Missile state with A_SpawnProjectile ("AlienBall").

Share this post


Link to post

Should I add the sprites in? The game keeps crashing with this error message Script error, "Alien.wad:DECORATE" line 29:
Expected '(', got 'goto'. 

 

Or should I just name AlienBall to the name of the fireball sprites for this moment? 

 

EDIT you said the 

ACTOR yourprojectilename : DoomImpBall

{

    SeeSound "yoursoundhere" 

should go below the Alien actor.

 

Does that mean directly under the line? Or under the entire actor code? 

Edited by Player T

Share this post


Link to post

Here are the DECORATE and SNDINFO screenshots. I can't get the sound to work, with or without the tag. Am I defining the AlienBeam actor wrong? Or is there a different line of code I should add or change? To be crystal clear, I'm trying to give the Alien a unique sound for firing its blaster while not overwriting the sounds for the imps, barons, cacodemons, knights, etc. 

 

247265061_SLADE7_14_20221_38_24AM.png.6ab70b36e318e4757cb0457c49a99010.png464060804_SLADE7_14_20221_36_15AM.png.48b60e6b4b9c23bb6a0f5cd6b40690b8.png1349328349_SLADE7_14_20221_36_05AM.png.2f07cbb3d5aa3539e5bbc7c00c8bebe0.png

Share this post


Link to post

The sound used in the actor definition has to be the same as the one you defined in SNDINFO, so in this case "monster/ASHOT".

Share this post


Link to post

Heh, typical mistake when using .wad as a archive container, that could be completely avoided by using .pk3 and full file paths. 

https://zdoom.org/wiki/SNDINFO

So, the definition is following:

<sound name as referenced in game> <name of sound lump/full path to sound file in .pk3>

So, when you want to use the sound in game, you to reference it by the first string, not the second. The second string tells the engine what to look for.

 

Or you can simply name the sound the same as the sound lump, if the different names trouble you. 

Edited by ramon.dexter

Share this post


Link to post
9 hours ago, Scypek2 said:

The sound used in the actor definition has to be the same as the one you defined in SNDINFO, so in this case "monster/ASHOT".

It's still not working. 

Share this post


Link to post

Have you replaced the A_TroopAttack function in the Missile state? I can still see it in you last snap. 

 

 

Share this post


Link to post

Thank you! It worked. But we still have some other stuff left. So as for the sprites, I've only tried replacing TROO, but every TROO line has other characters at the end. A lot of my sprites have names like AS01A, so would I replace say TROO AB? with ASO 1A? Or would I have to name the sprite something else?  

SLADE 7_15_2022 4_44_44 PM.png

Edited by Player T

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
Reply to this topic...

×   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...