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 and triggers

Author Topic: ai and triggers (8 messages, Page 1 of 1)
Moderators: Dennis

Killeryoshi
Joined: Jan 22, 2009

Captain Yoshi on duty!


Posted: Feb 4, 2010 11:11 PM    Msg. 1 of 8       
How do I make it so that lets say I wanted to make a door open after an ai was killed or I wanted a cutscene to occur after an ai was killed, how would I make that happen?


Jesse
Joined: Jan 18, 2009

Discord: Holy Crust#4500


Posted: Feb 4, 2010 11:21 PM    Msg. 2 of 8       
wtfbbq


Invader Veex
Joined: Apr 11, 2007

i make poast


Posted: Feb 4, 2010 11:27 PM    Msg. 3 of 8       
considering doorgauard is the encounter,

if doorguard = 0 then
door1.door = open
end if

owai.....


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Feb 4, 2010 11:28 PM    Msg. 4 of 8       
(script startup this_script_is_blasphemy
(sleep_until (= (ai_living_count doorguard) 0) 15)
(device_set_position door1 1.0)
)


Killeryoshi
Joined: Jan 22, 2009

Captain Yoshi on duty!


Posted: Feb 5, 2010 12:22 AM    Msg. 5 of 8       
Thanks and also can you make it so that if like *insert ai encounter here* gets within *insert number of feet here* of *insert name of object here* that you fail your mission?
Ex. A hunter has gotten within 20 feet of your base and you fail the mission.


sierra117
Joined: Jan 10, 2008

If sex is good exercise, why are there fat sluts?


Posted: Feb 5, 2010 12:57 AM    Msg. 6 of 8       
simple. place a trigger that will have a distance from the amount of feet from the desired object.

encounter: enc_hunter
trigger: mission_fail_trig


Quote:
(script startup aiCANTtouchTHIS
(sleep_until (volume_test_objects (ai_actors enc_hunter )) 1 )
;insert all other codes here
(game_lost ))


you can copy & paste the code where you want. Even with the ;insert all other codes here part included. Since I made it into a comment with the ";" symbol.


Donut
Joined: Sep 30, 2006

I swear I'm not actually dead


Posted: Feb 5, 2010 01:02 AM    Msg. 7 of 8       
um just to clarify a tad, in programming we have things called comments (and i know you mentioned this but to someone who doesnt know what it is it looks like necessary code)
comments are like little notes you leave to yourself in your code so you know what is happening and why. in halo script, you denote comments with a semicolon (;). the halo script reader does not even look at anything past a ; so when you see those in code you can either take them out or just leave them there.

please do note however that the semicolon comment is only in halo script. semicolons are a huge and very important part in some other programming languages.


Killeryoshi
Joined: Jan 22, 2009

Captain Yoshi on duty!


Posted: Feb 5, 2010 08:27 PM    Msg. 8 of 8       
And how do I create objectives?
Quote: simple. place a trigger that will have a distance from the amount of feet from the desired object.

encounter: enc_hunter
trigger: mission_fail_trig


Quote:
(script startup aiCANTtouchTHIS
(sleep_until (volume_test_objects (ai_actors enc_hunter )) 1 )
;insert all other codes here
(game_lost ))



you can copy & paste the code where you want. Even with the ;insert all other codes here part included. Since I made it into a comment with the ";" symbol

I tried that and it didn't work, and I am not even sure if when I hit compiled scripts that it detected the script, but I create a folder in the data section so what am I doing wrong?
Edited by Killeryoshi on Feb 6, 2010 at 03:34 PM

 

 
Previous Older Thread    Next newer Thread







Time: Fri December 6, 2019 7:47 AM 469 ms.
A Halo Maps Website