Mw2 HUD Elements TU8

XeVexed Jan 28, 2013

  1. XeVexed

    XeVexed Banned BANNED
    0/47

    Joined:
    Nov 20, 2012
    Messages:
    60
    Likes Received:
    10
    Trophy Points:
    0
    Gender:
    Male
    Location:
    Riverside, CA
    Console:
    Xbox
    --- MW2 TU8 HUD Elements ---
    - This is for TU8, they are the HUD elements to create shaders, text, etc.​
    - Enjoy, hopefully, this helps people into figuring out other cool things they can do inside of .DLLs and .xexs or even encourage people to build programs that have shortcuts!​

    Step 1:​
    Add this to your code:​

    Code:
    Code:
    		public class gameAddresses
    		{
    			public static uint
    			serverCommand = 0x82254940,
    			entityBase = 0x82F03600,
    			entityMultiplier = 0x280, //Entity Multiplier mp
    			clientCommand = 0x82224A28,
    			nameOffset = 0x3208,
    			buttonsOffset = 0x31B6,
    			movementOffset = 0x3420,
    			playerStateOffset = 0x158, //Player State Offset From Entity mp
    			initAmmo = 0x821D4A00, //Init Ammo mp
    			getWeaponID = 0x82210640, //Get Weapon ID mp
    			givePlayerWeapon = 0x82210BC8, //G_GivePlayerWeapon mp
    			setModel = 0x8220D310, //Set Model
    			locString = 0x8220C838,
    			material = 0x8220C9F8,
    			elem = 0x821DF9C0,
    			xOffset = 0x08,
    			yOffset = 0x04,
    			textOffset = 0x84,
    			fontOffset = 0x28,
    			fontSizeOffset = 0x14,
    			colorOffset = 0x34,
    			relativeOffset = 0x2c,
    			widthOffset = 0x48,
    			heightOffset = 0x44,
    			shaderOffset = 0x4C,
    			alignOffset = 0x30;
    
    		}
    How to cache an Element: (returns * address):

    Code:
    Code:
    					XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, gameAddresses.elem);
    					XDRPCArgumentInfo<int> client = new XDRPCArgumentInfo<int>(0);
    					XDRPCArgumentInfo<int> team = new XDRPCArgumentInfo<int>(0);
    					uint elemAddr = xbCon.ExecuteRPC<uint>(options, new XDRPCArgumentInfo[] { client, team });
    
    How to set an element on a specific player:
    
    Code:
    public uint spawnElem(int player, uint elemAddress)
    		{
    				SetMem(ReverseBytes(BitConverter.GetBytes(player)), elemAddress + 0xA8);
    				return elemAddress;
    
    		}
    How to cache unlocalized strings and get material index:

    Code:
    Code:
    		public uint cacheText(string text)
    		{
    			XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, gameAddresses.locString);
    			XDRPCStringArgumentInfo txt = new XDRPCStringArgumentInfo(text);
    			uint ind = xbCon.ExecuteRPC<uint>(options, new XDRPCArgumentInfo[] { txt });
    			return ind;
    		}
    		public uint getMaterialIndex(string material)
    		{
    			XDRPCExecutionOptions optionz = new XDRPCExecutionOptions(XDRPCMode.Title, gameAddresses.material);
    			XDRPCStringArgumentInfo name = new XDRPCStringArgumentInfo(material);
    			uint de = xbCon.ExecuteRPC<uint>(optionz, new XDRPCArgumentInfo[] { name });
    
    			return (de);
    		}
    How to set an icon or shader:

    Code:
    Code:
    		public void setIcon(uint elem, uint shader, int width, int height, float x, float y, uint align, float sort = 0, int r = 255, int g = 255, int b = 255, int a = 255)
    		{
    				SetMem(new byte[] { 0x00, 0x00, 0x00, 0x04 }, elem);
    				SetMem(uintBytes(0x05), elem + gameAddresses.relativeOffset);
    				SetMem(uintBytes(0x06), elem + gameAddresses.relativeOffset - 4);
    				SetMem(uintBytes(shader), elem + gameAddresses.shaderOffset);
    				SetMem(ReverseBytes(BitConverter.GetBytes(height)), elem + gameAddresses.heightOffset);
    				SetMem(ReverseBytes(BitConverter.GetBytes(width)), elem + gameAddresses.widthOffset);
    				SetMem(uintBytes(align), elem + gameAddresses.alignOffset);
    				SetMem(new byte[] { BitConverter.GetBytes(r)[0], BitConverter.GetBytes(g)[0], BitConverter.GetBytes(B)[0], BitConverter.GetBytes(a)[0] }, elem + gameAddresses.colorOffset);
    				SetMem(ReverseBytes(BitConverter.GetBytes(sort)), elem + gameAddresses.textOffset + 4);
    				SetMem(ReverseBytes(BitConverter.GetBytes(x)), elem + gameAddresses.xOffset);
    				SetMem(ReverseBytes(BitConverter.GetBytes(y)), elem + gameAddresses.yOffset);
    
    			}
    How to set text:

    Code:
    Code:
    		public void setText(uint elem, byte[] text, uint font, float fontScale, float x, float y, uint align, int r = 255, int g = 255, int b = 255, int a = 255)
    		{
    				SetMem(new byte[] { 0x00, 0x00, 0x00, 0x01 }, elem);
    
    				SetMem(text, elem + gameAddresses.textOffset + 2);
    				SetMem(uintBytes(0x05), elem + gameAddresses.relativeOffset);
    				SetMem(uintBytes(0x06), elem + gameAddresses.relativeOffset - 4);
    				SetMem(uintBytes(font), elem + gameAddresses.fontOffset);
    				SetMem(uintBytes(align), elem + gameAddresses.alignOffset);
    				SetMem(new byte[] { 0x40, 0x00 }, elem + gameAddresses.textOffset + 4);
    				SetMem(ReverseBytes(BitConverter.GetBytes(fontScale)), elem + gameAddresses.fontSizeOffset);
    				SetMem(ReverseBytes(BitConverter.GetBytes(x)), elem + gameAddresses.xOffset);
    				SetMem(ReverseBytes(BitConverter.GetBytes(y)), elem + gameAddresses.yOffset);
    				SetMem(new byte[] { BitConverter.GetBytes(r)[0], BitConverter.GetBytes(g)[0], BitConverter.GetBytes(B)[0], BitConverter.GetBytes(a)[0] }, elem + gameAddresses.colorOffset);
    
    		}
    
    Credits to Carter (Teh1337)
     
  2. Coder123

    Coder123 Finnish Modder XPG Developer TeamXPG
    105/188

    Joined:
    Jan 21, 2012
    Messages:
    1,953
    Likes Received:
    717
    Trophy Points:
    105
    Gender:
    Male
    Location:
    Finland
    Console:
    Xbox
    Just like in the BO1 offset thread you did not give credits... Credits should be given to Carter for his release [this thread], or did you get this by yourself? lol.....
     
  3. XPGProgrammer

    XPGProgrammer Newbie
    0/47

    Joined:
    Jan 2, 2013
    Messages:
    802
    Likes Received:
    214
    Trophy Points:
    0
    Gender:
    Male
    Location:
    Canada
    Console:
    Xbox
    No credits to Carter? ...
     
  4. XeVexed

    XeVexed Banned BANNED
    0/47

    Joined:
    Nov 20, 2012
    Messages:
    60
    Likes Received:
    10
    Trophy Points:
    0
    Gender:
    Male
    Location:
    Riverside, CA
    Console:
    Xbox
    Lol, I believe credits were given...
     
  5. XeVexed

    XeVexed Banned BANNED
    0/47

    Joined:
    Nov 20, 2012
    Messages:
    60
    Likes Received:
    10
    Trophy Points:
    0
    Gender:
    Male
    Location:
    Riverside, CA
    Console:
    Xbox
    What are you talking about? It's there.
     

Share This Page

Close