A Community discussion forum for Halo Custom Edition, Halo 2 Vista, Portal and Halo Machinima

Home  Search Register  Login Member ListRecent Posts
  
 
»Forums Index »Halo Custom Edition (Bungie/Gearbox) »Halo CE General Discussion »AI Followers

Author Topic: AI Followers (6 messages, Page 1 of 1)
Moderators: Dennis

JadeMcLain
Joined: Nov 13, 2018


Posted: Feb 23, 2019 06:19 PM    Msg. 1 of 6       
If we use ai_go_to_vehicle and give the player a seat they can enter, we can have followers. They don't need firing positions, though you can have them if you want, and we can use the opensauce distance feature to make them stop. This could also work in vanilla Halo without the distance part, using AI attached to the player and having him detect when others are near.

We can also use command lists to make them look at the player.

https://www.youtube.com/watch?v=ci3fE39H9bw


(script continuous ai_follow
(if (and (!= (ai_status red_elite_follow) 0)
(!= (ai_status red_elite_follow) 1)
(!= (ai_status red_elite_follow) 2)
(!= (ai_status red_elite_follow) 3)
)
(begin
(if (>= (objects_distance_to_object (unit (list_get (ai_actors red_elite_follow/carbine0) 0)) (player0)) 5)
(begin
(ai_go_to_vehicle_override red_elite_follow/carbine0 (player0) "")
)
)

(if (>= (objects_distance_to_object (unit (list_get (ai_actors red_elite_follow/carbine1) 0)) (player0)) 5)
(begin
(ai_go_to_vehicle_override red_elite_follow/carbine1 (player0) "")
)
)

(if (>= (objects_distance_to_object (unit (list_get (ai_actors red_elite_follow/carbine2) 0)) (player0)) 5)
(begin
(ai_go_to_vehicle_override red_elite_follow/carbine2 (player0) "")
)
)

(if (>= (objects_distance_to_object (unit (list_get (ai_actors red_elite_follow/carbine3) 0)) (player0)) 5)
(begin
(ai_go_to_vehicle_override red_elite_follow/carbine3 (player0) "")
)
)

(if (>= (objects_distance_to_object (unit (list_get (ai_actors red_elite_follow/carbine4) 0)) (player0)) 5)
(begin
(ai_go_to_vehicle_override red_elite_follow/carbine4 (player0) "")
)
)

(if (>= (objects_distance_to_object (unit (list_get (ai_actors red_elite_follow/carbine5) 0)) (player0)) 5)
(begin
(ai_go_to_vehicle_override red_elite_follow/carbine5 (player0) "")
)
)
(ai_command_list red_elite_follow lookint)
)
)

(if (and (!= (ai_status red_elite_follow) 4)
(!= (ai_status red_elite_follow) 5)
(!= (ai_status red_elite_follow) 6)
)
(begin
(if (>= (objects_distance_to_object (unit (list_get (ai_actors red_elite_follow/carbine0) 0)) (player0)) 5)
(begin
(ai_go_to_vehicle_override red_elite_follow/carbine0 (player0) "")
)
)

(if (>= (objects_distance_to_object (unit (list_get (ai_actors red_elite_follow/carbine1) 0)) (player0)) 5)
(begin
(ai_go_to_vehicle_override red_elite_follow/carbine1 (player0) "")
)
)

(if (>= (objects_distance_to_object (unit (list_get (ai_actors red_elite_follow/carbine2) 0)) (player0)) 5)
(begin
(ai_go_to_vehicle_override red_elite_follow/carbine2 (player0) "")
)
)

(if (>= (objects_distance_to_object (unit (list_get (ai_actors red_elite_follow/carbine3) 0)) (player0)) 5)
(begin
(ai_go_to_vehicle_override red_elite_follow/carbine3 (player0) "")
)
)

(if (>= (objects_distance_to_object (unit (list_get (ai_actors red_elite_follow/carbine4) 0)) (player0)) 5)
(begin
(ai_go_to_vehicle_override red_elite_follow/carbine4 (player0) "")
)
)

(if (>= (objects_distance_to_object (unit (list_get (ai_actors red_elite_follow/carbine5) 0)) (player0)) 5)
(begin
(ai_go_to_vehicle_override red_elite_follow/carbine5 (player0) "")
)
)
(ai_command_list red_elite_follow look)
)
)
)


DeadHamster
Joined: Jun 8, 2014


Posted: Feb 24, 2019 01:20 AM    Msg. 2 of 6       
Oh man that's really really good.

what's the difference between look and lookint? That seems to be the difference between the two sections.


JadeMcLain
Joined: Nov 13, 2018


Posted: Feb 24, 2019 01:55 AM    Msg. 3 of 6       
Quote: --- Original message by: DeadHamster
Oh man that's really really good.

what's the difference between look and lookint? That seems to be the difference between the two sections.


Thanks!

"lookint" is for when they are fighting, it makes them look at us but they can ignore the command if they want to because initiative is enabled. it overrides look which forces them to look at us when not in combat.

I have made updates to this. Flying units can now use ai_go_to_vehicle. Flying units do not use the move front, back, etc animations for moving, but they still need them in order to use this command.

We can also make them move to us based on our height by storing our and the ai's z value

(script static short DroneZ (object_data_get_real (unit (list_get (ai_actors red_elite_follow) DroneIndex)) position z))
(script static short PlayerZ (object_data_get_real (player0) position z))

https://youtu.be/NCMDXctjr3k
Drones have a longer follow threshold than the elites so they don't clutter eachother as they move.
Edited by JadeMcLain on Feb 24, 2019 at 01:57 AM


DeadHamster
Joined: Jun 8, 2014


Posted: Feb 24, 2019 03:07 AM    Msg. 4 of 6       
Yeah so about that groaning. That's gotta go


SOI_7
Joined: Mar 23, 2012

ZA WARUDO! TOKI WO TOMARE!


Posted: Feb 24, 2019 12:06 PM    Msg. 5 of 6       
You're a f-ing genius!


lolslayer
Joined: Mar 21, 2015

https://www.youtube.com/watch?v=uMHbAKvPJkU


Posted: Feb 24, 2019 04:14 PM    Msg. 6 of 6       
This looks fun, would be nice to have a map with a squad

 

 
Previous Older Thread    Next newer Thread







Time: Mon March 25, 2019 5:01 PM 172 ms.
A Halo Maps Website