PDA

View Full Version : [TUTORIAL] Halo 2 Vista Scripting Tutorial



CodeBrain
June 14th, 2010, 12:04 PM
This tutorial sucks.

ZSi1ZNqXGfI

I made this tutorial so you can get the basic gist of how to make scripts in Halo 2 Vista. I did not edit out any mistakes (Patrick, "Gorilla" returns...) because it shouldn't really matter, as long as you can understand it, thats all that matters.

Download link for H2Guerilla: http://www.codebrainshideout.net/files/H2Guerilla.exe

I hope you enjoy it, and I also hope that this can make H2V a little bit more active.

Kornman00
June 14th, 2010, 02:27 PM
I would totally infract you right now for spreading the initial begin-statement disease if it wasn't for the fact that would be abusing my powers :snmug:

so instead, I -rep.

People, you don't need to place "(begin)" statements at the start of your scripts. This was started by someone unfamiliar with how scripts were compiled but hacked together a halo2 script decompiler anyway. These initial (begin) statements are REDUNDANT.

[/ragequit]

Shock120
June 14th, 2010, 03:30 PM
If both people had the same map, will the script sync or run for both, since they both have the same startup script?
You can add more than 1 script right?

Great job CodeBrain, the tut is good for a simple thing that not many people were aware of.
Maybe people that are currently making maps will take an interest in this (Kills Alone)...

lol Kornman, it's as though this "begin" has snuck it's way into common scripting knowledge.

CodeBrain
June 14th, 2010, 04:02 PM
I would totally infract you right now for spreading the initial begin-statement disease if it wasn't for the fact that would be abusing my powers :snmug:

so instead, I -rep.

People, you don't need to place "(begin)" statements at the start of your scripts. This was started by someone unfamiliar with how scripts were compiled but hacked together a halo2 script decompiler anyway. These initial (begin) statements are REDUNDANT.

[/ragequit]

Korn, this obviously is not my script <_>

I copied it EXACTLY from one of the Rework3d threads: http://rework3d.com/forums/viewtopic.php?t=44102

I literally just pulled the gravity hack script from the bottom of the tutorial. I never knew that the begin thing was redundant (even though I don't place them in my scripts anyway)

Edit: This is a quote from said tutorial:


...For this tutorial, I’m not going to do the public example that you all know, the zero gravity terminal, mainly because there was too much guesswork involved on my part, and too many mistakes. Therefore, I’m going to walk you through a very similar script on coagulation. The script we will be using looks like:

(script startup gravity_hack
(begin
(physics_set_gravity 0.5)
)
)...

This tutorial dates back to 2006 though, which is where it could have started. Sorry if I have angered you Korn <_>

Kantanomo
June 14th, 2010, 04:58 PM
could this be tested to make a model that you cant go through like a fake collision model?

Choking Victim
June 14th, 2010, 05:12 PM
could this be tested to make a model that you cant go through like a fake collision model?
No, the object needs a collision model for something to collide with it.

Kornman00
June 14th, 2010, 05:50 PM
Korn, this obviously is not my script <_>

Sorry if I have angered you Korn <_>
oh

:gonk:

I'z sryz

Shock120
June 14th, 2010, 06:07 PM
oh

:gonk:

I'z sryzstart by linking to the Bungie scripting Bible that was here somewhere. please.

Kornman00
June 14th, 2010, 06:17 PM
Eh, that version was really more of a immature reference than a developed bible. By the time that pin prick JackBauer leaked out that WIP I started to not care about developing it anymore. That and it was made in FrontPage 2003 (or maybe the previous Office version)

Kantanomo
June 14th, 2010, 06:39 PM
then post whats done :D

Shock120
June 14th, 2010, 06:42 PM
then post whats done :DKant, it's ok.
We can use Solder of Lite's script program to look at the scripts in h2x maps in text. (ignore the begin statement too)
plus what Kornman00 posted was more like game globals.

I can imagine this script being useful for space styled maps, including the script that muzzles the sound too.

supersniper
June 14th, 2010, 08:51 PM
like in that one room before you go to the elite jetpacks in cairo station in halo2 campaign.

Kantanomo
June 14th, 2010, 09:23 PM
or like the time you go into the yellow submarine and face the blue meanies

Resinball
June 14th, 2010, 10:17 PM
I forget where I saw that app you are referring to Shock, could you link me to it? I need more scripts, even though I haven't touched one yet! xD

This should help: Halo 2 Script Database (Complete) (http://rework3d.com/forums/viewtopic.php?f=23&t=69829&p=694050&hilit=Script#p694050)


Code, this is so sick. I cannot wait to try this out. Its about time we get something helpful. TYx1000 +Rep

I don't know what the limits are on this but could it be used for any type of simple or simulated AI? Guess I have a lot of reading and testing ahead of me.



And here is a picture of a collidable Jackal-like Shield and a Bubble Shield prototype just to show that it is possible.
http://www.monstrmoose.com/killsalone/Custom_Data_+_Tags/Data/objects/weapons/melee/Plasma_Shield/pictures/Plasma_Shield03.jpg
No you cannot see the collision happening in this shot but trust me, its there.

Shock120
June 15th, 2010, 01:35 AM
like in that one room before you go to the elite jetpacks in cairo station in halo2 campaign.
or like the time you go into the yellow submarine and face the blue meanieslol.

ScriptTools Beta by Soldier of Lite (rework3d.com) (http://rework3d.com/forums/viewtopic.php?f=92&t=50126)

As Kornman00 stated, don't use the begin statement in any of your scripts.

scripts that are recommended, are

scripts that spawn objects (spawn a thousand stickies continuously)
or spawn objects to act as active scenery, raining stickies from a distance, random explosions etc.
spawn empty banshees that are flying away.

Kantanomo
June 15th, 2010, 06:27 PM
okay so i was making a script and couldn't figure this part out


(script startup Hover_hog
(vehicle_hover objects\vehicles\warthog\warthog True)
)
)

i do that but when i compile

i get this error

http://img688.imageshack.us/img688/2802/errorhn.jpg

it is a real script function to


(vehicle_hover <vehicle> <boolean>) - stops the vehicle from running real physics and runs fake hovering physics instead.

Resinball
June 15th, 2010, 07:02 PM
Fourth line down:

[Hover_hog line 2] This is not a valid object name: objects\vehicles\warthog\warthog true

Kantanomo
June 15th, 2010, 07:11 PM
*facepalm*

supersniper
June 15th, 2010, 07:11 PM
because it cannot read the vehi tags.

Resinball
June 15th, 2010, 07:22 PM
Keep trying, don't get discouraged K.

Here are some basic working scripts, you get more working send em my way:
http://www.monstrmoose.com/killsalone/Custom_Data_+_Tags/Tags/scripts/

Kantanomo
June 15th, 2010, 07:43 PM
im not giving up but i just had a awesome idea :D

Kornman00
June 15th, 2010, 08:56 PM
It wants an object name, not an actual object tag definition (tho that hs_doc would be initially misleading to a new comer). Define a vehicle in your scenario, name it (ie, superduper_warthog), then use that name in the script function call. Also, you had an extra parenthesis in your code. Should be the following:



(script startup hover_hog
(vehicle_hover superduper_warthog true) ; 'superduper_warthog' is the name of a vehicle you have in your scenario
)


If you adhere to code indention standards you should spot such problems in the future

Kantanomo
June 15th, 2010, 09:02 PM
oh okay thanks kron

Resinball
June 15th, 2010, 11:11 PM
Korn,

I do not see how you name the Hog (the superduper_hog). There is no field to name a vehicle, like there is for scenery.

I opened the warthog.vehicle_collection file and tried the variant name but that was not it.

Kornman00
June 15th, 2010, 11:29 PM
All object placement definition blocks in the scenario have a reference to an object name block element (representing said object's name). You name the placed objects while in Sapien. You don't name scenario objects while in Guerilla.

Dwood
June 16th, 2010, 10:03 AM
Now thats messed up.

leorimolo
June 16th, 2010, 02:45 PM
Hmm Any way I can add scripts to an already existing non custom level, i/e any level with a pelican?

Resinball
June 16th, 2010, 06:15 PM
All object placement definition blocks in the scenario have a reference to an object name block element (representing said object's name). You name the placed objects while in Sapien. You don't name scenario objects while in Guerilla.

I was looking in Sapien (looking in Guerilla just in case). I found an object number, from the debug menu, but I do not see anywhere to name a vehicle in Sapien. Anyone see this?

Shock120
June 24th, 2010, 03:43 AM
Learn "some" scripts and globals from heer (http://www.modacity.net/docs/bslbible/)

CodeBrain
June 24th, 2010, 01:37 PM
I hope you realize what you linked is a Halo 1 scripting bible.

While a majority of those commands work in H2Sapien, it doesnt show the Halo 2 script commands, which is basically what this tutorial is meant for lol

CodeBrain
July 12th, 2010, 01:51 PM
Just so you guys know I don't think the flashlight actually works in multiplayer, even if you script it so that flashlights can be used.

Of course I can be wrong...

Resinball
July 21st, 2010, 06:00 PM
I haven't had success reactivating it....but I did when I modded H2X so long ago, so you would think that it is possible. That is, if I could get a biped change to take and possibly repair the missing globals and mp_globals references.

Shock120
July 21st, 2010, 06:03 PM
There was a flag in Insolence, which enabled the flashlight.

Also, I want to know, can we reference 16 players.

(script static player0
(unit (list_get (players) 0))
)
)to

(script static player15
(unit (list_get (players) 15))
)
)and then perform complex scripts on each of them?

example,
create object near player14
create vehi near player 13

Resinball
July 21st, 2010, 06:25 PM
....If you can figure out how to name an object/vehicle, Shock.

Kantanomo
July 21st, 2010, 06:32 PM
i thing i know how

Shock120
July 21st, 2010, 08:00 PM
scripts are limited by 7 blocks, wow. <:mad:~

Kornman00
July 21st, 2010, 08:19 PM
why the hell would you make over 8 script files...

Shock120
July 21st, 2010, 08:38 PM
why the hell would you make over 8 script files...I assumed we would be allowed, since Bungie does it. ='(
stupid dumb H2G, fails, and this is the supposed unlocked version.

Kornman00
July 21st, 2010, 10:05 PM
Umm, Bungie never used more than 8 script files in Halo 2.

Dwood
July 21st, 2010, 11:30 PM
Umm, Bungie never used more than 8 script files in Halo 2.

There's no actual need for more than 7 script files. maybe lines/operations would want to be expanded but I don't see the purpose of more than three or four script files, especially for mods.

Shock120
July 22nd, 2010, 07:43 AM
Umm, Bungie never used more than 8 script files in Halo 2.so, is script tools beta is a lie?
I look at campaign maps with that, I never thought Bungie only used 8 scripts.

Actually nevermind, it's apparent, that SoL wasn't good at truly understanding Bungie's scripts, I looked at this,
http://blog.allenthinks.com/images/site/grimdoomer/gravemind/gm.scripts.jpg

and there's alot of room to scroll.

leorimolo
July 25th, 2010, 03:31 PM
so, is script tools beta is a lie?
I look at campaign maps with that, I never thought Bungie only used 8 scripts.

Actually nevermind, it's apparent, that SoL wasn't good at truly understanding Bungie's scripts, I looked at this,
http://blog.allenthinks.com/images/site/grimdoomer/gravemind/gm.scripts.jpg

and there's alot of room to scroll.
... In the tags there is only 1 hs.doc. it can have multiple scripts, and this wasnt even to what KM00 was refering too.