Halomods Community Portal: Linking ui_widget_definition buttons to scripts in the scenario. - Halomods Community Portal

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Linking ui_widget_definition buttons to scripts in the scenario.

Intended for those who already have knowledge in ui_widget_definitions

#1 User is offline   TCK 

  • Script, AI, UI widgets, cutscenes, solo gameplay.
  • PipPipPip
  • Group: Members
  • Joined: 05-May 11
  • LocationSC

Posted 07 May 2011 - 09:31 PM

Deadhamst3r said:

Credit to Tiamat for Releasing Coldsnap.

What you'll need;

Halo CE
Halo String Editor

First off, download this tag: http://www.cereal-ki...time_button.rar
Extract it somewhere in your tags folder

Writing the Script
Ok, find your level in the data folder. If your map doesn't have one yet, create one.

So for bloodgulch, we'd go to;


Create a folder named scripts. Open notepad, and type this into the window:
    (script static void button
            (sv_say "Button has been pressed")

Save that file as menubutton.hsc, making sure to change the save as type to all files
Posted Image

Making the Button
Now, open Kornman00 V2;

If you're making a Multi Player map, browse to and open this tag;


If you're making a Single Player map, browse to and open this tag;


After opening it, At the very top change the value for the letter "b" from 140 to 175. This is lowering the menu's boundaries so it'll register the extra button when you mouse-over it.

After that, scroll down to the bottom.
Posted Image

Duplicate any of the items under the list "Child Widgets", and then do the following;

Change the Vertical Offset to 140
Change the Widget Tag Reference to the tag you extracted earlier.
Open that tag now.

Once the tag is open, scroll down a bit. The following checkboxes should be checked, now switch the name under script to read "button" or whatever you named your script earlier (ALL LOWER-CASE LETTERS). Save.
Posted Image

Changing the button Text

Open up the string editor, wait for the obnoxious loading screen. Once it's open, click "Add/Insert", and change the Text to whatever you want your button to say:
Posted Image

Now click save, and the savetype as a String_List. The program is backwards, String_Lists are really unicode string lists, and vice versa. Save the file somewhere in your tags folder where it won't get lost.

Once you've saved it, go find the file, and change the type to be a .unicode_string_list file.

Go back to the button tag from earlier, scroll down to this part:
Posted Image

Fill That reference with the Unicode String List we just made. If it gives you an error, it's because you saved wrong or didn't change the filetype. Remember; Save as a String_List file, rename it to a .unicode_string_list file.

Compiling the Script

Open your scenario in Sapien, and hit CTRL+SHIFT+C

The screen should say scripts compiled successfully. If not, check to make sure you copied the text above correctly.

Save the map and close Sapien

After that, compile your mapfile, and run your map in a LAN server to test it out. If it works, the server should display a message and the server will then shut-down, ending the match. For all you hacker-faggots out there, no this won't work in a server. GTFO.

If you have any problems, post them here and I'll be happy to help you out with it. << I'll do that in his absence --TCK

Share this topic:

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic