Prevent Squad from Leaving Map

User avatar
Posts: 57
Joined: 10 Mar 2016, 00:36

Prevent Squad from Leaving Map

Postby DoctorX » 16 Jan 2018, 10:40

Looking for a way to "trap" a spawned squad on the current map.

Basically, I spawn the squad at a smart, and they are free to move from smart to smart on the map they are on, but they are forbidden from travelling to another map.

I have a few ideas for some convoluted hacky ways to achieve this, just wondering if there is a more elegant solution.

Posts: 37
Joined: 04 Nov 2016, 21:58

Re: Prevent Squad from Leaving Map

Postby luppolo » 18 Jan 2018, 00:20

can only think of these

-make a squad_on_update callback that checks if the assigned_target_id is a smart in the same map and if not picks a random one
-edit alun_utils.assign_squad_to_smart to do the same as above, this may be better since it seems most of the assigned_target_id changes are done through this function and won't do the check each tick but only when the squad actually decides/gets told the new smart

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest