How to add references to a scenario, manually?

Everything about HD, MD, and their mods.

Moderator: Halo Moderators

Post Reply
rEsTnPeAcEz
Veteran
Posts: 291
Joined: Sat Sep 01, 2012 12:34 pm
Location: Canada EHH

How to add references to a scenario, manually?

Post by rEsTnPeAcEz » Sun Jun 23, 2013 2:28 pm

Does anyone know how to add references to a scenario, manually, without any program. I am trying to add a machine reference and spawn without having to use a program, to replace the scenario that already has a machine reference or to use CE software.
Thanks!

WaeV
Peon
Posts: 126
Joined: Tue Aug 28, 2012 11:21 pm
Contact:

Re: How to add references to a scenario, manually?

Post by WaeV » Sun Jun 23, 2013 2:46 pm

rEsTnPeAcEz wrote:manually, without any program
Like, with a magnetized needle and a steady hand, or with a hex editor, or what?
Image

rEsTnPeAcEz
Veteran
Posts: 291
Joined: Sat Sep 01, 2012 12:34 pm
Location: Canada EHH

Re: How to add references to a scenario, manually?

Post by rEsTnPeAcEz » Sun Jun 23, 2013 3:02 pm

lol, with a hex editor, or what ever it is.

Sparky
Delta Force
Posts: 4194
Joined: Wed Mar 31, 2004 8:59 pm
Location: New Jersey, USA
Contact:

Re: How to add references to a scenario, manually?

Post by Sparky » Mon Jun 24, 2013 7:15 am

WaeV wrote:
rEsTnPeAcEz wrote:manually, without any program
Like, with a magnetized needle and a steady hand, or with a hex editor, or what?
That's already provided on the hard drive. All you have to do is spin the wheel like you see on Wheel of Fortune.

RIPz, here are the manual instructions:

Unfortunately, Eschaton does not like working with scnr tag types, and does not properly export the mach tag blocks for some reason. So with all these steps, you would still not be able to import and overwrite the scnr tag back into Eschaton. What you could do, though, is do something similar to this with the map file you're working on, or wait until I add scnr tag support... and map support... to Zeus. Or Samuco can come along and see what I'm saying and add proper machine tag support to swordedit.

Get the mach, lifi or ctrl tags:
1. Open map that has the tags you want to use
2. Recursively extract the tags
3. Close the map

Import the tags:
1. Open and Expand map in Eschaton
2. Recursively import the tags by selecting in the first open dialog window the tag and in the second window the top tags directory
3. Rebuild the map

Add to the scnr tag:
1. Open map in Eschaton
2. Click on the scnr tag
3. Map -> Extract Tag (External)
4. Open the scnr tag's .meta file with a hex editor
5. Set your hex editor to little endian and insertion modes
6. Scroll down to where it says "Machines" in ASCII text
7. After that, you will see:

Code: Select all

00
one byte of 0

Code: Select all

08000000
a four-byte unsigned integer in little endian with the value of 8
This number indicates how many bytes are in the Machines block right after this number. Multiply the number of machines you want times 4, then add 8, and this is the number you should put here.
For example, to add 1 machine instance (chunk) to the map, that's (1 x 4) + 8, which is 12, so the number you would put here is:

Code: Select all

0C000000
8. Then you will have four bytes of 0

Code: Select all

00000000
9. Then you will have a four-byte unsigned integer in little endian with the value of 0. Change it to however many machine instances (chunks) you want in the map. For example, if you are going to have 224 machines like in a10.map, the value would be:

Code: Select all

E0000000
For 1 machine, as in our continued example, change this to:

Code: Select all

01000000
10. For every machine chunk you want in the map, insert four bytes of FF's after that. So for 2 machines, step 9 would be:

Code: Select all

02000000
and you would insert after that:

Code: Select all

FF FF FF FF FF FF FF FF
8 bytes of FF's
For our continued example of 1 machine, insert only four bytes of FF's:

Code: Select all

FFFFFFFF
11. Right after that is the "Controls" ASCII text for the Controls block, don't touch that.
12. Now open the corresponding .xml file with TextWrangler, which is free from the AppStore.
13. You should see some Dependency entries. Look at the ones that say

Code: Select all

tagclass="ihev"
These are the vehicle dependencies. After the last vehicle entry is where the mach tag type entries would typically go, but since Eschaton manhandles these anyway upon rebuilding maps, which is what we do when we import tags into maps with Eschaton, then you can simply scroll down to the bottom of the .xml file and insert the following line just before the closing </Results>:

Code: Select all

<Dependency location="0x1CCC" tagclass="hcam" filename="levels\a10\devices\doors\door airlock\door airlock"/>
For each sequential dependency reference (this is going to be a different KIND of machine) add 0x30 to the location value.
Change the filename value to the name of your tag by selecting the mach tag in Eschaton and doing command-c, which copies the tag pathname, and pasting it into the filename here. You only need one Dependency entry per filename.

14. Back in the .meta file in the hex editor, search for the ASCII text "ihev". You should see 48-byte blocks beginning with "ihev" for every vehicle palette chunk (one for each kind of vehicle in the map). After the last 48-byte block, you have machine instance (chunk) blocks which are 64 bytes each. You can simply insert this code, which will give you two machines of two different kinds:

Code: Select all

0000000000000000000000400000404000008040C2B8B23D5077D63DDD35FA3D0000000000000000FFFFFFFF01000000040000000000000000000000000000000100000000000000000000400000404000008040C2B8B23D5077D63DDD35FA3D0000000000000000FFFFFFFF0100000004000000000000000000000000000000
If you want to know about this, I could tell you, but it's all the metadata for the scnr tag's machines block. There are 128 bytes there, but you can just do 64 bytes of it for a single machine entry:

Code: Select all

0000000000000000000000400000404000008040C2B8B23D5077D63DDD35FA3D0000000000000000FFFFFFFF0100000004000000000000000000000000000000
15. Right after that, insert the following:

Code: Select all

6863616DC376454000000000BC0130E30000000000000000000000000000000000000000000000000000000000000000
This is the tag type name "hcam" followed by a random 4-byte number (it can be random for us), 4 bytes of 0, and another random 4-byte number. Just duplicate this entry for every type of machine you would like in the map, changing the random numbers to anything between 10,000 and 1 billion (as safe bets).

That's all. If you could, you would then non-recursively import the scnr tag into your map file of the same halo version, delete the older scenario tag, and rebuild. But Eschaton doesn't let you replace scnr tags like this yet. So you'll have to do what I mentioned at the start here.
Last edited by Sparky on Mon Jun 24, 2013 9:25 am, edited 1 time in total.
Either you are groping for answers, or you are asking God and listening to Jesus.

rEsTnPeAcEz
Veteran
Posts: 291
Joined: Sat Sep 01, 2012 12:34 pm
Location: Canada EHH

Re: How to add references to a scenario, manually?

Post by rEsTnPeAcEz » Mon Jun 24, 2013 7:23 am

Not sure if it is with hex editor or something else.

Excend
Commando
Posts: 2791
Joined: Sun May 06, 2007 3:27 am
Location: SiK x Gh0sTs Rehauled.
Contact:

Re: How to add references to a scenario, manually?

Post by Excend » Mon Jun 24, 2013 7:26 am

As far as I'm aware, it's impossible to get machines working with just hexedit.

Edit: Wait what? You're not sure if you want to use a hex editor or not?
TaxiService wrote:Roses are red
Violets are blue
What a shitty thread
Fuck all of you.

Sparky
Delta Force
Posts: 4194
Joined: Wed Mar 31, 2004 8:59 pm
Location: New Jersey, USA
Contact:

Re: How to add references to a scenario, manually?

Post by Sparky » Mon Jun 24, 2013 9:27 am

um. see my edit.
White Knightmare wrote:As far as I'm aware, it's impossible to get machines working with just hexedit.

Edit: Wait what? You're not sure if you want to use a hex editor or not?
From now on, it would be wise to never use that word again except for very singular circumstances, nothing related to this Halo sub-forum, anyway.
Either you are groping for answers, or you are asking God and listening to Jesus.

rEsTnPeAcEz
Veteran
Posts: 291
Joined: Sat Sep 01, 2012 12:34 pm
Location: Canada EHH

Re: How to add references to a scenario, manually?

Post by rEsTnPeAcEz » Mon Jun 24, 2013 10:41 am

I am confused of the 14th step and the 15th, help?

EDIT: Never mind, I think I got it.
Also is it possible for to do what you said: Import scnr tag to map then delete older, but then use scenario swapper to swap scenarios?
Last edited by rEsTnPeAcEz on Mon Jun 24, 2013 10:53 am, edited 1 time in total.

Excend
Commando
Posts: 2791
Joined: Sun May 06, 2007 3:27 am
Location: SiK x Gh0sTs Rehauled.
Contact:

Re: How to add references to a scenario, manually?

Post by Excend » Mon Jun 24, 2013 10:48 am

@Sparky
White Knightmare wrote:As far as I'm aware
I believe this disclaimer covers me, because as far as I am aware it is impossible.

Also, I'm sure your post will help him and thank you for the information but:
rEsTnPeAcEz wrote:with a hex editor
White Knightmare wrote:with just hexedit.
@RIP
14. Just paste in the code, the first one is for 2 machines I believe and the second one is for just one machine.

15. Comes after adding all machines.
TaxiService wrote:Roses are red
Violets are blue
What a shitty thread
Fuck all of you.

Sparky
Delta Force
Posts: 4194
Joined: Wed Mar 31, 2004 8:59 pm
Location: New Jersey, USA
Contact:

Re: How to add references to a scenario, manually?

Post by Sparky » Mon Jun 24, 2013 12:18 pm

An application is simply a fancy binary editor. A hex editor is simply a fancy binary editor. The Halo Editing Kit is simply a fancy binary editor. Eschaton and Zeus are simply fancy binary editors.
Yes, it can be done only in a hex editor. That is why I said to not so carelessly throw around the word "impossible". It simply takes more work to do it "manually" in a hex editor, and it would take even more work to do it "manually" in a binary editor. And it simply takes less work to do it in a fancy editor like Eschaton or Zeus.

These are simply degrees of effort required, depending upon the number of pre-made templates you have!

RIPz, it would be the least amount of work to directly modify your map in hex code; but then you will likely have to open and expand the map in Eschaton again and rebuild. It might not even open in Eschaton -- it might crash because the offsets are wrong. That's why I suggested doing it with a single tag so you don't bother with offsets at all. The last thing you want to do is update several thousand offsets with a hex editor that is not meant to natively handle any particular file type like this or do any work for you in that regard.

Experiment. But this tutorial I did for you is the first of its kind. That I know of. But that doesn't make it impossible. :wink:
Either you are groping for answers, or you are asking God and listening to Jesus.

rEsTnPeAcEz
Veteran
Posts: 291
Joined: Sat Sep 01, 2012 12:34 pm
Location: Canada EHH

Re: How to add references to a scenario, manually?

Post by rEsTnPeAcEz » Mon Jun 24, 2013 12:49 pm

Thanks. Also I have a comment: The reflexive in the scenario tag using a meta editor is not visible, I can't see the stuff saying "Machines", "Machine Palette" and also "Device Groups" if I wanted to. Have any idea how to do it? Unless I wanted to I can use your Scenario Madness template and basically restart my mod, which I didn't want to do.

For some reason I am not able to delete the older scenario tag in the map, when I try deleting with Eschaton when the map is expanded it says there is an error and it would not delete. Only the one added can delete. Have any idea how it can be deleted?

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 43 guests