Player T Posted July 9, 2022 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? 1 Quote Share this post Link to post
SMG_Man Posted July 10, 2022 It depends on whether you're working in something that is • Vanilla-compatible (most restrictive) • Limit-removing • Boom format • GZDoom/UDMF format (least restrictive) 0 Quote Share this post Link to post
Player T Posted July 10, 2022 GZDoom/UDMF format. Preferably using Decorate. 0 Quote Share this post Link to post
SMG_Man Posted July 10, 2022 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! 0 Quote Share this post Link to post
Player T Posted July 10, 2022 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. 0 Quote Share this post Link to post
ramon.dexter Posted July 11, 2022 Okay, how do you expect you sprites to work, when there are none sprites between ss_start and ss_end? 0 Quote Share this post Link to post
Player T Posted July 11, 2022 I took out the sprites before taking the screenshot. My point is that the sprites didn't work at all. 0 Quote Share this post Link to post
Rifleman Posted July 11, 2022 (edited) 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: 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 July 11, 2022 by Rifleman 1 Quote Share this post Link to post
Player T Posted July 11, 2022 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. 0 Quote Share this post Link to post
ramon.dexter Posted July 12, 2022 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. 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. 0 Quote Share this post Link to post
Rifleman Posted July 12, 2022 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. 0 Quote Share this post Link to post
Player T Posted July 12, 2022 What about the sound of the imp throwing its fireball? That's the sound I'm trying to replace. 0 Quote Share this post Link to post
ramon.dexter Posted July 13, 2022 (edited) Find fitting sound, name it the same as the sound for imp ranged attack, done. Edited July 13, 2022 by ramon.dexter 0 Quote Share this post Link to post
Player T Posted July 13, 2022 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. 0 Quote Share this post Link to post
Scypek2 Posted July 13, 2022 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. 0 Quote Share this post Link to post
Player T Posted July 13, 2022 7 minutes ago, Scypek2 said: You'd have to define a new projectile actor. Where should I start with that? 0 Quote Share this post Link to post
Scypek2 Posted July 13, 2022 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. 2 Quote Share this post Link to post
Rifleman Posted July 13, 2022 (edited) 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 July 13, 2022 by Rifleman 0 Quote Share this post Link to post
Player T Posted July 13, 2022 Where should I add this stuff in the DECORATE file? 0 Quote Share this post Link to post
Rifleman Posted July 14, 2022 Just below your Alien actor should do the trick. Also you need to replace the A_TroopAttack in Missile state with A_SpawnProjectile ("AlienBall"). 0 Quote Share this post Link to post
Player T Posted July 14, 2022 (edited) 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 July 14, 2022 by Player T 0 Quote Share this post Link to post
ramon.dexter Posted July 14, 2022 When somebody tells to "put actor under actor", it means the whole actor definition. 0 Quote Share this post Link to post
Player T Posted July 14, 2022 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. 0 Quote Share this post Link to post
Scypek2 Posted July 14, 2022 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". 0 Quote Share this post Link to post
ramon.dexter Posted July 14, 2022 (edited) 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 July 14, 2022 by ramon.dexter 0 Quote Share this post Link to post
Player T Posted July 14, 2022 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. 0 Quote Share this post Link to post
Rifleman Posted July 15, 2022 Have you replaced the A_TroopAttack function in the Missile state? I can still see it in you last snap. 0 Quote Share this post Link to post
Player T Posted July 15, 2022 And I would replace it with A_CustomComboAttack("DoomImpBall", 32, 3 * random(1, 8), "")? 0 Quote Share this post Link to post
Rifleman Posted July 15, 2022 Better use what Scypek2 suggested: A_SpawnProjectile ("AlienBeam") 1 Quote Share this post Link to post
Player T Posted July 15, 2022 (edited) 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? Edited July 15, 2022 by Player T 0 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.