Link Monsters
Moderator: GZDoom Developers
Link Monsters
I was thinking earlier that it would be nice if you could Link monsters together so that, if one of them knows where you are, they all know where you are. An example would be if there was a pillar in a room, and you hide behind it, you could forseeably kill all the monsters on one side of a room without the others ever noticing you (this only applies if the Ambush flag is set).
			
			
									
						
										
						- Project Shadowcat
- Posts: 9369
- Joined: Thu Jul 14, 2005 8:33 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: Blacksburg, SC USA
- Contact:
Re: Link Monsters
A squad feature, you're suggesting?
			
			
									
						
										
						Re: Link Monsters
Sure, that's also a name it could have.
			
			
									
						
										
						- Project Shadowcat
- Posts: 9369
- Joined: Thu Jul 14, 2005 8:33 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: Blacksburg, SC USA
- Contact:
Re: Link Monsters
I'd certainly use it, but is there an easy way of going about this?Renegade wrote:Sure, that's also a name it could have.

- Zhs2
- Posts: 1303
- Joined: Fri Nov 07, 2008 3:29 pm
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
- Location: Maryland, USA, but probably also in someone's mod somewhere
- Contact:
Re: Link Monsters
A quick workaround to something like this would be to have a monster have [wiki]A_AlertMonsters[/wiki] in his Chase state, but it'd most likely alert monsters you DON'T want alerted. This could be averted with careful map planning, though.
			
			
									
						
										
						Re: Link Monsters
This could also be done with Thing_Hate - you'd need to use a common TID for all monsters of a specific group, and then just do Thing_Hate(tid, tidtohate, X) as one of the first actions upon getting a target. (At least, presumably this should work, assuming Thing_Hate will in fact hit all monsters with the same tid and give them the proper target. It runs into issues when you have a crossfire between two groups, but this can probably be avoided by checking to ensure that tidtohate is a player's TID.)Zhs2 wrote:A quick workaround to something like this would be to have a monster have [wiki]A_AlertMonsters[/wiki] in his Chase state, but it'd most likely alert monsters you DON'T want alerted. This could be averted with careful map planning, though.
- Tormentor667
- Posts: 13556
- Joined: Wed Jul 16, 2003 3:52 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Germany
- Contact:
Re: Link Monsters
But then they wouldn't move synchronically
			
			
									
						
										
						- Project Shadowcat
- Posts: 9369
- Joined: Thu Jul 14, 2005 8:33 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: Blacksburg, SC USA
- Contact:
Re: Link Monsters
They don't necessarily have to. I just think the original suggestion is to get a specific group of monsters to attack the player in case one of their kind is under fire, or spots the player. They're working together to help each other and make the player a serious problem.Tormentor667 wrote:But then they wouldn't move synchronically
Re: Link Monsters
Right now I'm using a Thing_Hate in the Thing Special of the monsters, so if one of them dies the rest attack. But this isn't the best solution because one of the monsters has to die before the others will attack. AND, if there is an infight happening and you kill one of them, they all forget about the infight and go after the player again. This solution also wouldn't really work for Multiplayer Coop maps.
			
			
									
						
										
						Re: Link Monsters
If you assign them all the same TID, you call a script that uses a combination of ActivatorTID and Thing_Hate.Renegade wrote:Right now I'm using a Thing_Hate in the Thing Special of the monsters, so if one of them dies the rest attack. But this isn't the best solution because one of the monsters has to die before the others will attack. AND, if there is an infight happening and you kill one of them, they all forget about the infight and go after the player again. This solution also wouldn't really work for Multiplayer Coop maps.
Re: Link Monsters
I'm sorry, but how does this help?
			
			
									
						
										
						Re: Link Monsters
When the monster with some id activates the script because it is in pain, the script will make it so every other monster with the same id (using activatorid) will hate (using thing_hate) the player.
			
			
									
						
										
						Re: Link Monsters
Yes, except Thing Specials only execute when a monster dies. And even if I did use decorate to execute a script in the pain state, monsters don't always enter the pain state. AND, this still wouldn't eliminate the problem with infighting and Coop.
			
			
									
						
										
						Re: Link Monsters
what if you put it in the see state instead of the pain state?Renegade wrote:Yes, except Thing Specials only execute when a monster dies. And even if I did use decorate to execute a script in the pain state, monsters don't always enter the pain state. AND, this still wouldn't eliminate the problem with infighting and Coop.
Re: Link Monsters
That's a thought, however the persistant problems here are the infighting and the coop.
Although I suppose there could just be a variable indicating if that particular thing id has already been alerted to your presence, so that it could only happen once for each 'squad', which would eliminate the infighting problem.
I guess the only problem that remains here is coop play. Because using Thing_Hate would force all the monsters to attack one player, even if all the players were shooting at them.
			
			
									
						
										
						Although I suppose there could just be a variable indicating if that particular thing id has already been alerted to your presence, so that it could only happen once for each 'squad', which would eliminate the infighting problem.
I guess the only problem that remains here is coop play. Because using Thing_Hate would force all the monsters to attack one player, even if all the players were shooting at them.




