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 2 Vista Forum (Bungie/Microsoft) »Halo 2 Vista Map Design / Technical »Scripts

Author Topic: Scripts (8 messages, Page 1 of 1)
Moderators: Dennis

Joined: Jan 22, 2006

Apparently public enemy number 1?

Posted: Jun 13, 2011 03:59 PM    Msg. 1 of 8       
So, I reinstalled H2V again because I was bored and wanted to try the scripting and such again. This topic will be for any random script related things we figure out. You can get hs_doc.txt by entering console in sapien, and clicking ~ followed by the command script_doc. If you feel you can't do this, or are a HCE person wanting to see the new commands, ive uploading H2V's hs_doc.txt

(vehicle_count_bipeds_killed [vehicle]) - This command sounds awesome and all, but I haven't been able to get it to produce any number. I created a vehicle in guerilla (actual vehicle, not item collection) and named it, yet neither flatting bipeds nor turret'ing them increased the number above 0.

(object_set_velocity [object] [real]) - This command makes a object move in whatever direction it faces, and it actually works unlike the last one. I do not know the scaling for the speed, but 2 is slightly slower than walking speed, and setting it to 0 will stop a object from moving (was originally using it in combination with the above script.. every time the continuous ran through, I jolted to a stop)

(magic_melee_attack) - It doesn't make you melee. Only thing I can think of is that it means your AI commrads, as the documentation is "causes player's unit to start a melee attack" (I had originally considered unit as in the definition used in halo, but I don't melee, so it has to be friends)

(set cheat_deathless_player 1) - Compiles without any errors, but I still die.

(sv_say [string]) - Wasn't in hs_doc, but I decided to try anyways. Fails on compile.

(drop [string]) - Works in sapien, can't see them anywhere ingame. I will try later using camera commands as it does work in sapien, and sapien is just a camera. (Command is essentially the same as pressing space bar in H1sapien)

(object_set_scale [object] [real] [short]) - This seems to be a bit different than Halo 1. I scaled a warthog, but only the turret and me (passenger) changed size. You can also spawn objects at different scales (since my script was a continuous, I wouldn't know if the next fact only applies to only ones spawned at different scale, or all) and when I damaged a region, it rescaled back to 1.

As far as I can tell, all AI based commands do not work. I added a squad in guerilla, used (ai_enable 1) and (ai_place ai1) aswell as (ai_attach biped1 ai1) but no sign of intellegence. aswell as in my tag test trying to use a biped with AI built in and carrier explosion type to chainspawn, those maps wouldnt show up ingame. So script based AI are ignored, tag based don't show up in map menu. I have like 3 more tests for trying to force AI in before I give up on them.

If anyone has any commands they want me to try before I get to pissed off at H2V and give it up for another year, feel free to tell me.

The Cereal Killer
Joined: Mar 18, 2011

Scripts, AI, cutscenes, ui_widgets, animation.

Posted: Jun 13, 2011 05:12 PM    Msg. 2 of 8       
Well hopefully Korn's next plan is to finish OS_H2EK after the Halo 1 version. It's our only hope.

Joined: Jun 17, 2009

I ain't got no candy for you, NO CANDY

Posted: Jun 13, 2011 06:40 PM    Msg. 3 of 8       

Joined: Jan 22, 2006

Apparently public enemy number 1?

Posted: Jun 21, 2011 11:10 PM    Msg. 4 of 8       
So, scripts don't activate on clients, only host. This means only things that transmit from host to clients will be seen, and things such as camera scripts will not work. Since object_create scripts always have the host send out that its made it like halo 1, these will still work. And you won't have to worry about clients making doubles since the script won't execute on their side. Since effects are transferred from host to client (hadn't ever done much to check this in h1, it was just something I came across, but H2 further strengthens this argument since effects do occur on clients when caused by scripts)

I also tested alot of dump commands, I see no trace of dump files, so those commands do not work.

(online_message_send [long] [long] [string])
Was hoping for a replacement to sv_say. it doesn't work. I tried a looping script from 0 to 0, 1 to 1, I was considered neither of those, and received no messages.

(map_name [string])
Doesn't work. Was hoping to use it to try making my own SP map, oh well.

Joined: Jun 12, 2009

Valve ftw

Posted: Jun 27, 2011 09:57 AM    Msg. 5 of 8       
Quote: --- Original message by: kirby_422
So, scripts don't activate on clients, only host.

Joined: Jan 22, 2006

Apparently public enemy number 1?

Posted: Jul 5, 2011 11:54 AM    Msg. 6 of 8       
Quote: --- Original message by: kirby_422
I also tested alot of dump commands, I see no trace of dump files, so those commands do not work.

So, kornman confirmed that this morning. He says debug commands are removed from the game.

Moving on, there is a command that if you include it, crashes tool on compile, or sapien on load.
(object_set_region_state   )
sets the desired region (use "" for all regions) to the model state with the given name, e.g. (object_set_region_state marine head destroyed)

I had tried to set a warthog all regions to state 'base' and tool crashed rather than just not compiling. So, stay away from that command and just use the permutation one instead.

Quote: --- Original message by: kirby_422
We don't have anything yet to identify specific players preforming certain actions to call scripts on like HCE... There is a few methods we may be able to try to dealing with this, but none of them sound that good.. First method would be that when an action_test for melee happens, quickly toss bipeds infront of everyone and see whose dies. This effectively removes the ability to melee, aswell as may not be accurate as an explosion or vehicle could be about to hit someone during that time. Another method would be weapon readied, to see if they have some secondary weapon out (used only to identify when they want to activate a script) and the problem there is we cant forcibly change their weapon back over to their other one without reseting their ammo and such, so they have to know to do it on their own. Next is grenade count, replace grenades with script activation. Last I can think of at this moment is constantly attaching and detaching vehicles to the player, and if they enter that, activate a script.. problem there is that it makes it alot harder to pickup weapons or enter other vehicles then.

Still need to decide on that (quoted from all the other sites I've posted it on) This is probably something to let the players decide on since it effects them most.

Joined: Nov 19, 2005

How long since I last used this account?

Posted: Jul 6, 2011 04:09 PM    Msg. 7 of 8       
Quote: --- Original message by: kirby_422
Bad news everyone! Your script sizes are severely crippled in H2! So, today making a test map, I tossed one of my HCE scripts over.. Saved the file, told tool to compile. Strangely enough, tool says its unmatched.. I knew this isn't true as it is used in HCE fine. I open the file again... it chopped 3/4ths of the script off. Try pasting again, click save.. I watch the scroll bar shrink instantly as I click save. You know where in guerilla, it lists source bytes? Scripts cannot exceed 4098 bytes, anything beyond that is deleted.

Today has probably been the most disappointing birthday ever (not just this, other things have happened too)

Copy-paste form modacity and monstrmoose.

Joined: Jan 22, 2006

Apparently public enemy number 1?

Posted: Jul 13, 2011 08:18 PM    Msg. 8 of 8       
Quote: --- Original message by: kirby_422
So, a week or so ago, me and a few others on a teamspeak server where talking about a gametype where instead of dying, you simply got locked up. I am wondering how many people would be interested in such a gametype (mainly because its alot more difficult to do this with h2v than HCE, and im a very lazy person)

I have started writing it out, and its been going fairly well. Only real issue at the moment is that when your tossed into your jail cell, it instantly respawns you instead *shrug* (no record in the game score of you dying either lol) I believe this issue was from players leaving the BSP from my earlier testing.

Before I do anymore work (or finish it) I would like to know what you think of it, and what features you'd want included. The script involves making all players deathless, and when their health is as empty as it can get being deathless, move them to a box. When someone flips a switch by the box, move them back to their spawn area. Depending on how many people are in the server, you get stuff appearing on your side for however many people are caught (currently, if 6 or less people are playing, first person to have their jail 3 filled, their team has a tank appear by their base. if you have more than that, jail 6 filled) This will make people want to save their people to prevent the other team for getting capture bonus'. I may also toss something in to reward you for freeing so many people if this is popular enough.

So, give me your feedback weather you'd actually play this, or what you want changed, etc. (also, I was lazy with what I have scripted and didnt incorperate players quiting the game into the system. All you who play online, how often do people rage quit in h2v?)

Also, those of you interested in texture cameras, works nice for host, as expected from the scripts not running on clients, it doesn't show on them

To setup a texture camera, make a new shader, use the shader_template located at

and use the script command
(texture_camera_set_object_marker [object] [string_id] [real])

Object is what item the camera looks from, string is the marker on that object, real is degrees. (You can't control what texture cameras have it applied to, every texture camera receives the same image.

Yes, its seriously that easy. Now only if we could make SP maps, or have scripts run on client machines.


Previous Older Thread    Next newer Thread

Time: Sat June 6, 2020 2:00 PM 156 ms.
A Halo Maps Website