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 Camo and Weapon Switching

Author Topic: AI Camo and Weapon Switching (1 messages, Page 1 of 1)
Moderators: Dennis

Jade
Joined: Jan 19, 2020


Posted: Mar 11, 2020 05:46 PM    Msg. 1 of 1       
These elites will use camo when searching for you, and they will switch to their energy sword when they are attacking and near you. AI uses recorded animations to switch weapons. This way they dont lose their AI status and target like they would with actor transformations.


(script continuous elite_camo
(ai_migrate_by_unit (unit (list_get (ai_actors red_elites/ultra_basetop_squad0) 0)) red_elites/ultra_basetop_temp)
(ai_migrate_by_unit (unit (list_get (ai_actors red_elites/ultra_basebottom_squad0) 0)) red_elites/ultra_basebottom_temp)

(sleep 1)

(if (and (= (ai_status red_elites/ultra_basetop_temp) 3)
(< (unit_data_get_real (unit (list_get (ai_actors red_elites/ultra_basetop_temp) 0)) camo_power) 1.4)
)
(begin
(unit_data_set_real (unit (list_get (ai_actors red_elites/ultra_basetop_temp) 0)) camo_power (+ 0.2 (unit_data_get_real (unit (list_get (ai_actors red_elites/ultra_basetop_temp) 0)) camo_power)))
)
)


(if (and (= (ai_status red_elites/ultra_basebottom_temp) 3)
(< (unit_data_get_real (unit (list_get (ai_actors red_elites/ultra_basebottom_temp) 0)) camo_power) 1.4)
)
(begin
(unit_data_set_real (unit (list_get (ai_actors red_elites/ultra_basebottom_temp) 0)) camo_power (+ 0.2 (unit_data_get_real (unit (list_get (ai_actors red_elites/ultra_basebottom_temp) 0)) camo_power)))
)
)

(ai_migrate red_elites/ultra_basetop_temp red_elites/ultra_basetop_squad0)
(ai_migrate red_elites/ultra_basebottom_temp red_elites/ultra_basebottom_squad0)

(sleep 1)

(if (> (objects_distance_to_object (unit (list_get (ai_actors red_elites/ultra_basetop_squad0) 0)) (player0)) 3)
(begin
(if (and (= (ai_status red_elites) 3)
(= (unit_has_weapon_readied (unit (list_get (ai_actors red_elites/ultra_basetop_squad0) 0)) "es") false)
)
(begin
(recording_play (unit (list_get (ai_actors red_elites/ultra_basetop_squad0) 0)) swap3)
(sleep 2)
)
)
(if (or (and (= (unit_data_get_real (unit (list_get (ai_actors red_elites/ultra_basetop_squad0) 0)) camo_power) 0)
(= (unit_has_weapon_readied (unit (list_get (ai_actors red_elites/ultra_basetop_squad0) 0)) "pr") false)
)
(and (> (ai_status red_elites) 3)
(= (unit_has_weapon_readied (unit (list_get (ai_actors red_elites/ultra_basetop_squad0) 0)) "pr") false)
)
)
(begin
(recording_play (unit (list_get (ai_actors red_elites/ultra_basetop_squad0) 0)) swap2)
(sleep 2)
)
)
)
)

(if (> (objects_distance_to_object (unit (list_get (ai_actors red_elites/ultra_basebottom_squad0) 0)) (player0)) 3)
(begin
(if (and (= (ai_status red_elites) 3)
(= (unit_has_weapon_readied (unit (list_get (ai_actors red_elites/ultra_basebottom_squad0) 0)) "es") false)
)
(begin
(recording_play (unit (list_get (ai_actors red_elites/ultra_basebottom_squad0) 0)) swap3)
(sleep 2)
)
)
(if (or (and (= (unit_data_get_real (unit (list_get (ai_actors red_elites/ultra_basebottom_squad0) 0)) camo_power) 0)
(= (unit_has_weapon_readied (unit (list_get (ai_actors red_elites/ultra_basebottom_squad0) 0)) "pr") false)
)
(and (> (ai_status red_elites) 3)
(= (unit_has_weapon_readied (unit (list_get (ai_actors red_elites/ultra_basebottom_squad0) 0)) "pr") false)
)
)
(begin
(recording_play (unit (list_get (ai_actors red_elites/ultra_basebottom_squad0) 0)) swap2)
(sleep 2)
)
)
)
)

(if (and (< (objects_distance_to_object (unit (list_get (ai_actors red_elites/ultra_basetop_squad0) 0)) (player0)) 3)
(= (unit_has_weapon_readied (unit (list_get (ai_actors red_elites/ultra_basetop_squad0) 0)) "es") false)
(> (ai_status red_elites) 3)
)
(begin
(recording_play (unit (list_get (ai_actors red_elites/ultra_basetop_squad0) 0)) swap3)
(sleep 2)
)
)

(if (and (< (objects_distance_to_object (unit (list_get (ai_actors red_elites/ultra_basebottom_squad0) 0)) (player0)) 3)
(= (unit_has_weapon_readied (unit (list_get (ai_actors red_elites/ultra_basebottom_squad0) 0)) "es") false)
(> (ai_status red_elites) 3)
)
(begin
(recording_play (unit (list_get (ai_actors red_elites/ultra_basebottom_squad0) 0)) swap3)
(sleep 2)
)
)
)


https://youtu.be/H-lhKuWjw4U

Test map (should be loaded with map_name):
https://drive.google.com/open?id=1rrg3gE4IOnqIu11Zv5joZi9B_-z6RsxO
Edited by Jade on Mar 11, 2020 at 06:01 PM

 

 
Previous Older Thread    Next newer Thread







Time: Sat April 4, 2020 10:26 AM 375 ms.
A Halo Maps Website