Hi!
As title says I want to remake the monkey bomb from CoD Zombies, there is a way to code the behavior of the monsters and make them go close to it? I've already done a very basic code of the bomb that play the music and, after a bunch of seconds, it explodes...
For an easy reference I was thinking about the core in some levels from the Stronghold mod
Make an item that attracts monsters
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!)
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!)
-
- Posts: 26
- Joined: Wed Feb 22, 2012 10:12 am
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Italy
-
-
- Posts: 667
- Joined: Wed Aug 02, 2017 12:31 am
- Location: In between the Moon and you, between the buried and me.
Re: Make an item that attracts monsters
Like this? You could try sending them a PM to see if they'll share their mystical secrets
-
- Posts: 1783
- Joined: Wed Jul 23, 2003 9:22 pm
Re: Make an item that attracts monsters
My avatar is this very type of thing (Jackbomb from AEoD). There are a few parts to this:TheCisco1357 wrote:Hi!
As title says I want to remake the monkey bomb from CoD Zombies, there is a way to code the behavior of the monsters and make them go close to it? I've already done a very basic code of the bomb that play the music and, after a bunch of seconds, it explodes...
For an easy reference I was thinking about the core in some levels from the Stronghold mod
1. The bomb on the ground will every second or so spawn a couple of high radius explosions that do almost no damage. They will each have a custom damage type. Once the time is up, it will explode normally and do massive damage. The bomb will be shootable, but invulnerable, along with some other flags like -COUNTKILL. This is what allows the monsters to actually try to attack it.
2. The monster will have a pain chance of 256 to these explosions, and there will be custom pain frames to manipulate the monsters.
Code: Select all
Pain.ChaosExpl1: // This will cause the monster to forget whatever target it was chasing and then focus on the next thing that hits it.
TNT1 A 0
TNT1 A 0 A_ClearTarget
TNT1 A 0 A_ChangeFlag("QUICKTORETALIATE",1)
Goto Spawn
Pain.ChaosExpl2: // Which will be this. The monster will immediately go for the bomb. The flag is then removed to make sure the monster continues attacking it until it explodes.
TNT1 A 0
TNT1 A 0 A_ChangeFlag("QUICKTORETALIATE",0)
Goto See
The result is this:
-
- Posts: 26
- Joined: Wed Feb 22, 2012 10:12 am
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Italy
Re: Make an item that attracts monsters
This can be a good point of start, I've never considered to do something with the custom damage... this can be a little bit longer for the monster code but I'll try with this way that is very simple to code.Ichor wrote:My avatar is this very type of thing (Jackbomb from AEoD). There are a few parts to this:TheCisco1357 wrote:Hi!
As title says I want to remake the monkey bomb from CoD Zombies, there is a way to code the behavior of the monsters and make them go close to it? I've already done a very basic code of the bomb that play the music and, after a bunch of seconds, it explodes...
For an easy reference I was thinking about the core in some levels from the Stronghold mod
1. The bomb on the ground will every second or so spawn a couple of high radius explosions that do almost no damage. They will each have a custom damage type. Once the time is up, it will explode normally and do massive damage. The bomb will be shootable, but invulnerable, along with some other flags like -COUNTKILL. This is what allows the monsters to actually try to attack it.
2. The monster will have a pain chance of 256 to these explosions, and there will be custom pain frames to manipulate the monsters.
I'm probably forgetting a few things, but this is basically how it works.Code: Select all
Pain.ChaosExpl1: // This will cause the monster to forget whatever target it was chasing and then focus on the next thing that hits it. TNT1 A 0 TNT1 A 0 A_ClearTarget TNT1 A 0 A_ChangeFlag("QUICKTORETALIATE",1) Goto Spawn Pain.ChaosExpl2: // Which will be this. The monster will immediately go for the bomb. The flag is then removed to make sure the monster continues attacking it until it explodes. TNT1 A 0 TNT1 A 0 A_ChangeFlag("QUICKTORETALIATE",0) Goto See
P.s. I love the gibs in that video!
-
- Posts: 2091
- Joined: Thu Feb 03, 2011 6:39 pm
- Location: Island's Beauty, Hungary
Re: Make an item that attracts monsters
Interesting topic! So where the Jackbomb is thrown, enemies will walk there (if they can)? Does this affect flying enemies (Lost Souls, Cacodemons etc.)? I'm not sure though whether or not this bomb works on a timer or needs to be manually blown up, akin to a satchel charge?
On BTW, this feature wasn't a CoD feature either - this monster-attract item was introduced by Gods.
On BTW, this feature wasn't a CoD feature either - this monster-attract item was introduced by Gods.
-
- Posts: 1783
- Joined: Wed Jul 23, 2003 9:22 pm
Re: Make an item that attracts monsters
It should. It uses a very weak, but wide ranging custom damage explosion to get the attention of everything around it, which does include flying monsters. Lost souls might be tricky to get with this unless this thing is near a wall.Reactor wrote:Interesting topic! So where the Jackbomb is thrown, enemies will walk there (if they can)? Does this affect flying enemies (Lost Souls, Cacodemons etc.)? I'm not sure though whether or not this bomb works on a timer or needs to be manually blown up, akin to a satchel charge?
On BTW, this feature wasn't a CoD feature either - this monster-attract item was introduced by Gods.
Also, I haven't tried CoD before (though I've had plenty of tilapia, flounder, bass, etc.), but I got the idea for this from MDK's World's Most Interesting Bomb. Although in that case, it can be set off manually, where this just blows up after a few seconds.
-
- Posts: 26
- Joined: Wed Feb 22, 2012 10:12 am
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Italy
Re: Make an item that attracts monsters
I've tried to code the bomb with this trick by making custom damage but I don't understand why there are two ChaosExpl states... the bomb must cause the first and after the second pain state? Because I've tried both taken individually but nothing happens :/Ichor wrote:Code: Select all
Pain.ChaosExpl1: // This will cause the monster to forget whatever target it was chasing and then focus on the next thing that hits it. TNT1 A 0 TNT1 A 0 A_ClearTarget TNT1 A 0 A_ChangeFlag("QUICKTORETALIATE",1) Goto Spawn Pain.ChaosExpl2: // Which will be this. The monster will immediately go for the bomb. The flag is then removed to make sure the monster continues attacking it until it explodes. TNT1 A 0 TNT1 A 0 A_ChangeFlag("QUICKTORETALIATE",0) Goto See
-
- Posts: 1783
- Joined: Wed Jul 23, 2003 9:22 pm
Re: Make an item that attracts monsters
There are two of them because the first one causes the monster to clear its target, basically to forget about you. This is to make sure that when the second one hits, it will be guaranteed to go after the bomb. Oterwise, it would be very likely that the monster will continue chasing after you. This is because of threshold, which is how long a monster will focus on a target and ignore damage from other sources. For instance, you shoot an imp once and then let it chase you for a while. Once you hit it, the threshold will begin counting down every time it uses A_Chase (typically from 100). The imp will continue to chase you as long as the threshold is positive, and nothing else will be able to get its attention. If you don't hit the imp and it starts chasing you, then the threshold will be 0 until something hits it. At that point, it will chase after whatever hit it (except arch-viles) and ignore you.
The jackbomb makes use of this threshold by first setting it to 0 so that the next thing that hits the monsters will be their target. Then it restores the threshold to make sure nothing else bothers them as they try to shoot or claw at the bomb.
The jackbomb makes use of this threshold by first setting it to 0 so that the next thing that hits the monsters will be their target. Then it restores the threshold to make sure nothing else bothers them as they try to shoot or claw at the bomb.