Page 1 of 1

[Halo CE] Unlimited vehicles

Posted: Tue May 30, 2006 6:25 pm
by PsiMatrix
This tutorial is for Halo Custom Edition
It also assumes that you have a basic understanding of Sapien.


When adding vehicles to a map you are limited to just six vehicles for online maps. By default the prinicpal 6 of the game: Warthog, Rockethog, Scorpion, Banshee, Ghost and Covie Turret.

To add/have more you have several choices

1) Modify your globals - this still restricts you to 6 vehicles but you have direct control over which 6 it is
2) Change it to a solo map - unlimited vehicles but you can't use it for online play
3) Use the infinite vehicles script. Here's how:

In creating your level make sure that all the vehicles you wish to spawn that aren't part of the default 6 have an object name. Don't forget to name at least one of the default 6 which will spawn (for this example it will be a warthog named warthog)

Create a level folder inside your data folder with a mirrored pathname of your map's tag folder. So for:

X:Halo Custom Edition/tags/levels/Good-Blulch/

Create a folder with the same name in the data folder

X:Halo Custom Edition/data/levels/Good-Blulch/

Inside the data folder of your level create another folder for scripts

X:Halo Custom Edition/data/levels/Obliteration-Cove/scripts (make sure it's lowercase lettering)

Create the following in Notepad...

Code: Select all

(global boolean is_server false) 

(script startup load_settings  
           (if (!= (unit_get_health (unit warthog)) -1)  
               (begin
                (set is_server true) 
			(object_create_anew covenantdropship)
			(object_create_anew lifepod1)
			(object_create_anew lifepod2)
			(object_create_anew wasp1)
			(object_create_anew wasp2)
			(object_create_anew wasp3)
                       )
               )
)
Each of the object_create_anew commands represents a named vehicle that you wish to spawn. Repeat these lines as often as you like with as many vehicles that you want.
Save this as Good-Blulch.hsc (Change the "save as type" from 'Text Documents' to 'All Files' and save it in the Good-Blulch data-scripts folder
X:Halo Custom Edition/data/levels/Good-Blulch/scripts)

Now just open Sapien and in the heirarchy view go to the scripts branch

Mission->AI_>scripts

On the Properties Palette type in the name of the script (Good-Blulch in this case) and create a new instance in the Heirarchy View and you should see it listed.

Then finally go to the File menu and select the option Compile scripts and if everythings gone right you should see "scripts compiled successfully" in the game window.

A word to the wise: Although this can generate an infinite number of vehicles in the map, your PC cannot render an infinite number of vehicles.


And if you need proof that it works
Alonewinder and Alone Island both have a similar script in use

Posted: Sun Jan 20, 2008 1:24 am
by ImpulsiveZ
I used to script and at first vehicle spawns where their suspose to. But after respawn that fill ontop of each other, why is that? this is my script

(global boolean is_server false)

(script startup load_settings
(if (!= (unit_get_health (unit banshee)) -1)

(begin
(set is_server true)
(object_create_anew red1)
(object_create_anew red2)
(object_create_anew red3)
(object_create_anew red4)
(object_create_anew blue1)
(object_create_anew blue2)
(object_create_anew blue3)
(object_create_anew blue4)
)
)
)

Posted: Sun Jan 20, 2008 1:34 am
by Patrickssj6
How about you give some credit? You didn't find this out on yourself. :roll:

Nonetheless...good job on the tut :wink: