Help Needed - Entity Facing AND / OR Shooting at Entity Targetting for Attack via Procedure

Started by pringlethegoat on

Topic category: Troubleshooting, bugs, and solutions

Last seen on 21:58, 2. Jan 2024
Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help Needed - Entity Facing AND / OR Shooting at Entity Targetting for Attack via Procedure

In short I am attempting to make a Boss Entity which does the following:

 

If VariableState = True then:

  • Face Towards Entity Targeting for Attack
  • Shoot (Projectile) at the Direction of Entity Targeting for Attack

 

I'm trying to get this done via a Procedure as it MUST be  due to the Entity only executing Firing a Projectile during its ranged state (as seen from the Mock Script above). I want to utilise Fireballs as the Projectile in question which I don't think can be done via the Standard AI attack scripts.

So long as I can get the Entity to fire this projectile towards the Direction of the Entity its targeting for attack, in this case both Server & Normal Players then I'll be happy with the Script, I have tried multiple solutions to no avail so any and all help is greatly appreciated,

Thanks

Last seen on 18:06, 24. Jul 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Projectiles with procedures…
Thu, 11/02/2023 - 02:32

Projectiles with procedures are really annoying, but there might be a workaround, if you really really don't want to do the math of calculating velocity vectors for an arcing projectile between two positions. (Which, believe me, I don't, and don't entirely remember how to do anyways.)

Try using the 'make entity look at x/y/z' function, using the x/y/z position of the entity your boss is targeting for attack. (Possibly with y + 1.) Then, fire the projectile with the x/y/z look angle vectors of the boss entity. (The vectors of the direction the boss is looking.) As long as your projectile is mostly unaffected by gravity, it should fly in a straight line towards the player, though it won't always appear that the boss is looking directly at the player.

Last seen on 21:58, 2. Jan 2024
Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks for the Solution,…
Thu, 11/02/2023 - 23:47

Thanks for the Solution, though unfortunately I can't get that sort of system to work and instead the Game crashes whenever I attempt to get the XYZ of "Entity that Event/Target Entity is targeting for attack" - I assume its because it can't get the values due to no entity being targeted for attack despite one definitely being targeted via the AI having the attack block in its script.

 I'll try a random combination of things on the lines of what you suggested as its a great idea and see what works, but so far no luck with any systems I've tried to utilise.