Author Topic: Tweaking projectiles set to seek targets  (Read 1557 times)

0 Members and 1 Guest are viewing this topic.

VGames

  • PD3 Beta Testers
  • Hero Member
  • *
  • Posts: 757
  • Karma: +17/-69
    • View Profile
Tweaking projectiles set to seek targets
« 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.
Get the latest on Perfected Doom 3 here - http://www.moddb.com/mods/perfected-doom-3-version-500

The Happy Friar

  • Happy Happy Joy Joy
  • Administrator
  • Hero Member
  • *****
  • Posts: 915
  • Karma: +44/-4
  • Semi-Newbie.
    • View Profile
    • EarthQuake
Re: Tweaking projectiles set to seek targets
« Reply #1 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.

VGames

  • PD3 Beta Testers
  • Hero Member
  • *
  • Posts: 757
  • Karma: +17/-69
    • View Profile
Re: Tweaking projectiles set to seek targets
« Reply #2 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.
Get the latest on Perfected Doom 3 here - http://www.moddb.com/mods/perfected-doom-3-version-500

VGames

  • PD3 Beta Testers
  • Hero Member
  • *
  • Posts: 757
  • Karma: +17/-69
    • View Profile
Re: Tweaking projectiles set to seek targets
« Reply #3 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?
Get the latest on Perfected Doom 3 here - http://www.moddb.com/mods/perfected-doom-3-version-500

The Happy Friar

  • Happy Happy Joy Joy
  • Administrator
  • Hero Member
  • *****
  • Posts: 915
  • Karma: +44/-4
  • Semi-Newbie.
    • View Profile
    • EarthQuake
Re: Tweaking projectiles set to seek targets
« Reply #4 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?

VGames

  • PD3 Beta Testers
  • Hero Member
  • *
  • Posts: 757
  • Karma: +17/-69
    • View Profile
Re: Tweaking projectiles set to seek targets
« Reply #5 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.
Get the latest on Perfected Doom 3 here - http://www.moddb.com/mods/perfected-doom-3-version-500

VGames

  • PD3 Beta Testers
  • Hero Member
  • *
  • Posts: 757
  • Karma: +17/-69
    • View Profile
Re: Tweaking projectiles set to seek targets
« Reply #6 on: October 30, 2015, 08:32:35 PM »
It worked. Added $player1.
Get the latest on Perfected Doom 3 here - http://www.moddb.com/mods/perfected-doom-3-version-500