id Tech Forums

id Tech 4 (Doom3/Prey/Q4) => id Tech 4 Mod Coding => Topic started by: VGames on September 24, 2014, 01:41:28 PM

Title: Tweaking projectiles set to seek targets
Post by: VGames on September 24, 2014, 01:41:28 PM
I've got this secondary attack for the BFG in my Perfected Doom 3 mod that releases big green orbs that move very slowly and basically act as turrets that attack monsters using the laser currents that flow from the normal BFG projectile as it flies across a room. Anyways I noticed that the orbs will only attack monsters that were already present when the turret orb was launched. If the turret orb has been launched and then a monster appears or spawns in the orb will not attack them. How can I fix this problem. I'm sure it has something to do with the seeking code for projectiles. Because my primary attack for the BFG releases extra small orbs along with the primary projectile that vary in number depending on how much u charged up the BFG before firing. And these smaller orbs wont seek an enemy unless you were aiming right at somebody when u fired the gun. I hope u guys understand what I'm saying and asking.
Title: Re: Tweaking projectiles set to seek targets
Post by: The Happy Friar on September 24, 2014, 01:46:36 PM
my solution (aka the ultra hacky way): spawn actual monsters that are acts like turrets and attack.  Then they have their own AI.  That's what it needs, it's own AI, and 99% of the AI in D3 does a basic "find something to kill and kill it" routine.
Title: Re: Tweaking projectiles set to seek targets
Post by: VGames on September 24, 2014, 02:31:14 PM
I like your thinking. So make a monster that looks and acts like my projectiles? I'll see if I can pull this off. I'm sure I'll be back with more questions.
Title: Re: Tweaking projectiles set to seek targets
Post by: VGames on October 29, 2015, 08:35:28 PM
Ok it's been a while since I posted in this thread but I did a workaround on this Orb that kills baddies with the same energy beams found in the BFG primary projectile. The way I did it was made the original orb create another orb after 1 second and then that second orb makes another orb after 1 second and then another orb and another orb are made until 15 seconds total passes resulting in no more orbs. They work as I hoped constantly searching for any new baddies that come around after the previous orb was created. This way they always attack the newest enemy while looking like the same orb that you originally fired.

Here's the problem: the orbs that follow after the original orb you launched from the BFG will attack you too. They no longer realize that u were the original creator of the very first orb. So is there any way I can fix this and not allow these orbs that come after the originally launched orb attack you?
Title: Re: Tweaking projectiles set to seek targets
Post by: The Happy Friar on October 29, 2015, 09:30:34 PM
In single player the player is $player1, right?  Could you do a check to see if the target is the player & then skip to the next target?
Title: Re: Tweaking projectiles set to seek targets
Post by: VGames on October 29, 2015, 09:36:22 PM
Not sure how to do that. Maybe if I add $player1. to the front of the fireprojectile commands in the scripts for the orb projectiles then the orbs won't attack the player.
Title: Re: Tweaking projectiles set to seek targets
Post by: VGames on October 30, 2015, 08:32:35 PM
It worked. Added $player1.