if you care about functionality over graphics, you can just attach and detach a vehicle to the AI, and have all projectiles controlled by the host.
You'll get this effect.If you don't care about the large point, stop reading this post now. (This is why spoiler tags are great, people only see the stuff related to something IF they want to)For projectiles, at the bottom of every weapon, in the trigger section, theres this box, "allow client-side projectiles" uncheck it, you want hosts to control it (So the host's AI projectiles are sent to clients) Alternitively, you can try (set allow_client_side_weapon_projectiles false) although I haven't tested whether that actually works, although it would universially do that if it does work.
For the AI, make the actual AI invisible. Make a vehicle, have its display model as the normal AI's model (the non-invisible copy) a brand new glass shader works for the invisiblitiy. If you place the AI as a biped and use ai_attach, follow this:
(script continuous blah
(if (> (unit_get_health YOURBIPED) 0) (begin
(objects_attach YOURBIPED "body" DISPLAYVEHICLE "body")
(objects_detach YOURBIPED DISPLAYVEHICLE)
(sleep 5)
) (begin
(object_teleport DISPLAYVEHICLE SOMEFLAG)
(sleep 900) ;;respawn every 30 seconds
(object_create_anew YOURBIPED)
))
)
someflag is just a flag placed under a rock or something (somewhere off screen) the sleep 5 controls how long between updates between the display and the actual AI.
If you're using an actual encounter:
(script continuous blah2
(objects_attach (list_get (ai_actors YOURENCOUNTER) 0) "body" DISPLAYVEHICLE "body")
(objects_detach (list_get (ai_actors YOURENCOUNTER) 0) DISPLAYVEHICLE)
(sleep 5)
)
have repeats of the middle section for each AI in the encounter, and unique display vehicles for each one. Respawning can work, but its not really best, as if you kill the enemy while its attached, it looses track of who ai0 is, and doesnt detach. Then that vehicle is gone, and your slowly dwindling out of display vehicles and you get enemies you can only see shots from. There is a few ways around this, but im keeping it simple for now.