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 »Basic scripting help

Page 1 of 3 Go to page: · [1] · 2 · 3 · Next
Author Topic: Basic scripting help (93 messages, Page 1 of 3)
Moderators: Dennis

Pepzee
Joined: Sep 9, 2010

Retired Halo Modder


Posted: Oct 8, 2010 06:42 PM    Msg. 1 of 93       
Hello all, so I was making a single player map and I was wondering why it was lagging so much. Then I realized I had to put checkpoints in. Now I have looked at all of the scripting and single player tutorials on this web site. However none of them give specific instructions on how to add in checkpoints. This is what I know so far. I know you open up a word document and type (game_save). I know you save it as an .hsc file. I know to create a trigger volume and name it checkpoint. I know how to compile the scripts in sapien. However when I do all of that and test, not only does the checkpoint not work, the AI don't spawn either. Thats all I know how to do and any help is appreciated. I am also wondering how to make things like objectives and nav pooints. Do they require more scripting? Thanks.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Oct 8, 2010 09:56 PM    Msg. 2 of 93       
All single player maps should have a great deal of scripting. As for creating checkpoints, add the (game_save) command inside the scope of a script block. Some terminology:

Scope - Everything between (script scripttype scriptname and the closing )

Script block - A script's scope, including the (script scripttype scriptname and the closing)


Pepzee
Joined: Sep 9, 2010

Retired Halo Modder


Posted: Oct 8, 2010 10:49 PM    Msg. 3 of 93       
Ok I think I did what you said, but the same thing happened I started the game none of the AI spawned and there was no checkpoint. Is every thing I am doing up there correct? Here's what I am trying to do. I am trying to put a checkpoint right outside the dangercanyon blue base. Now since it is an original MP map it didn't have a script folder so I put one there. I made sure the type was set to solo. Then I put a trigger volume right outside the blue base and named it aispawn. Then a put an AI past the trigger volume. Then I opened up note pad and typed in the script (game_save). I saved it into my scripts folder. Then in sapien I ticked on my AI not initially created. Then I compiled the script in sapien Those are my exact steps. Am I doing anything wrong?


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Oct 9, 2010 01:47 PM    Msg. 4 of 93       
Paste your script here.


Pepzee
Joined: Sep 9, 2010

Retired Halo Modder


Posted: Oct 9, 2010 01:51 PM    Msg. 5 of 93       
(script startup basicsript
(sleep_until (volume_test_objects aispawn (players))15)
(ai_place encounter_1)
(game_save)
)


SlappyThePirate
Joined: Aug 24, 2009

You are irritating, I'll release nothing


Posted: Oct 9, 2010 02:11 PM    Msg. 6 of 93       
Did you set up the encounter right? Not initially created, covie team, and a squad with starting positions, init count, and all that stuff?


Pepzee
Joined: Sep 9, 2010

Retired Halo Modder


Posted: Oct 9, 2010 02:40 PM    Msg. 7 of 93       
Quote: --- Original message by: SlappyThePirate
Did you set up the encounter right? Not initially created, covie team, and a squad with starting positions, init count, and all that stuff?

Yes. I'm pretty sure I did. I'll double check though. I also have a question, In sapien I go to Mission/AI/scripts, what does that do? Anyway I am practically done with the project. I could give it to you with out any checkpoints. That wouldn't be fun though. I am just doing something similar to ghp_dangercanyon. Anyway is there a possibility I'm not doing the trigger volume right? What happens if there is a red circle with a slash through the trigger volume?


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Oct 9, 2010 05:49 PM    Msg. 8 of 93       
Should be fine as long as it covers the area which the player should enter. What's the exact folder you put your script in?


Pepzee
Joined: Sep 9, 2010

Retired Halo Modder


Posted: Oct 9, 2010 07:01 PM    Msg. 9 of 93       
I put the script in, Halo custom edition/tags/levels/test/mapname/scripts. Maybe It has to do with the size of the trigger volume, but I made it cover the whole doorway. I thought I heard somewhere that you had to stand in the trigger volume for 8 seconds for it to work, is that true? Also does the whole player have to enter the trigger volume or does only the head or feet have to touch it?
Edited by pepzee on Oct 9, 2010 at 07:01 PM


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Oct 9, 2010 08:45 PM    Msg. 10 of 93       
Actually, I''m fairly sure the trigger volume isn't the issue. The .hsc file goes inside Halo Custom Edition\data\levels\test\mapname\scripts


Pepzee
Joined: Sep 9, 2010

Retired Halo Modder


Posted: Oct 9, 2010 10:17 PM    Msg. 11 of 93       
Hmm... ok, I will try that. However when I use the HEK plus to extract a map it puts the senario in Halo Custom Edition\tags\levels\test\mapname. Should I move the senario to Halo Custom Edition\data\levels\test\mapname? Because if I put the script in Halo Custom Edition\data\levels\test\mapname\scripts and the senario is in Halo Custom Edition\tags\levels\test\mapname then it may not work because they are in separate folders.


SlappyThePirate
Joined: Aug 24, 2009

You are irritating, I'll release nothing


Posted: Oct 9, 2010 10:30 PM    Msg. 12 of 93       
Quote: --- Original message by: pepzee Anyway is there a possibility I'm not doing the trigger volume right? What happens if there is a red circle with a slash through the trigger volume?
Actually, this may be it. Sometimes my TVs didn't work becuase they had that. The no-sign means the center of it is not in the level. Try to make it so it IS in the level.
What I do is center them in the air, and make them bigger at the bottom =)


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Oct 9, 2010 10:52 PM    Msg. 13 of 93       
No, scripts are meant to go in the data folder, while the scenario and all other tags are meant to remain in the tags folder. A .hsc file is a "source" file, persay, as are .jms, .jmas, and everything else. The thing is, you can't easily create tags without HEK, whereas everything you DO make, models, animations, scripts, aren't tags.

TL;DR: Scripts go in data, scenario goes in tags

Also, the cross thingy is not the issue. The only reason as to why that appears is because the centerpoint of the trigger volume (not exactly the center, a misnomer) isn't within the BSP. The trigger volume still works just fine.
Edited by Gamma927 on Oct 9, 2010 at 10:53 PM


Pepzee
Joined: Sep 9, 2010

Retired Halo Modder


Posted: Oct 9, 2010 11:32 PM    Msg. 14 of 93       
Okay that makes some sense! I just have one more problem... Let's say that a level I'm looking for doesn't appear in the data folder. For instance If I am using a custom MP map, the map won't appear in the data folder only the tags folder. Also some of the original maps aren't even in the data folder. Example: Hang em high.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Oct 10, 2010 12:48 AM    Msg. 15 of 93       
Maps only appear after you compile the .scenario through tool, and they'll appear in the maps folder.


Pepzee
Joined: Sep 9, 2010

Retired Halo Modder


Posted: Oct 10, 2010 02:30 AM    Msg. 16 of 93       
Quote: --- Original message by: Gamma927
Maps only appear after you compile the .scenario through tool, and they'll appear in the maps folder.

Yes. But does the level appear in Halo Custom Edition\data\levels\test? That way I can put my script in the map folder. Maybe I'm not using the correct command. Here is the command I am using: tool build-cache-file levels\test\mapname\mapname.


Head Noob
Joined: Oct 3, 2010

This difficulty is for noobs! Mythic is for pros


Posted: Oct 10, 2010 03:48 AM    Msg. 17 of 93       
Find out if it is in test then write in tool the following: tool build-cache-file levels\test(if needed)\the name of the folder e.g. beavercreek\then you write the scenario name e.g. sp_beaver_creek.
An example: tool build-cache-file levels\test\beavercreek\sp_beaver_creek
Then it will come up with info about compiling the file. If it worked it will say file cache built or something like that.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Oct 10, 2010 10:31 AM    Msg. 18 of 93       
Quote: --- Original message by: pepzee
Quote: --- Original message by: Gamma927
Maps only appear after you compile the .scenario through tool, and they'll appear in the maps folder.

Yes. But does the level appear in Halo Custom Edition\data\levels\test? That way I can put my script in the map folder. Maybe I'm not using the correct command. Here is the command I am using: tool build-cache-file levels\test\mapname\mapname.


Scripts go in the data folder, and when you compile a scenario, the map will appear in the MAPS folder.


Pepzee
Joined: Sep 9, 2010

Retired Halo Modder


Posted: Oct 10, 2010 12:34 PM    Msg. 19 of 93       
Okay, But there is no data folder to put the script in for that map. I am missing quite a few data folders Example: Damnation, Hang em high, Derelict, Chiron TL-34 and Wizard, Longest. I don't know why they are not in the data folder. Should I try re-installing the game? or is it normal it be missing data folders?
Edited by pepzee on Oct 10, 2010 at 12:36 PM


SlappyThePirate
Joined: Aug 24, 2009

You are irritating, I'll release nothing


Posted: Oct 10, 2010 01:00 PM    Msg. 20 of 93       
Quote: --- Original message by: pepzee

Okay, But there is no data folder to put the script in for that map. I am missing quite a few data folders Example: Damnation, Hang em high, Derelict, Chiron TL-34 and Wizard, Longest. I don't know why they are not in the data folder. Should I try re-installing the game? or is it normal it be missing data folders?
Edited by pepzee on Oct 10, 2010 at 12:36 PM
Make the folders already, then!


Pepzee
Joined: Sep 9, 2010

Retired Halo Modder


Posted: Oct 10, 2010 01:45 PM    Msg. 21 of 93       
Ok, but wouldn't I be missing some stuff? Because in the data folders there is a ton of .tif files. So you just say create a data folder? I'll try that...


SlappyThePirate
Joined: Aug 24, 2009

You are irritating, I'll release nothing


Posted: Oct 10, 2010 04:30 PM    Msg. 22 of 93       
Quote: --- Original message by: pepzee
Ok, but wouldn't I be missing some stuff? Because in the data folders there is a ton of .tif files. So you just say create a data folder? I'll try that...
Yes.
This is how data and tags work.

DATA folder-- holds things you want to make into tags. Bungie gives you some tif files.
TAGS folder-- halo-ized data that can be put into a map.
Scenario and globals tags: These tags basically make the map. These tags are lists of information, and contain other tags, which contain OTHER tags, etc.

DATA>goes into TOOL>TAG.
data\vehicles\car\bitmaps\skin.tiff > TOOL > data\vehicles\car\bitmaps\skin.bitmap

Tag1a>tag2a>tag3a>scenario tag
Tag1b>tag2b>scenario tag
etc.
scenario tag>TOOL>.map file

If you try to open a scenario in sapien and you DONT have Tag1a or Tag2b or whatever, Sapien crashes.
If you're missing the DATA folder stuff (skin.tiff), but have the tags (skin.bitmap), it's OK, because when making a map TOOL only looks at your halo-ized data (TAGS).

Theeee end.
Edited by SlappyThePirate on Oct 10, 2010 at 04:31 PM


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Oct 10, 2010 04:35 PM    Msg. 23 of 93       
TL;DR version:

The data folder is where the raw stuff goes. The tags folder is where (most) of the raw stuff gets OUTPUTTED after it goes through tool.

You don't need stuff in the data folder UNLESS you're compiling NEW stuff. Since all of the stuff for the MP Halo maps are already compiled into tag form, you don't need the raw .tif files and stuff.

SCRIPTS HOWEVER, since they AREN'T precompiled into the maps (because you're making a NEW map), must be placed in the data folder such that they can be compiled.


Pepzee
Joined: Sep 9, 2010

Retired Halo Modder


Posted: Oct 10, 2010 06:16 PM    Msg. 24 of 93       
Alright! It worked! Thank you both! I just have a few final questions. I read somewhere that the script (game_save_no_timeout) worked better, is that true? Does that one script work for all the checkpoints? Thank you both again!


d4rfnader
Joined: Jul 16, 2010

Open mouth, insert sandwhich.


Posted: Oct 10, 2010 06:39 PM    Msg. 25 of 93       
(game_save) try's to save for only 8 seconds and then gives up.

(game_save_no_timeout) doesn't stop trying to save until it successfully saves.


Pepzee
Joined: Sep 9, 2010

Retired Halo Modder


Posted: Oct 10, 2010 06:55 PM    Msg. 26 of 93       
Quote: --- Original message by: d4rfnader
(game_save) try's to save for only 8 seconds and then gives up.

(game_save_no_timeout) doesn't stop trying to save until it successfully saves.

Ah good, which one would all of you recommend? also is there like a big document that contains all the scripts I'll ever need? Example: objectives, nav points, cut scenes, ect...


d4rfnader
Joined: Jul 16, 2010

Open mouth, insert sandwhich.


Posted: Oct 10, 2010 07:00 PM    Msg. 27 of 93       
i recommend (game_save_no_timeout)

and on this site there is the scripting bible:http://hce.halomaps.org/index.cfm?fid=2809

and in sapien hit the "~" key and type script_doc and it will create a file called hs_doc in the hce directory, lists all the scripting commands.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Oct 10, 2010 11:34 PM    Msg. 28 of 93       
There's also (game_save_totally_unsafe), which saves the game immediately. A lot of people don't recommend it, but if you know what you're doing, there's no problem with it.


Pepzee
Joined: Sep 9, 2010

Retired Halo Modder


Posted: Oct 11, 2010 12:24 AM    Msg. 29 of 93       
Alright, thanks everyone(especially Gamma927)! Now the game doesn't lag like crazy. However now I have run face-first into another wall. Objectives and nav points. I read through the entire scripting bible and didn't find anything about objectives or nav points. I assume they use trigger volumes also. I also assume that they probably require scripting. These are the last 2(I hope) things that my map needs. Thank you all for your help so far!


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Oct 11, 2010 01:06 AM    Msg. 30 of 93       
Quote: --- Original message by: Gamma927
You're going to have to create a new txt file, renamed to hud messages.hmt (hmt being the file extension). When you save this, make sure it's set to unicode encoding. Then, inside, place your HUD texts in this format:

INDEX=OBJECTIVE TEXT

So if I wanted to display something like, ">>Go through the teleporter", I'd use:

obj1=>>Go through the teleporter

Please note that obj1 is the index, and that we'll be referring to that in the script. Once you've filled the hud messages.hmt file with your objectives (NOTE. YOU CANNOT HAVE TWO SAME INDEXES.) Then, CLOSE SAPIEN, and open your command prompt. Type in:

tool hud-messages DIRECTORY OF SCENARIO FILE NAME OF SCENARIO FILE

So if your scenario file was inside tags\levels\firefight\firefight.scenario, you'd put your hud messages.hmt file inside: data\levels\firefight

Then, you'd type into tool:

tool hud-messages levels\firefight firefight

Compile it.

Re-open Sapien AFTER COMPILING. Inside your script, add

(show_hud_help_text true) ;; Displays HUD help text
(hud_set_objective_text INDEX) ;; Sets the objective thing in the pause menu
(hud_set_help_text INDEX) ;; Sets the HUD text to this
(sleep 150) ;; Sleeps for five seconds
(show_hud_help_text false) ;; Stops displaying HUD help text

Replacing INDEX with your index from your hud messages.hmt file. So if your index was obj1, you'd use something like:

(show_hud_help_text true)
(hud_set_objective_text obj1)
(hud_set_help_text obj1)
(sleep 150)
(show_hud_help_text false)
THIS IS NOT A STANDALONE SCRIPT. YOU CANNOT USE THIS ALONE.


Quoting from that tutorial I wrote a while back. It was meant for other purposes, so it may seem a bit... choppy. I'll clarify whatever you don't get tomorrow; gonna catch some sleep today. As for nav points:

If you wish to attach a nav point to an object, (a biped or vehicle, for instance), you'd need to use:

(activate_team_nav_point_object "navpoint type" "team" "object" "vertical offset")

For "navpoint type", replace it with the type of navpoint you want. I don't really remember all of them; in fact, the only one you probably need is "default". That's the default blue arrow used throughout the campaign.

For "team", this is the team that sees the nav point. Obviously, you want the player to see the nav point, and thus, you use "player". If this is a multiplayer map, teams are done differently, and the player team is blue team (afaik, iirc). I'll check tomorrow.

The "object" is the object you wish to attach the nav point to. Just substitute it with the name of the object you want (this can be specified in the properties pane when you select the object in hierarchy view).

The "vertical offset" is how high above the object you want the nav point to appear. If you're all out of ideas, 0.6 is a good number.

So, an example of this, using object1 as the name of the object, would be:

(activate_team_nav_point_object default player object1 0.6)

This activates the nav point. Whenever you wish to deactivate it, you'd use something similar, basically:

(deactivate_team_nav_point_object "team" "object")

"Team" and "object" are the same ones you used for the activate command.

If you wish to attach this to a flag rather than an object (flags are placed in hierarchy view; mission > game data > flags), then use

(activate_team_nav_point_flag "navpoint type" "team" "flag" "vertical offset")

and deactivating it would be: (deactivate_team_nav_point_flag "team" "flag")

Now, you probably want to make these nav points appear once you go through a trigger volume, or when something happens. Basically, you'd use a "conditional" phrase before the activate / deactivate commands. A conditional phrase is basically a command that checks whether a condition is true or false. Slightly confusing, but for now, we won't go too far into it.

Let's say you want to use a trigger volume to activate the nav point. Here, the trigger volume would be the conditional, because that's what checks whether something is true or not (whether the player is in the trigger volume)

An example of this script would be:

(sleep_until (volume_test_objects triggervolume (players)) 15)
(activate_team_nav_point_object default player object1 0.6)

Not too difficult, I hope. As I said, I'll check back tomorrow if you have any questions.


Pepzee
Joined: Sep 9, 2010

Retired Halo Modder


Posted: Oct 11, 2010 02:01 AM    Msg. 31 of 93       
Okay, your going to have to give me a day or two so I can try to figure this out. I'll let you know if I run into anything or if this works perfectly. I've read it over once and it looks a little confusing. If there is a simpler version of this let me know, otherwise I will do my best with this.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Oct 11, 2010 10:52 AM    Msg. 32 of 93       
It would be easier if we could do this over chat. Do you have an xfire?


Pepzee
Joined: Sep 9, 2010

Retired Halo Modder


Posted: Oct 11, 2010 05:38 PM    Msg. 33 of 93       
Sorry for the delayed reply. Sadly I don't have an xfire. I might be able to make one though. To be honest I really not sure what an xfire even is. However I would be more than willing to make one. I also didn't really follow how to make an objective. Here are my objectives for my map:

obj1=>>Fight your way through the canyon.
obj2=>>Take out covenant armor. (put nav point on covenant wraith)
obj3=>>Get to the covenant base.
obj4=>>Kill the elite commander. (put nav point on elite commander)
obj5=>>Escape the flood. (put nav point on tunnel)

So I got lost on most of what you said. If you could please give me step-by-step instructions on how to do this I would be most grateful. Thanks.
Edited by pepzee on Oct 11, 2010 at 09:30 PM


Head Noob
Joined: Oct 3, 2010

This difficulty is for noobs! Mythic is for pros


Posted: Oct 12, 2010 07:16 AM    Msg. 34 of 93       
This would also help me for my map. Also y don't u use msn messager or something like that if you don't have xfire.


MoooseGuy
Joined: Aug 10, 2008

I Approve This Message.


Posted: Oct 12, 2010 07:25 AM    Msg. 35 of 93       
Elite commander should be more than a regular commander, give him like an uber boost of health and ai, to make him seem more like a real objective, or a boss kinda.
Objectives sound good, btw, don't use msn for this community, nobody uses it. Almost everyone here that's important uses xfire, and xfire takes videos and pictures in-game.

 
Page 1 of 3 Go to page: · [1] · 2 · 3 · Next

 
Previous Older Thread    Next newer Thread







Time: Fri January 20, 2023 1:11 AM 157 ms.
A Halo Maps Website