Misc: How To Create Tag Plugins

Post here about scripting and programming for HaloPC (audio, network, ai, etc.)
Post Reply
User avatar
Phenomena





Posts: 1510
Joined: Thu Jul 01, 2004 3:25 pm
Location: Training my ducks
Contact:

Misc: How To Create Tag Plugins

Post by Phenomena »

The plugin format it self is fairly simple to understand. like with HTML everything has an opening and closing 'tag'. The closing is defined with a '/'. So for example:

<name>hi</name>

You start making your first plugin, you must first decide... which tag do you want to make one for. Keeping in mind that you can NOT make plugins for the Sound, Bitmap or Model tags.

For the purpose of this tutorial we are going to create an actr (actor) plugin.

To start it open notepad and type the following:

Code: Select all

<plugin> 
<tag>actr</tag>
<struct>
<name>Main</name>
<size>0</size>
Now what does this mean...

<plugin> - signifies the start of the plugin

<tag>actr</tag> - will tell HMT what tag this plugin is for, in this case that actr tag

<struct> - is short for structure

<name>Main</name> - this is the box that says Main in the plugin (note: it MUST say Main or your plugin will not work!)

<size>0</size> - for the main structrure the size is not important so just always make it 0.

_________________________________________________________

Ok, so now we have the begining of our plugin done. Next step is to add some editing options. To do this open guerilla (yes guerilla, this will save us much time :P). Now create a new Actor tag.

The first thing we see in guerilla is the "Flags" almost EVERY tag has atleast one Flags part. This is the first thing we will add to our plugin.

Now im Guerilla the checklists, are know as bitmask32's in HMT plugins. So to add this we, just add:

Code: Select all

<value>
<type>bitmask32</type>
<offset></offset>
<name>Flags</name>
<value> - indicated the begining of something.

<type>bitmask32</type> - will tell hmt to make it check boxes

<offset></offset> - tells hmt what offset to find (we left this blank for now)

<name>Flags</name> - is what will show up as the label in HMT

Now to add the checkboxes all we have to do is add:

Code: Select all

<bitmask>
<bit>32</bit>
<name>Can See in Darkness</name>
</bitmask>
<bitmask> will tell HMT that this is going to be a checkbox

<bit>32</bit> - tell HMT whichs section it is, this will ALWAYS starts 32 and going down by one each time. (32, 31, 30 etc etc)

<name>Can See in Darkness</name> - this is the label that will appear next to the check box.

</bitmask> - indicated the end of the first check box.

______________________________________________

Now repeat that for everything in the first Flags section, remember to chnage the name, and too lower the bit by 1 each time... So the next item (Sneak Uncovering Target) would be bit 31.

after youve added everything add

Code: Select all

</value>
This will end the first editing option.

So now your plugin file will look like this

Code: Select all

<plugin>
<tag>actr</tag>
<struct>
<name>Main</name>
<size>0</size>
<value>
<type>bitmask32</type>
<offset></offset>
<name>Flags</name>
<bitmask>
<bit>32</bit>
<name>Can See in Darkness</name>
</bitmask>
<bitmask>
<bit>31</bit>
<name>Sneak Uncovering Target</name>
</bitmask>
<bitmask>
<bit>30</bit>
<name>Sneak Uncovering Pursuit Pos</name>
</bitmask>
<bitmask>
<bit>29</bit>
<name>Unused</name>
</bitmask>
<bitmask>
<bit>28</bit>
<name>Shoot at Target's Last Location</name>
</bitmask>
<bitmask>
<bit>27</bit>
<name>Try to Stay Still When Crouched</name>
</bitmask>
<bitmask>
<bit>26</bit>
<name>Crouch when not in Combat</name>
</bitmask>
<bitmask>
<bit>25</bit>
<name>Crouch When Guarding</name>
</bitmask>
<bitmask>
<bit>24</bit>
<name>Unused</name>
</bitmask>
<bitmask>
<bit>23</bit>
<name>Must Crouch to Shoot</name>
</bitmask>
<bitmask>
<bit>22</bit>
<name>Panic When Surprised</name>
</bitmask>
<bitmask>
<bit>21</bit>
<name>Always Charge at Enemies</name>
</bitmask>
<bitmask>
<bit>20</bit>
<name>Gets in Vehicles with Player</name>
</bitmask>
<bitmask>
<bit>19</bit>
<name>Start Firing Before Aligned</name>
</bitmask>
<bitmask>
<bit>18</bit>
<name>Standing Must Move Forward</name>
</bitmask>
<bitmask>
<bit>17</bit>
<name>Crouching Must Move Forward</name>
</bitmask>
<bitmask>
<bit>16</bit>
<name>Use Stalking Behaviour</name>
</bitmask>
<bitmask>
<bit>15</bit>
<name>Stalking Freeze if Exposed</name>
</bitmask>
<bitmask>
<bit>14</bit>
<name>Always Beserk in Attaching M</name>
</bitmask>
<bitmask>
<bit>13</bit>
<name>Always Beserking Uses Panicked Mo</name>
</bitmask>
<bitmask>
<bit>12</bit>
<name>Flying</name>
</bitmask>
<bitmask>
<bit>11</bit>
<name>Panicked by Unopposable En</name>
</bitmask>
<bitmask>
<bit>10</bit>
<name>Crouch When Hiding From Uno</name>
</bitmask>
<bitmask>
<bit>09</bit>
<name>Always Charge in 'Attacking'</name>
</bitmask>
<bitmask>
<bit>08</bit>
<name>Drive off Ledges</name>
</bitmask>
<bitmask>
<bit>07</bit>
<name>Swarm</name>
</bitmask>
<bitmask>
<bit>06</bit>
<name>Suicidal Melee Attack</name>
</bitmask>
<bitmask>
<bit>05</bit>
<name>Cannot Move While Crouching </name>
</bitmask>
<bitmask>
<bit>04</bit>
<name>Fixed Crouch Facing</name>
</bitmask>
<bitmask>
<bit>03</bit>
<name>Crouch When in Line of Fire</name>
</bitmask>
<bitmask>
<bit>02</bit>
<name>Avoid Friends' Line of Fire</name>
</bitmask>
</value>
_________________________________________________________________

Now to find that offset. To find this, just check off "Can See in Darkness" and save the new tag, doesnt matter what you save it as.

Now open that tag in a Hex Editor. I suggest HHD Hex Editor. Now we want to do a hex search for '00 00 00 01'. In this case it starts a offset 00000040, or 0x40, but the only problem is, this is the CE offset not the PC offset.

Since CE Tags have a 40 byte header, and PC doesn't, just load the microsoft calculator, change it to scientific, then choose Hex mode and subtract 40 from 40. to get 0. So the PC offset is 0x00, which we will place in the <offset> tag we left blank at the beggining.

I can't stress enough to always use the calculator, even if you do know it. This will help prevent confusing because this is hex and will get into digits like: 44F - 40.

__________________________________________________________________

Now for tutorial purposes, we're going to skip "More Flags" and go right on down to "Type".

This is called an id16, in Guerilla they show up as dropdown menus, but in HMT they are the radio buttons.

To create these just add:

Code: Select all

<value>
<type>id16</type>
<offset></offset>
<name>Type</name>
I wont explain what it all does, because its the same as the Bitmask32's.

Now to add the radiobuttons just add:

Code: Select all

<option>
<value>00</value>
<name>Elite</name>
</option>
<option> - indicates the begining of the radio button

<value>00</value> - is the number of which it is, in this case its the opposite of the bits, everytime you go UP one. So the next one will be 01.

<name>Elite</name> - is the label

</option> indicates the end of the radio button.

____________________________________________________

Keep adding these fir the rest of the items in the drop down list in guerilla, remembering to raise the value by 1 each time.

To end this just add the

Code: Select all

</value>
____________________________________________________

To find the offset uncheck the the "Sneak Uncovering Target", just so we dont get confused. Then select "Jackal" in the 'Type' list. Save it and open it in the hex editor again.

This time you want to do a hex search for '00 01'. Which in this case is located at 00000054, so go back into the calculator and subtract 40 from 54 to get 14. So add 0x14 to the offset section of the new id16.

your plugin will now look like this:

Code: Select all

<plugin>
<tag>actr</tag>
<struct>
<name>Main</name>
<size>148</size>
<value>
<type>bitmask32</type>
<offset>0x00</offset>
<name>Flags</name>
<bitmask>
<bit>32</bit>
<name>Can See in Darkness</name>
</bitmask>
<bitmask>
<bit>31</bit>
<name>Sneak Uncovering Target</name>
</bitmask>
<bitmask>
<bit>30</bit>
<name>Sneak Uncovering Pursuit Pos</name>
</bitmask>
<bitmask>
<bit>29</bit>
<name>Unused</name>
</bitmask>
<bitmask>
<bit>28</bit>
<name>Shoot at Target's Last Location</name>
</bitmask>
<bitmask>
<bit>27</bit>
<name>Try to Stay Still When Crouched</name>
</bitmask>
<bitmask>
<bit>26</bit>
<name>Crouch when not in Combat</name>
</bitmask>
<bitmask>
<bit>25</bit>
<name>Crouch When Guarding</name>
</bitmask>
<bitmask>
<bit>24</bit>
<name>Unused</name>
</bitmask>
<bitmask>
<bit>23</bit>
<name>Must Crouch to Shoot</name>
</bitmask>
<bitmask>
<bit>22</bit>
<name>Panic When Surprised</name>
</bitmask>
<bitmask>
<bit>21</bit>
<name>Always Charge at Enemies</name>
</bitmask>
<bitmask>
<bit>20</bit>
<name>Gets in Vehicles with Player</name>
</bitmask>
<bitmask>
<bit>19</bit>
<name>Start Firing Before Aligned</name>
</bitmask>
<bitmask>
<bit>18</bit>
<name>Standing Must Move Forward</name>
</bitmask>
<bitmask>
<bit>17</bit>
<name>Crouching Must Move Forward</name>
</bitmask>
<bitmask>
<bit>16</bit>
<name>Use Stalking Behaviour</name>
</bitmask>
<bitmask>
<bit>15</bit>
<name>Stalking Freeze if Exposed</name>
</bitmask>
<bitmask>
<bit>14</bit>
<name>Always Beserk in Attaching M</name>
</bitmask>
<bitmask>
<bit>13</bit>
<name>Always Beserking Uses Panicked Mo</name>
</bitmask>
<bitmask>
<bit>12</bit>
<name>Flying</name>
</bitmask>
<bitmask>
<bit>11</bit>
<name>Panicked by Unopposable En</name>
</bitmask>
<bitmask>
<bit>10</bit>
<name>Crouch When Hiding From Uno</name>
</bitmask>
<bitmask>
<bit>09</bit>
<name>Always Charge in 'Attacking'</name>
</bitmask>
<bitmask>
<bit>08</bit>
<name>Drive off Ledges</name>
</bitmask>
<bitmask>
<bit>07</bit>
<name>Swarm</name>
</bitmask>
<bitmask>
<bit>06</bit>
<name>Suicidal Melee Attack</name>
</bitmask>
<bitmask>
<bit>05</bit>
<name>Cannot Move While Crouching </name>
</bitmask>
<bitmask>
<bit>04</bit>
<name>Fixed Crouch Facing</name>
</bitmask>
<bitmask>
<bit>03</bit>
<name>Crouch When in Line of Fire</name>
</bitmask>
<bitmask>
<bit>02</bit>
<name>Avoid Friends' Line of Fire</name>
</bitmask>
</value>
<value>
<type>id16</type>
<offset>0x14</offset>
<name>Type</name>
<option>
<value>00</value>
<name>Elite</name>
</option>
<option>
<value>01</value>
<name>Jackal</name>
</option>
<option>
<value>02</value>
<name>Grunt</name>
</option>
<option>
<value>03</value>
<name>Hunter</name>
</option>
<option>
<value>04</value>
<name>Engineer</name>
</option>
<option>
<value>05</value>
<name>Assassin</name>
</option>
<option>
<value>06</value>
<name>Player</name>
</option>
<option>
<value>07</value>
<name>Marine</name>
</option>
<option>
<value>08</value>
<name>Crew</name>
</option>
<option>
<value>09</value>
<name>Combat Form</name>
</option>
<option>
<value>10</value>
<name>Infection Form</name>
</option>
<option>
<value>11</value>
<name>Carrier Form</name>
</option>
<option>
<value>12</value>
<name>Monitor</name>
</option>
<option>
<value>11</value>
<name>Sentinel</name>
</option>
<option>
<value>12</value>
<name>None</name>
</option>
<option>
<value>13</value>
<name>Mounted Weapon</name>
</option>
</value>
___________________________________________________

INTERMISSION TAKE A F'ING BREAK MY FINGERS ARE SORE....

__________________________________________________

Okay just to let you know, from now on we wont be doing big ass ones like the id16 and bitmask32 :P

_________________________________________________

Next we're going to do is add the "Max Vision Distance". to do this add:

Code: Select all

<value>
<type>float</type>
<offset></offset>
<name>Max Vision Distance</name>
</value>
As you can see we've already added the closing value tag, meaning that all the coding for our float is done. To find the offset, change the 'Type' back to the orginal one, in this case it was 'Elite'. And in the Max Vision Distance type in 1, and save.

_________________________________________________

Open the tag in the hex editor again, and now search for '3f 80', which makes sense because 3f 80 means 1.

So when you find take the offset, and subtract from it. Im not going to say subtract what from what, too see if you can follow a tutorial :P

now add the new offset, remembering to add the '0x' to is, to the offset section of our float.

________________________________________________

The last part of this tutorial are 'shorts', unfortantly the actor tag doesnt have many shorts, so now we have to scroll down to "Friends Killed Trigger" under "Unopposable". You can tell when something is a short and not a float, because shorts are always shorter then floats (in guerilla) :P

to add the short add:

Code: Select all

<value>
<type>short</type>
<offset></offset>
<name>Friends Killed Trigger</name>
</value>
To find the offset, just change it to 1 and do a search for 00 01.

_______________________________________________

Now to end the plugin add this

Code: Select all

</struct>
</plugin>
_______________________________________________

Save it as actr.xml in the /plugins folder!

CONGRATS YOU JUST MADE YOUR FIRST PLUGIN!

Please note that i did not conver everything such as string32's and reflexives.

AND always remember to add the '0x' in front of the offset.

Sorry if this tutorial is a bit confusin, im not good at writting complex tutorials O_o
Last edited by Phenomena on Sun Dec 03, 2006 9:51 am, edited 2 times in total.
Thebirthdayhat





Posts: 94
Joined: Mon Nov 15, 2004 7:01 pm
Location: over there

Post by Thebirthdayhat »

yay just wat i asked fro when u posted the program :D .
i mean the plugin creator program, i think u made it right?
Signature exceeded 3 lines of text.
User avatar
Phenomena





Posts: 1510
Joined: Thu Jul 01, 2004 3:25 pm
Location: Training my ducks
Contact:

Post by Phenomena »

yes, yes i did :P
[CL]9mm-Man




Wordewatician 500

Posts: 773
Joined: Tue May 04, 2004 7:14 am
Location: Uranus

Post by [CL]9mm-Man »

Woo nice tutorial there, sure that will help a few people :D
Your image cannot exceed 400x200 or 50kb
Thebirthdayhat





Posts: 94
Joined: Mon Nov 15, 2004 7:01 pm
Location: over there

Post by Thebirthdayhat »

Like me :D . now i can do almost and thing halomdso.com related
make plugins,
hmt/hht/sparkedit.
program,
sig making,
and everything else non xbox related cause i dont have a mod chip :cry:
Signature exceeded 3 lines of text.
HaloKiller





Posts: 59
Joined: Sat Jul 03, 2004 2:35 am
Location: Hmmmmmm... That's a toughie... What is "AT MY COMPUTER"?
Contact:

Post by HaloKiller »

yay for aaron!
kaptainkommie




Wordewatician 500

Posts: 732
Joined: Wed Nov 26, 2003 11:59 pm
Location: Raleigh, NC, USA

Post by kaptainkommie »

stickied.
User avatar
Locke




Socialist Advisor Translator

Posts: 2225
Joined: Fri Aug 06, 2004 1:42 am
Location: Woot.com
Contact:

Post by Locke »

kaptainkommie wrote:stickied.
Lol, I thought this was already stickied. Well, at least someone did it
Image
Feel free to send me an instant message if you need anything.
User avatar
Phenomena





Posts: 1510
Joined: Thu Jul 01, 2004 3:25 pm
Location: Training my ducks
Contact:

Post by Phenomena »

*cough* about time someone sticked this :P w00t first sticky on halomods :D
User avatar
JK-47




Bloodhound Pyre Socialist Grunge

Posts: 10883
Joined: Wed Dec 01, 2004 2:54 pm
Location: Utah

Post by JK-47 »

could someone make a vid. tut for this?
im crap at reading directions, im a visual learner.
Image
PlasmaGhost





Posts: 149
Joined: Wed Oct 05, 2005 12:23 pm

Post by PlasmaGhost »

actually it is already visual as u cant hear nor touch it :wink:
monkey.d.luffy





Posts: 13
Joined: Wed Jun 07, 2006 9:30 am

Post by monkey.d.luffy »

Geurilla?
Dominatr





Posts: 861
Joined: Fri Oct 07, 2005 10:52 pm
Location: Shooting Nazis, Zombies, and anything inhuman

Post by Dominatr »

Guerilla is the tag editor used for Halo Custom Edition (CE). Download Halo CE and the HEK. Then you have guerilla
SquidMan





Posts: 1
Joined: Wed Jan 03, 2007 6:19 pm
Location: In My Awesome AI map.
Contact:

umm... how do i do this...

Post by SquidMan »

i am making a plugin for Weapon HUD Interfaces, but i cant find what kind of value the Maximums are... i tried Float, short and reflexive, but no dice.
wilp





Posts: 89
Joined: Wed Feb 21, 2007 9:09 am

Post by wilp »

how do you know the name you searching in hex (like 00 00 00 01, 00 01 and 3f 80?)
Post Reply