Trying to emulate the Inquisitor's grenade attack
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Trying to emulate the Inquisitor's grenade attack
When the Inquisitor robot attacks it will either fire its gun or launch two [wiki]Classes:InquisitorShot[/wiki]s using the [wiki]A_InquisitorAttack[/wiki] function. However, this function has a slight problem: the robot has got two shoulder-mounted weapons where the grenades are supposed to come from but the grenades (one in particular) fire much lower than that - pretty much at foot level, certainly low enough to get caught even on relatively small obstacles.
I've been trying to make something that launches the grenades at the correct height but otherwise keeps the feel of the attack much the same. However, I have failed. Can anyone help out here?
I've been trying to make something that launches the grenades at the correct height but otherwise keeps the feel of the attack much the same. However, I have failed. Can anyone help out here?
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: Trying to emulate the Inquisitor's grenade attack
There should be everything you need, including height, in [wiki]A_FireCustomMissile[/wiki].
Re: Trying to emulate the Inquisitor's grenade attack
That's a weapon attack function. Monsters should use [wiki]A_CustomMissile[/wiki].
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: Trying to emulate the Inquisitor's grenade attack
Whoops, right. Been working on weapons lately so that would be poor reflex. 

- LilWhiteMouse
- Posts: 2270
- Joined: Tue Jul 15, 2003 7:00 pm
- Location: Maine, US
- Contact:
Re: Trying to emulate the Inquisitor's grenade attack
@NeuralStunner: So how do we go about making A_CustomMissile() determine the necessary arc in order to hit the player?
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: Trying to emulate the Inquisitor's grenade attack
From the description of the original function, I see no such provision in the original function. 
I wouldn't know how to make a "smart trajectory", other than working with the distance and pitch to the current target. (Neither of which is currently possible without some ACS integration, AFAIK.) I'm of no help there.

I wouldn't know how to make a "smart trajectory", other than working with the distance and pitch to the current target. (Neither of which is currently possible without some ACS integration, AFAIK.) I'm of no help there.
Re: Trying to emulate the Inquisitor's grenade attack
Yes, that's been my problem - getting that intelligent arc. The closest to something that felt right was actually using A_SpawnItemEx rather than a typical projectile function. It worked really quite well, especially at medium distances but it was too easy for the player to get out of range - which is less easy with the inbuilt function which can throw the grenades further if you are far away from the Inquisitor.
- LilWhiteMouse
- Posts: 2270
- Joined: Tue Jul 15, 2003 7:00 pm
- Location: Maine, US
- Contact:
Re: Trying to emulate the Inquisitor's grenade attack
This has been an on and off trial for me. I've tried numerous times to get an enemy to properly toss a grenade, but with little success. I've looked up ballistic trajectory equations, but found nothing I could translate to ACS. I could have sworn someone (I thought I did?) posted a feature request for tossing a projectile, but I can't find it.
Re: Trying to emulate the Inquisitor's grenade attack
Xtyfe's bump of this thread:
http://forum.zdoom.org/viewtopic.php?f=34&t=30291
got me wondering if the stuff therein would be any use for this kind of attack (if it was implemented, of course).
http://forum.zdoom.org/viewtopic.php?f=34&t=30291
got me wondering if the stuff therein would be any use for this kind of attack (if it was implemented, of course).
Re: Trying to emulate the Inquisitor's grenade attack
Somebody made a smart grenade firing enemy... can't remember the thread, but the mod was also packaged with a couple other minimods that included laser tripmines and a Half-Life-style rocket launcher (weapon emits a laser dot, fired rockets will follow the dot wherever it goes).
- Xtyfe
- Posts: 1490
- Joined: Fri Dec 14, 2007 6:29 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
Re: Trying to emulate the Inquisitor's grenade attack
I'd be interested in this smart grenade thing as well if anyone remembers the threadamv2k9 wrote:Somebody made a smart grenade firing enemy... can't remember the thread, but the mod was also packaged with a couple other minimods that included laser tripmines and a Half-Life-style rocket launcher (weapon emits a laser dot, fired rockets will follow the dot wherever it goes).
- SwordGrunt
- Posts: 13
- Joined: Thu Apr 05, 2012 7:36 pm
Re: Trying to emulate the Inquisitor's grenade attack
For the 'smart grenade' attack, couldn't it be done with A_JumpIfCloser and then creating several attack states using A_CustomMissile with a different angle and pitch?
- LilWhiteMouse
- Posts: 2270
- Joined: Tue Jul 15, 2003 7:00 pm
- Location: Maine, US
- Contact:
Re: Trying to emulate the Inquisitor's grenade attack
It's not that simple because of height differences. The pitch needs to be altered according to the target's relative height to the shooter, not just the range.
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: Trying to emulate the Inquisitor's grenade attack
You rang?LilWhiteMouse wrote:The pitch needs to be altered according to the target's relative height to the shooter, not just the range.

- LilWhiteMouse
- Posts: 2270
- Joined: Tue Jul 15, 2003 7:00 pm
- Location: Maine, US
- Contact:
Re: Trying to emulate the Inquisitor's grenade attack
How does this help?