Mainmenu: -1000- Maps slots!

This forum is for files only, Utilities and Hacks go here, not skins.
selyb





Posts: 32
Joined: Sun Mar 19, 2006 7:23 am

Post by selyb »

here is a script i wrote to do the conversion for you
i downloaded all the latest plugins from phoenic and i had to edit the goof plugin to work

basically this script looks for lines beginning with '<unused' and replaces it with multiple floats, shorts, and bytes adding up to the original size of the unused section

if it messes up something then please let me know what it did
dont ask for help with edited plugins, i'll only help with using this script on the latest unedited plugins


open notepad, paste this text, save in ent folder as convert.vbs, close notepad and double click convert.vbs

Code: Select all

Option Explicit

Dim fso			'filesystemobject, used for reading/creating files and folders
Dim oInFile		'this will be the ent plugin being read
Dim oOutFile	'this will be the ent plugin written to the output folder
Dim x				'i use this for a generic counter in a loop
Dim sLine			'this will be the current line read from the input file
Dim iOffset		'this will be the offset of the unused section
Dim oFile			'this is the current file object used in the loop checking the current directory for ent files
Dim iFileCount	'this is the counter to tell how many ent plugins were converted
Dim iNumFloats	'this will tell how many times to add a float line
Dim iBegin		'this will be used to store the beginning byte of the unused tag in the current line read from the input file
Dim iSizeBegin		'this will be used to store the beginning byte of the size parameter in the current line read from the input file
Dim iOffsetBegin		'this will be used to store the beginning byte of the Offset parameter in the current line read from the input file
Const sOutputDir = "Converted Ent Plugins\"	'This needs to end with a backslash

Set fso = CreateObject("Scripting.FileSystemObject")
If Not fso.FolderExists(sOutputDir) Then fso.CreateFolder sOutputDir	'If the output directory doesnt exist then create it
iFileCount = 0		'we havent processed any ent files yes

For Each oFile In fso.GetFolder(".").Files
	If RightB(oFile.Name, 8) = ".ent" Then		'only process ent files
		Set oInFile = oFile.OpenAsTextStream		'this returns the textstream object of the current input file
		Set oOutFile = fso.CreateTextFile(sOutputDir & oFile.Name, True)		'this creates the current output file
		Do Until oInFile.AtEndOfStream		'we run a loop until the end of the file
			sLine = oInFile.ReadLine		'read one line
			If LenB(sLine) Then				'dont try to process empty lines
				iBegin = InStrB(LCase(sLine), "<unused")		'find the beginning of the 'unused' tag
				If iBegin Then												'if it doesnt contain unused then iBegin will contain 0 so this would be false
					iSizeBegin = InStrB(LCase(sLine), "size=")		'if it does contain 'unused' then find the position of the size parameter
					If iSizeBegin Then		
						iSizeBegin = iSizeBegin + 12		'if it does have a size param, then get the position immediately after size="
					Else
						Msgbox "Fix " & oFile.Name & vbNewLine & sLine		'if it doesnt have a size param then notify the user to fix this file and exit the script
						oInFile.Close
						oOutFile.Close
						WScript.Quit
					End If
					iNumFloats = MidB(sLine, iSizeBegin, InStrB(iSizeBegin, LCase(sLine), """") - iSizeBegin)			'this retrieves just the number in quotes immediately after size=
					iNumFloats = iNumFloats					'take the size and divide it by 4 since floats are 4 bytes and we need to take up all bytes of the unused data using floats
					iOffsetBegin = InStrB(LCase(sLine), "offset=")			'find the beginning of the offset param
					If iOffsetBegin Then
						iOffsetBegin = iOffsetBegin + 16			'if it does contain an offset param, then skip to the beginning of the value
					Else
						Msgbox "Fix " & oFile.Name & vbNewLine & sLine		'if it doesnt contain an offset param then notify the user and quit the script
						oInFile.Close
						oOutFile.Close
						WScript.Quit
					End If
					iOffset = MidB(sLine, iOffsetBegin, InStrB(iOffsetBegin, LCase(sLine), """") - iOffsetBegin)		'this gets the number in quotes after 'offset='
					If iNumFloats > 3 Then
						For x = 0 To (iNumFloats / 4) - 1																'loop once for each float
							If iBegin > 1 Then oOutFile.Write LeftB(sLine, iBegin - 1)			'if there were tabs or spaces before the beginning of '<unused' then put them back
							oOutFile.WriteLine  "<float name=""Unused"" offset=""" & iOffset & """ visible=""False"" />"		'add each float compensating for the unused section
							iNumFloats = iNumFloats - 4		'subtract one float from iNumFloats so we can check after all loops to make sure all bytes of size were procesed
							iOffset = iOffset + 4				'adjust the offset for the next line
						Next
					End If
					If iNumFloats AND 2 Then
						If iBegin > 1 Then oOutFile.Write LeftB(sLine, iBegin - 1)			'if there were tabs or spaces before the beginning of '<unused' then put them back
						oOutFile.WriteLine "<short name=""Unused"" offset=""" & iOffset & """ visible=""False"" />"
						iNumFloats = iNumFloats - 2		'subtract one short from iNumFloats so we can check after all loops to make sure all bytes of size were procesed
						iOffset = iOffset + 2				'adjust the offset for the next line
						If iNumFloats Then
							If iBegin > 1 Then oOutFile.Write LeftB(sLine, iBegin - 1)			'if there were tabs or spaces before the beginning of '<unused' then put them back
							oOutFile.WriteLine "<byte name=""Unused"" offset=""" & iOffset & """ visible=""False"" />"
							iNumFloats = iNumFloats - 1			'subtract one byte from iNumFloats so we can check to make sure all bytes are accounted for
						End IF
					ElseIf iNumFloats Then
						If iBegin > 1 Then oOutFile.Write LeftB(sLine, iBegin - 1)			'if there were tabs or spaces before the beginning of '<unused' then put them back
						oOutFile.WriteLine "byte name=""Unused"" offset=""" & iOffset & """ visible=""False"" />"
						iNumFloats = iNumFloats - 1
					End If
					If iNumFloats Then MsgBox "Something went wrong!" & vbNewLine & "iNumFloats = " & iNumFloats & vbNewLine & "sLine: " & sLine & vbNewLine & oFile.Name: WScript.Quit
				Else				'if this isnt an 'unused' section then just pass it on to the new file
					oOutFile.WriteLine sLine
				End If
			Else					'if this is a blank line then pass it on to the new file
				oOutFile.WriteLine
			End If
		Loop
		iFileCount = iFileCount + 1	'add one to the counter of ent files processed
	End If
Next

WScript.Echo "Finished!"
WScript.Quit
i've uploaded the plugins that i converted including the goof that i had to edit by hand before using the script on it
Attachments
Converted Ent Plugins.zip
fixed missing < in goof.ent
(99.61 KiB) Downloaded 35 times
Last edited by selyb on Mon Jul 23, 2007 10:27 am, edited 2 times in total.
-DeToX-




Illusionist Recreator Connoisseur Acolyte
Sigma Decryptor Droplet Pyre
Blacksmith Socialist New Age System Engineer
ONI

Posts: 4589
Joined: Sun Jun 18, 2006 3:58 pm
Location: ...

Post by -DeToX- »

neodos wrote:Here's an example:

You have:
<unused offset="64" size="28" />

You change it like this:

<float name="Unused" offset="64" visible="True" />
<float name="Unused" offset="68" visible="True" />
<float name="Unused" offset="72" visible="True" />
<float name="Unused" offset="76" visible="True" />
<float name="Unused" offset="80" visible="True" />
<float name="Unused" offset="84" visible="True" />
<float name="Unused" offset="88" visible="True" />
Techincally Offset for the floats doesn't matter. Entity disregards them. It just reads on.

You just need the Size.

But I would like to say, good job. Keep it up. :wink:
Image
selyb





Posts: 32
Joined: Sun Mar 19, 2006 7:23 am

Post by selyb »

-DeToX- wrote: Techincally Offset for the floats doesn't matter. Entity disregards them. It just reads on.

You just need the Size.

But I would like to say, good job. Keep it up. :wink:
hmmm, thats good to know...
i made the script to follow the format of the other plugins i got from pheonic which had the offset but not the size

here are two examples of output from the script

from bipd.ent
old

Code: Select all

  <struct name="Unknown" offset="424" visible="false" size="24" label="">
    <unused offset="0" size="4" />
    <unused offset="4" size="8" />
    <undefined name="Unknown" offset="12" visible="False" />
    <undefined name="Unknown" offset="16" visible="False" />
    <float name="Unknown" offset="20" visible="False" />
  </struct>
  <float name="Grenade Velocity" offset="432" visible="True" />
new

Code: Select all

<struct name="Unknown" offset="424" visible="false" size="24" label="">
    <float name="Unused" offset="0" visible="False" />
    <float name="Unused" offset="4" visible="False" />
    <float name="Unused" offset="8" visible="False" />
    <undefined name="Unknown" offset="12" visible="False" />
    <undefined name="Unknown" offset="16" visible="False" />
    <float name="Unknown" offset="20" visible="False" />
  </struct>
  <float name="Grenade Velocity" offset="432" visible="True" />
  
from ssce.ent
old

Code: Select all

  <unused offset="144" size="4" />
  <struct name="Unknown26" offset="148" visible="false" size="24" label="">
    <tag name="Unknown" offset="0" visible="False" />
    <id name="Unknown" offset="4" visible="False" />
    <unused offset="8" size="16" />
  </struct>
  <unused offset="156" size="32" />
  <float name="Unknown" offset="188" visible="False" />
new

Code: Select all

  <float name="Unused" offset="144" visible="False" />
  <struct name="Unknown26" offset="148" visible="false" size="24" label="">
    <tag name="Unknown" offset="0" visible="False" />
    <id name="Unknown" offset="4" visible="False" />
    <float name="Unused" offset="8" visible="False" />
    <float name="Unused" offset="12" visible="False" />
    <float name="Unused" offset="16" visible="False" />
    <float name="Unused" offset="20" visible="False" />
  </struct>
  <float name="Unused" offset="156" visible="False" />
  <float name="Unused" offset="160" visible="False" />
  <float name="Unused" offset="164" visible="False" />
  <float name="Unused" offset="168" visible="False" />
  <float name="Unused" offset="172" visible="False" />
  <float name="Unused" offset="176" visible="False" />
  <float name="Unused" offset="180" visible="False" />
  <float name="Unused" offset="184" visible="False" />
  <float name="Unknown" offset="188" visible="False" />
User avatar
xzodia




Translator Connoisseur Coagulator

Posts: 1981
Joined: Sun May 15, 2005 10:31 am
Location: UK
Contact:

Post by xzodia »

good work.
Image
Halo 2 Plugins | Lock-on To Just About Anything | My Sites | Snow Hog
Old Plugins you have, upgrade you must...
Always Maintain a High Quality-To-Crap Ratio.
OwnZ joO




Articulatist 500

Posts: 980
Joined: Thu Nov 10, 2005 4:24 pm

Post by OwnZ joO »

So are we on the way to having solidly working plugins then?
User avatar
neodos
Readers Club




Artisan Miner

Posts: 1394
Joined: Thu Aug 12, 2004 11:57 am

Post by neodos »

Good job on the script =O

OwnZ joO if the script or an app replace the unused by floats on all the plugins then yes, not more broken idents just proper clonning :mrgreen:
User avatar
Geo
Forum Manager




Illusionist Stylist Advisor Pi
Connoisseur Pyre Socialist Tsunami

Posts: 4404
Joined: Sun Jun 19, 2005 1:01 am
Location: United Kingdom
Contact:

Post by Geo »

First one to fill a mainmenu with 1000 unique maps and their respective preview bitmaps wins me. Yes, that's right.

Winner. Gets. Me.
Image
For extremely cheap web hosting and domains, PM me. Includes excellent control panel software and instant activation!
Juniorman030790





Posts: 745
Joined: Mon Feb 14, 2005 1:09 pm
Contact:

Post by Juniorman030790 »

so will this allow mimesis to have 1000 map slots?
Image
User avatar
Agent ME




Articulatist 500

Posts: 881
Joined: Tue Jun 21, 2005 6:00 pm
Location: California, USA
Contact:

Post by Agent ME »

No, because that would require the user to run a modified mainmenu, but the point of Mimesis is to do things through DLC and still let the user play from a disk.
selyb





Posts: 32
Joined: Sun Mar 19, 2006 7:23 am

Post by selyb »

Agent ME wrote:No, because that would require the user to run a modified mainmenu, but the point of Mimesis is to do things through DLC and still let the user play from a disk.
um... this thread IS about a modded mainmenu
User avatar
Agent ME




Articulatist 500

Posts: 881
Joined: Tue Jun 21, 2005 6:00 pm
Location: California, USA
Contact:

Post by Agent ME »

I was replying to the post above me about having Mimesis somehow use this to break the 50-map limit.
selyb





Posts: 32
Joined: Sun Mar 19, 2006 7:23 am

Post by selyb »

ok, i must have misunderstood what you were trying to answer

@JuniorMan and any other noobs, Mimesis never had a 50 map limit, the mainmenu does, if you use this mod to raise that limit then it should work for DLC as well

if you are playing from an original disk, this wont help you
User avatar
Redspike





Posts: 109
Joined: Sat Apr 03, 2004 8:19 am
Location: England

Post by Redspike »

some one should sticky this. id hate to see it dissapear.

good work btw !
Image
User avatar
scynide




Articulatist 100

Posts: 257
Joined: Fri Feb 17, 2006 1:32 pm
Location: Salida, CO, U.S.A.

Post by scynide »

Redspike wrote:some one should sticky this. id hate to see it dissapear.

good work btw !
It was stickied for a short amount of time. By the way guys I got mine working the other day. Worked like a charm. I now have 100 slots on my personal mainmenu and it loads up just fine. Now to start filling them in. :wink: I won't ever have to worry about Mimesis content interfering with the maps that I really want ever again. Wow, I just checked and Mimesis had an update recently. And I though they were pretty much dead. :)
Image
OwnZ joO




Articulatist 500

Posts: 980
Joined: Thu Nov 10, 2005 4:24 pm

Post by OwnZ joO »

Yeah I think this should be stickied, it's a nice feature to have that lots of people would like.
User avatar
DarkShallFall




Artisan Recreator Trickster Connoisseur
Advisor Pyre Renovator Sigma
Snitch! Enthraller New Age Miner

Posts: 1992
Joined: Fri Jan 20, 2006 2:49 pm
Location: MI, USA
Contact:

Post by DarkShallFall »

This deservers a stickie or outstanding, My reasoning is that this hasnt been done before so it is new to the community. Also if it has been done it hasnt been released. Dont treat people unfair because of there rank or respect level on teh forum. Im not saying this because neodos is a teammate but because if this doesnt count as new, hot, cool, outstanding then delete half the outstanding mods section(but not biohazard). I dont post half my mods because of some of these reasons. And i think people should notice smaller things. Sorry if i may have bumped.
-Darkshallfall
Image
Iron_Forge wrote:I assume I won?..I should get an emblem...
OwnZ joO




Articulatist 500

Posts: 980
Joined: Thu Nov 10, 2005 4:24 pm

Post by OwnZ joO »

Not everything that hasn't been done before gets into the outstanding section, I think he should write a tutorial for the tutorials section and that should get stickied.

I remember lots of things that haven't been done before not getting into outstanding or even stickies. For example some new guy(can't remember his name) accidentally modding something in the bipd tag using a hex editor so he could press the thumbstick and respawn, almost like teleporting to a spawn place without getting a death.

This isn't really that big of a breakthrough, if you look at it he noticed a bug that nobody else noticed, which is impressive, but he just figured out a way to fix a glitch in a program, and then pressed a few buttons. Maybe I don't appreciate this because I don't make big map packs, but it just doesn't seem that outstanding to me, having 1000 maps doesn't sound that appealing to me.
User avatar
neodos
Readers Club




Artisan Miner

Posts: 1394
Joined: Thu Aug 12, 2004 11:57 am

Post by neodos »

Ok, it doesn't just fix the map slots, it's a way to fix the chunks cloning, tags cloning, and a way to get rid of those broken idents, got it?
User avatar
DoorM4n
Readers Club




Artisan Commentator

Posts: 2530
Joined: Mon Aug 15, 2005 2:48 pm
Location: Smurf Village Team: Team DeFiance

Post by DoorM4n »

People have wanted to do this since the beginning of halo 2 modding. (and yes I have been here since the beginning) Congratulations on figuring it out and releasing it!

I only have the stock hdd allowing me to put halo and halo 2 on the hdd. However, now it's time to start adding mods!
The maximum signature size is 500x120px at 75kb.
Hawaiian Modder




Pi Connoisseur

Posts: 2154
Joined: Sat Nov 26, 2005 7:17 pm
Location: In a cave smokin up with tupac and big foot.

Post by Hawaiian Modder »

O SHI-
neados, your gonna be the second person to get the pi emblem first. :P

I tried it again and It worked.
Great Job neados. :D
Image
Thanks lej for the sig.
Dr.Cox wrote:I like Cox.
Post Reply