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 Technical / Map Design »Script Help

Author Topic: Script Help (6 messages, Page 1 of 1)
Moderators: Dennis

Advancebo
Joined: Jan 14, 2008


Posted: Mar 9, 2009 09:48 PM    Msg. 1 of 6       
I need help with making a script where:

When the player enters the trigger, it starts an animation where a brute rams into a marine turning a corner. Then the Brute becomes an AI, and the marine is dead, maybe scenery.

This is what I have so far:
(script continuous bruteram
(volume_test_objects bruteattack players)
)



But how would I incorporate this part of the script in?
(custom_animation <unit> <animation_graph> <string> <boolean>)

Edited by Advancebo on Mar 9, 2009 at 09:58 PM


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Mar 9, 2009 09:53 PM    Msg. 2 of 6       
For unit, you replace it with the name of the brute. For animation_graph, you replace it with the animation. I'm not sure about string, but for boolean, you would probably put true.


Advancebo
Joined: Jan 14, 2008


Posted: Mar 9, 2009 09:57 PM    Msg. 3 of 6       
But wouldnt this code be needed:
(if <boolean> <then> [<else>])

Edited by Advancebo on Mar 9, 2009 at 09:57 PM


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Mar 9, 2009 10:08 PM    Msg. 4 of 6       
Oh, you want to know how to put it into the script. Here:

(script startup bruteram
(sleep_until (volume_test_objects bruteattack (players)) 15)
(custom_animation [put parameters here]
)


No "if" is needed, and the script was changed from a continuous to a startup. Why? If it were continuous, and if it used "if", the custom animation would play every time the player entered the trigger volume.


Me KS
Joined: Feb 2, 2008

Desire is Reality. Xfire: jetmaster23


Posted: Mar 9, 2009 10:34 PM    Msg. 5 of 6       
Here's a script that gives you an idea of how to do this:


(script startup bruteram
(sleep_until (volume_test_objects bruteattack (players)) 1)
(object_create brute)
(object_create marine)
(custom_animation brute "characters\brute\bruteram" "stand brute ram" 1)
(sleep_until (<= (unit_get_custom_animation_time brute) 8) 1)
(unit_kill marine)
(sleep_until (= (unit_is_playing_custom_animation brute) 0) 1)
(ai_attach brute brutes)
)


You can replace everything with what you're using. I used "brute" as the name for brute, "marine" for name of the marine, "characters\brute\bruteram" is your animation tag, "stand brute ram" is the name of the animation within the animation tag, and "brutes" is the AI encounter.

Basically, the marine and brute are created, and the custom animation is run on the brute. Then, it sleeps until a certain number of frames are left in the animation with (unit_get_custom_animation_time). This is the exact frame when the brute rams the marine and is supposed to kill him, which happens right after with (unit_kill). You'll have to change the number in bold up there to the number of frames left to get the timing right, I just picked a random number. Then, it waits until the animation is finished, and then attaches AI to the brute.

To explain the "custom_animation" command:

(custom_animation "unit" "animation_graph" "string" "boolean")
starts a custom animation playing on a unit (interpolates into animation if last parameter is TRUE)

"unit" is the name of the biped or vehicle (usually biped). "animation_graph" is just the path to the animation tag. "string" is the name of the exact animation from that animation tag to run. "boolean" is explained above: it smoothly moves into the animation if it's set to true, so I set it to true.
Edited by Me KS on Mar 9, 2009 at 10:35 PM


Advancebo
Joined: Jan 14, 2008


Posted: Mar 10, 2009 07:51 AM    Msg. 6 of 6       
k thanks.

 

 
Previous Older Thread    Next newer Thread







Time: Thu January 19, 2023 6:24 PM 281 ms.
A Halo Maps Website