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 »Scripts for dropping A.I In Sapien.

Author Topic: Scripts for dropping A.I In Sapien. (9 messages, Page 1 of 1)
Moderators: Dennis

Spartan II
Joined: Nov 25, 2014


Posted: Mar 5, 2015 02:48 PM    Msg. 1 of 9       
This SP tutorial will help you learn how to load and drop off AI from any vehicle.

http://hce.halomaps.org/index.cfm?fid=4315

This tutorial, might help you learn how to script.


http://hce.halomaps.org/index.cfm?fid=1664


Super Flanker
Joined: Oct 5, 2012

The length of your life depends on my aim.


Posted: Mar 6, 2015 09:27 AM    Msg. 2 of 9       
After TSCE There seems to be trend of lots of new newbie ppl joing hmaps and instantly making threads for any problems they have.

I don't mind ppl asking for help especially if they are new, but most of the answers can be solved using google.


Spartan II
Joined: Nov 25, 2014


Posted: Mar 7, 2015 06:02 PM    Msg. 3 of 9       
Have you had a look around this site's tutorial section? If you can't find anything, then I would suggest looking on youtube, google, modacity or you could try looking through the forums on this site.

I don't know if there are any video tutorials on how to drop off AI, and so far I haven't found any.

I would be happy to explain Polamee's tutorial or make you a script that you can compile.
Edited by Spartan II on Mar 7, 2015 at 06:05 PM


Spartan II
Joined: Nov 25, 2014


Posted: Mar 7, 2015 06:48 PM    Msg. 4 of 9       
Ok, so I'm going to assume that you have basic knowledge of how to spawn and manipulate AI. You will also need to know how to script.

In section 9, Polamee explains recorded animations and how to import therm into your scenario. Recorded animations are essential, as you wouldn't want your vehicle to just sit on the ground and drop off troops. You can use recorded animations from the original campaign or you can make your own recorded animations, (this requires and application that is downloadable from halomaps). Once you have chosen a recorded animation that you want your vehicle to play you need to name your vehicle. Since you are using a pelican we are going to name your vehicle "pelican_1", (the quotes are not necessary). After naming your vehicle, you are going to need the name of your recorded animation, (choose any you want). Use this scripting syntax to get your recorded animation to play:

(recording_play <name of your vehicle> <name of recording)

Lets say you were using your own custom animation called "pelican_drop_off_1", you would use this script:

(script startup pelican_drop_off_1
(recording_play pelican_1 pelican_drop_off_1)
)

This script would get the vehicle to play the animation.

Section 7 of Polamee's tutorial, teaches you that trigger volumes are refered to in a script and teaches you how to manipulate trigger volumes. We are going to use a trigger volume, to get our pelican to play our recorded animation and then drop off a squad of your choice.

I will need to split this into 2 parts, so in the next part I will tell you how to get the pelican to play a recorded animation and drop off a squad when the player walks through a trigger volume.


Flash44x
Joined: Jan 3, 2007

What would you have your arbiter do?


Posted: Mar 7, 2015 08:18 PM    Msg. 5 of 9       
(vehicle_load_magic <vehicle> "rider" (ai_actors <ai_encounter>) This will load the vehicle with the specified ai encounter.
(object_teleport <vehicle> <flag>) Teleports the vehicle to the starting spot.
(recording_play_and_hover <vehicle> <animation>) This will let the vehicle play the rec animation
(sleep (- (recording_time <vehicle>)60 ) Waits until the vehicle has finnished the assigned rec animation.
(vehicle_unload <vehicle> "rider") Releases the ai from the vehicle.
Edited by Flash44x on Mar 7, 2015 at 08:20 PM


Spartan II
Joined: Nov 25, 2014


Posted: Mar 8, 2015 12:40 PM    Msg. 6 of 9       
Ok, so in this part I will teach you how to use trigger volumes to trigger your script and make your pelican drop off a sqaud of your choice.
First, you need to make and name a trigger volume. To do this, you need to open up sapien and scroll down to the trigger volumes section in game data. Place a trigger volume where you want the player to trigger the pelican by pressing the right mouse button. You can drag the sides of the trigger volume to increase its length, width and height, (if the trigger volume goes red don't worry, it just means that the trigger volume is not selected). Next, you need to name you trigger volume, we are going to name it "pelican_trigger_1". Now that you have your trigger volume placed, you are going to use this script to get the pelican to play the recorded animation, when the player walks through it:

(script startup pelican_drop_off_1
(sleep_until (volume_test_objects pelican_trigger_1 (players))15)
(recording_play pelican_1 pelican_drop_off_1)
(game_save_no_timeout)
)

(The game_save_no_timeout will just give you a checkpoint when you walk through the trigger volume, and is optional).

Now that we have got our animation to play, we are going to get the AI into the vehicle, so that they can be droped off. We can do this by using the vehicle_load_magic command,(you will need a named AI encounter and a named squad). In order to do this, you need to use this scripting syntax:

(vehicle_load_magic <name of vehicle> <name of vehicle seat label> (ai_actors <encounter>/<squadname>))

The vehicle seat label, represents the seat that you want you AI to be in. Every vehicle has its own unique seat label, which you need to check in Guerilla. You can do this by opening up the vehicle of your choice, (in this case a pelican) in Guerilla and scrolling down to the seats section and looking for the seat labels for every seat, (some seats may share the same seat label, while others will be different). You can rename the seat names if you want or you can use the defualt seat names.

I don't know what the seat names are for the pelican as I haven't checked them in Guerilla, so lets just say that all of the seat names for the pelican are called "riders".
You also need a named AI encounter and squad name; we are going to name our encounter "drop_off" and our squad "drop_off_squad_1", (you can change these if you want, just make sure you use the correct scripting syntax). With these names, we should have a script that looks something like this:

(script startup pelican_drop_off_1
(sleep_until (volume_test_objects pelican_trigger_1 (players))15)
(vehicle_load_magic pelican_1 riders (ai_actors drop_off/drop_off_squad_1))
(recording_play pelican_1 pelican_drop_off_1)
(game_save_no_timeout)
)

This script will get the AI into the pelican, and then play the recording, however it will not drop them off. In order to do that, you need to use the vehicle_unload command. The vehicle_command, will get the AI out of the vehicle. Use this scripting syntax to get the AI out of the vehicle:

(vehicle_unload <vehicle>)

Now we need to add this command to our script, in order to get our pelican to drop off the AI. After adding this command, our script should look something like this:

(script startup pelican_drop_off_1
(sleep_until (volume_test_objects pelican_trigger_1 (players))15)
(vehicle_load_magic pelican_1 riders (ai_actors drop_off/drop_off_squad_1))
(recording_play pelican_1 pelican_drop_off_1)
(vehicle_unload pelican_1)
(game_save_no_timeout)
)

This script will get the AI into the pelican when the player walks through the trigger volume, then it will play the recording, then it will get thec AI out of the vehicle adn then it will save the game.

The result, should be that the pelican will fly in, (or do what ever you want it to do depending on the animation) and drop off your AI.

You can make the pelican fly off, by using an animation that makes the pelican fly away. You may also want the pelican to spawn, when you walk through the trigger volume, so you could use the object_destroy or object_create_anew to hide and show the pelican, (the syntax for these scripts are in Polamee's tutorial).

I hope this was helpful. If you have any further questions, feel free to PM me of post on this thread.


Super Flanker
Joined: Oct 5, 2012

The length of your life depends on my aim.


Posted: Mar 8, 2015 02:11 PM    Msg. 7 of 9       
Quote: --- Original message by: Alex21788
Oh thank you so much. one problem though. where do i script. where do i put the script commands??


A) Notepade

B) Place your script doc inside a scripts folder within your map data directory.

I.e if I was making a map and the directory was:

levels\test\lolsocool

Then I would make a folder in the name of your map folder like this:

levels\test\lolsocool\scripts.

Then place the scipts in there.

Once you have your map open in sapien go to file > compile scripts


Spartan II
Joined: Nov 25, 2014


Posted: Mar 9, 2015 01:32 PM    Msg. 8 of 9       
In order to script, you're going to need a text editor like notepad or word. Type in all of your scripts and commands. Name your scripts file "scripts"

Next, you need to save your scripts in your map data directory. Your maps data directory is located in the "data" folder in your Halo CE folder.

Lets say that you had a map called "random_map" and it was located here: "tags\levels\test\random_map" then your data directory would be located here: "data\levels\test\random_map".

In data\levels\test\random_map create a folder called "scripts". Inside that folder, save the text file that has all of the scripts for your map. Make sure you save the file as a .hsc file, as that is the file type that sapien will read. To do this, just go to save as and add .hsc to the end your scripts file.

Then open up you map in sapien, go to file and click compile scripts.
The game will compile your scripts and will say "scripts successfully compiled". If there are any errors then the game will tell you, (if this happens then try to fix them yourself).

Note: If your scripts are located in the wrong location, then sapien will still say "scripts successfully compiled". Make sure that you scripts are loacted in the right place.

After compiling you scripts, compile your map and run ingame.

I hope this was helpful. Again, if you have any further questions fell free to PM me or continue to post on this thread.


Super Flanker
Joined: Oct 5, 2012

The length of your life depends on my aim.


Posted: Mar 10, 2015 07:38 AM    Msg. 9 of 9       
Quote: --- Original message by: Spartan II
In order to script, you're going to need a text editor like notepad or word. Type in all of your scripts and commands. Name your scripts file "scripts"

Next, you need to save your scripts in your map data directory. Your maps data directory is located in the "data" folder in your Halo CE folder.

Lets say that you had a map called "random_map" and it was located here: "tags\levels\test\random_map" then your data directory would be located here: "data\levels\test\random_map".

In data\levels\test\random_map create a folder called "scripts". Inside that folder, save the text file that has all of the scripts for your map. Make sure you save the file as a .hsc file, as that is the file type that sapien will read. To do this, just go to save as and add .hsc to the end your scripts file.

Then open up you map in sapien, go to file and click compile scripts.
The game will compile your scripts and will say "scripts successfully compiled". If there are any errors then the game will tell you, (if this happens then try to fix them yourself).

Note: If your scripts are located in the wrong location, then sapien will still say "scripts successfully compiled". Make sure that you scripts are loacted in the right place.

After compiling you scripts, compile your map and run ingame.

I hope this was helpful. Again, if you have any further questions fell free to PM me or continue to post on this thread.


I just said that.

 

 
Previous Older Thread    Next newer Thread







Time: Mon January 27, 2020 4:24 AM 344 ms.
A Halo Maps Website