r/forge • • 3d ago

Scripting Help Does anyone know how to script invincible AI?

I’m looking to make a small machinima about some Marines going up against a covenant invasion but I need to make sure the marines survive. Does anyone know how to make them immortal?

8 Upvotes

5 comments sorted by

3

u/CakeAT12 3d ago edited 3d ago

You could use a trait zone potentially?

Create an area monitor and then use a script which is something like:

On object entered area monitor

Branch

Is AI

True

Branch

Is friendly AI

True

Apply trait set

Edit: area monitor process tag renamed

2

u/FaithlessnessLimp364 3d ago

I’ll give it a shot :) cheers!

2

u/CakeAT12 3d ago

Check above. Editted my comment because the script block is "on objected entered..." Not "get object in..."

2

u/Abe_Odd 2d ago

You can't make anything truly invincible, as some things are always Death. Unshielded Headshots, back-smacks, etc.

What you can do is set enemy damage to near zero, and set Marines damage resistance to very high. You could also make marines do more damage or make the covenant have less damage resistance, so that Elites go down a lot faster.

Marines without rockets or snipers kinda... don't kill enemies fast.

On Ai Spawned -> get team -> compare team: ALLIED_TEAM ->
branch, if true -> apply trait set until death: Marines,
if false -> apply trait set until death: Covenant

Declare Trait set: Marines -> damage resistance: 1000% (Read the description before placing the node, for some reason weapon, grenade, and explosive resistance don't all use the same scale, 0% for one might mean you die instantly, in another it means you're invincible) Declare Trait set: Covenant -> weapon damage(or something like that): 1%

As a general warning, AI with Traits still have a bug where if AI with Traits are killed (by anything OTHER Than players / units killing them), you will eventually have to restart the match to get Traits to apply to new units. There's like, 250 slots for Traits and when they are all filled, no more can be added. Ending a round and having all the remaining AI cleaned up will trigger this bug. Killing all units with a node in the graph will trigger this. You can do:
On Round End -> get all ai units -> remove all traits and it will be fine for Rounds ending. But Waves ending that kill the stragglers will trigger it.

If you need marines that kill 100s of Covenant over multiple rounds, consider only adding traits to the Marines, and just giving them extra damage and damage res

2

u/FaithlessnessLimp364 8h ago

Thanks for the heads up buddy! I appreciate it :D