Post: Set Waypoints + Objectives [C#]
05-08-2014, 11:19 AM #1
Shark
Retired.
(adsbygoogle = window.adsbygoogle || []).push({}); Hey, I saw seb attempted to release something similar for ghost but idk he failed it and it didn't have way points so I spent the last few days working on it and I have finally succeeded! so yea anyway I have no use for this and think keeping shit secret is dumb.... so enjoy!

Pastebin Link: You must login or register to view this content.

    
class Offsets
{
public static uint
G_HudElems = 0x15DDB00,
G_MaterialIndex = 0x276020,
}

public class ObjStruct
{
public static uint
ObjectiveIndex = 0x1608194,
ObjectiveIndexLength = 0x30,
Origin = 0x04,
X = 0x04,
Y = 0x08,
Z = 0x0C,
targetEntNum = 0x10,
MaterialIndex = 0x1C,
State = 0x28,
Team = 0x2D;
}

public class HudStruct
{
public static uint
ElemIndex = Offsets.G_HudElems,
HudsLength = 0x88,
X = 0x00,
Y = 0x04,
Z = 0x08,
FontSize = 0xC,
fromFontScale = 0x10,
fontScaleStartTime = 0x14,
color = 0x18,
fromColor = 0x1C,
fadeStartTime = 0x20,
scaleStartTime = 0x24,
fromX = 0x28,
fromY = 0x2C,
moveStartTime = 0x30,
time = 0x34,
duration = 0x38,
value = 0x3C,
sort = 0x40,
glowColor = 0x44,
fxBirthTime = 0x48,
flags = 0x4C,
targetEntNum = 0x50,
fontScaleTime = 0x52,
fadeTime = 0x54,
label = 0x56,
Width = 0x58,
Height = 0x5A,
fromWidth = 0x5C,
fromHeight = 0x5E,
scaleTime = 0x60,
moveTime = 0x62,
text = 0x64,
fxLetterTime = 0x66,
fxDecayStartTime = 0x68,
fxDecayDuration = 0x6A,
fxRedactDecayStartTime = 0x6C,
fxRedactDecayDuration = 0x6E,
type = 0x70,
Font = 0x71,
alignOrg = 0x72,
alignScreen = 0x73,
materialIndex = 0x74,
offscreenMaterialIndex = 0x75,
fromAlignOrg = 0x76,
fromAlignScreen = 0x77,
soundID = 0x78,
ui3dWindow = 0x79,
flag2 = 0x7A,
clientOffset = 0x7C,
team = 0x80,
abilityFlag = 0x84;
}

private static uint HudElem_Alloc()
{
for (uint i = 120; i < 1024; i++)
{
uint Index = Offsets.G_HudElems + (i * HudStruct.HudsLength);
if (Lib.ReadByte(Index + HudStruct.type) == 0)
{
Lib.WriteBytes(Index, new byte[0x88]);
return Index;
}
}
return 0;
}

private static uint Objective_Alloc()
{
for (uint i = 3; i <= 31; i++)
{
uint Index = ObjStruct.ObjectiveIndex + (i * ObjStruct.ObjectiveIndexLength);
if (Lib.ReadInt32(Index) == 0)
{
Lib.WriteBytes(Index, new byte[0x30]);
return Index;
}
}
return 0;
}


public static void Huds_DestroyAll()
{
for (uint i = 60; i < 0x400; i++)
{
PS3.SetMemory(Offsets.G_HudElems + (i * HudStruct.HudsLength), new byte[HudStruct.HudsLength]);
}
}


public static void Objective_DestroyAll()
{
for (uint i = 3; i <= 31; i++)
{
uint Index = ObjStruct.ObjectiveIndex + (i * ObjStruct.ObjectiveIndexLength);
Lib.WriteBytes(Index, new byte[ObjStruct.ObjectiveIndexLength]);
}
}

public static int getMaterialIndex(string Material)
{
return (int)RPC.Call(Offsets.G_MaterialIndex, Material);
}

public static void SetObjective(Int16 onEntity = 0x3FF, Object Material = null, Single[] Position = null)
{
UInt32 Objective = Objective_Alloc();
Lib.WriteInt32(Objective, 1);
Lib.WriteSingle(Objective + ObjStruct.Origin, Position);
Lib.WriteInt16(Objective + ObjStruct.targetEntNum, onEntity);
if (Material is String)
{ Lib.WriteInt32(Objective + ObjStruct.MaterialIndex, (Int16)getMaterialIndex((String)Material)); }
if (Material is Int32)
{ Lib.WriteInt32(Objective + ObjStruct.MaterialIndex, (Int32)Material); }
}

public static uint SetWaypoint(Int32 clientIndex = 0x3FF, Int16 onEntity = 0x3FF, Object Material = null, Single[] Position = null, Int32 R = 255, Int32 G = 255, Int32 B = 255, Int32 A = 255)
{
uint Waypoint = HudElem_Alloc();
Lib.WriteByte(Waypoint + HudStruct.type, 0xF);//0xF = Waypoint
if (Material is String)
{ Lib.WriteByte(Waypoint + HudStruct.offscreenMaterialIndex, Convert.ToByte(getMaterialIndex((String)Material))); }
if (Material is Int32)
{ Lib.WriteByte(Waypoint + HudStruct.offscreenMaterialIndex, Convert.ToByte(Material)); }
Lib.WriteSingle(Waypoint, Position);
Lib.WriteInt32(Waypoint + HudStruct.clientOffset, clientIndex);
Lib.WriteInt16(Waypoint + HudStruct.targetEntNum, onEntity);
Lib.WriteByte(Waypoint + HudStruct.ui3dWindow, 0xFF);
Lib.WriteBytes(Waypoint + HudStruct.color, new Byte[] { (Byte)R, (Byte)G, (Byte)B, (Byte)A });
return Waypoint;
}



How To Use
    
SetWaypoint(0x3FF, 0x3FF, 20, getPlayerPosition(0)); //Sets the arrow on the screen with a hud at the players position/origin

SetObjective(0x3FF, 20, getPlayerPosition(0)); //Sets the hud on the minimap/compass at the players position/origin



Picture of What This Does

You must login or register to view this content.


In-Depth Explanation of The Args
    
[B]Set Waypoint[/B]
-------------------------
SetWaypoint(clientIndex, onEntity, iconIndex, Origin[3]);
clientIndex = What Client The Hud Shows Up For (0x3FF = All Clients)
onEntity = Will set the origin/position of the way point on an entity (0x3FF Makes it show up at the origin/position you set)
iconIndex = The Icon the way point will show
Origin[3] = Where the way point will spawn (where the arrows point to)

[B]Set Objective[/B]
-------------------------
SetObjective(onEntity, iconIndex, Origin[3]);
onEntity = Will set the origin/position of the objective to an entity (0x3FF Makes it show up at the origin/position you set)
iconIndex = The icon the objective will show
Origin[3] = Where the objective will spawn (where it is located on the minimap/compass)



Q & A For The Newbs

Q: Why Am I Getting An Error About Lib. Not existing!!!
A: Because you dont have a reference/class file called Lib, you can just use PS3Lib By iMCSx, Found here -> You must login or register to view this content.

Q: What does getMaterialIndex(stringhere) do?
A: Incase you dont want to use an icon index (the number) you can use getMaterialIndex to get it, example
SetObjective(0x3FF, getMaterialIndex("perk_hardline", getPlayerPosition(0)); //this will spawn the hard line
perk on the minimap

Q: Where can I get material names from for getMaterialIndex?
A: From this pastebin link -> You must login or register to view this content.
(adsbygoogle = window.adsbygoogle || []).push({});

The following 15 users say thank you to Shark for this useful post:

ALI ALHILFI, Geo, Green Haze, ImPiffHD, Jannik007, Mango_Knife, John, Notorious, oStankyModz, Raz0rMind, SnaY, VezahMoDz, Hash847, xD3VHΛX
05-08-2014, 11:28 AM #2
Mango_Knife
In my man cave
Cool.
05-08-2014, 12:20 PM #3
I have no use for it, but for people who make custom gamemodes could find this very helpful. Goodwork.

The following user thanked Green Haze for this useful post:

Mango_Knife
05-09-2014, 01:59 PM #4
Nice man
05-21-2014, 11:13 AM #5
Mango_Knife
In my man cave
Originally posted by Shark View Post
Hey, I saw seb attempted to release something similar for ghost but idk he failed it and it didn't have way points so I spent the last few days working on it and I have finally succeeded! so yea anyway I have no use for this and think keeping shit secret is dumb.... so enjoy!

Pastebin Link: You must login or register to view this content.

    
class Offsets
{
public static uint
G_HudElems = 0x15DDB00,
G_MaterialIndex = 0x276020,
}

public class ObjStruct
{
public static uint
ObjectiveIndex = 0x1608194,
ObjectiveIndexLength = 0x30,
Origin = 0x04,
X = 0x04,
Y = 0x08,
Z = 0x0C,
targetEntNum = 0x10,
MaterialIndex = 0x1C,
State = 0x28,
Team = 0x2D;
}

public class HudStruct
{
public static uint
ElemIndex = Offsets.G_HudElems,
HudsLength = 0x88,
X = 0x00,
Y = 0x04,
Z = 0x08,
FontSize = 0xC,
fromFontScale = 0x10,
fontScaleStartTime = 0x14,
color = 0x18,
fromColor = 0x1C,
fadeStartTime = 0x20,
scaleStartTime = 0x24,
fromX = 0x28,
fromY = 0x2C,
moveStartTime = 0x30,
time = 0x34,
duration = 0x38,
value = 0x3C,
sort = 0x40,
glowColor = 0x44,
fxBirthTime = 0x48,
flags = 0x4C,
targetEntNum = 0x50,
fontScaleTime = 0x52,
fadeTime = 0x54,
label = 0x56,
Width = 0x58,
Height = 0x5A,
fromWidth = 0x5C,
fromHeight = 0x5E,
scaleTime = 0x60,
moveTime = 0x62,
text = 0x64,
fxLetterTime = 0x66,
fxDecayStartTime = 0x68,
fxDecayDuration = 0x6A,
fxRedactDecayStartTime = 0x6C,
fxRedactDecayDuration = 0x6E,
type = 0x70,
Font = 0x71,
alignOrg = 0x72,
alignScreen = 0x73,
materialIndex = 0x74,
offscreenMaterialIndex = 0x75,
fromAlignOrg = 0x76,
fromAlignScreen = 0x77,
soundID = 0x78,
ui3dWindow = 0x79,
flag2 = 0x7A,
clientOffset = 0x7C,
team = 0x80,
abilityFlag = 0x84;
}

private static uint HudElem_Alloc()
{
for (uint i = 120; i < 1024; i++)
{
uint Index = Offsets.G_HudElems + (i * HudStruct.HudsLength);
if (Lib.ReadByte(Index + HudStruct.type) == 0)
{
Lib.WriteBytes(Index, new byte[0x88]);
return Index;
}
}
return 0;
}

private static uint Objective_Alloc()
{
for (uint i = 3; i <= 31; i++)
{
uint Index = ObjStruct.ObjectiveIndex + (i * ObjStruct.ObjectiveIndexLength);
if (Lib.ReadInt32(Index) == 0)
{
Lib.WriteBytes(Index, new byte[0x30]);
return Index;
}
}
return 0;
}


public static void Huds_DestroyAll()
{
for (uint i = 60; i < 0x400; i++)
{
PS3.SetMemory(Offsets.G_HudElems + (i * HudStruct.HudsLength), new byte[HudStruct.HudsLength]);
}
}


public static void Objective_DestroyAll()
{
for (uint i = 3; i <= 31; i++)
{
uint Index = ObjStruct.ObjectiveIndex + (i * ObjStruct.ObjectiveIndexLength);
Lib.WriteBytes(Index, new byte[ObjStruct.ObjectiveIndexLength]);
}
}

public static int getMaterialIndex(string Material)
{
return (int)RPC.Call(Offsets.G_MaterialIndex, Material);
}

public static void SetObjective(Int16 onEntity = 0x3FF, Object Material = null, Single[] Position = null)
{
UInt32 Objective = Objective_Alloc();
Lib.WriteInt32(Objective, 1);
Lib.WriteSingle(Objective + ObjStruct.Origin, Position);
Lib.WriteInt16(Objective + ObjStruct.targetEntNum, onEntity);
if (Material is String)
{ Lib.WriteInt32(Objective + ObjStruct.MaterialIndex, (Int16)getMaterialIndex((String)Material)); }
if (Material is Int32)
{ Lib.WriteInt32(Objective + ObjStruct.MaterialIndex, (Int32)Material); }
}

public static uint SetWaypoint(Int32 clientIndex = 0x3FF, Int16 onEntity = 0x3FF, Object Material = null, Single[] Position = null, Int32 R = 255, Int32 G = 255, Int32 B = 255, Int32 A = 255)
{
uint Waypoint = HudElem_Alloc();
Lib.WriteByte(Waypoint + HudStruct.type, 0xF);//0xF = Waypoint
if (Material is String)
{ Lib.WriteByte(Waypoint + HudStruct.offscreenMaterialIndex, Convert.ToByte(getMaterialIndex((String)Material))); }
if (Material is Int32)
{ Lib.WriteByte(Waypoint + HudStruct.offscreenMaterialIndex, Convert.ToByte(Material)); }
Lib.WriteSingle(Waypoint, Position);
Lib.WriteInt32(Waypoint + HudStruct.clientOffset, clientIndex);
Lib.WriteInt16(Waypoint + HudStruct.targetEntNum, onEntity);
Lib.WriteByte(Waypoint + HudStruct.ui3dWindow, 0xFF);
Lib.WriteBytes(Waypoint + HudStruct.color, new Byte[] { (Byte)R, (Byte)G, (Byte)B, (Byte)A });
return Waypoint;
}



How To Use
    
SetWaypoint(0x3FF, 0x3FF, 20, getPlayerPosition(0)); //Sets the arrow on the screen with a hud at the players position/origin

SetObjective(0x3FF, 20, getPlayerPosition(0)); //Sets the hud on the minimap/compass at the players position/origin



Picture of What This Does

You must login or register to view this content.


In-Depth Explanation of The Args
    
[B]Set Waypoint[/B]
-------------------------
SetWaypoint(clientIndex, onEntity, iconIndex, Origin[3]);
clientIndex = What Client The Hud Shows Up For (0x3FF = All Clients)
onEntity = Will set the origin/position of the way point on an entity (0x3FF Makes it show up at the origin/position you set)
iconIndex = The Icon the way point will show
Origin[3] = Where the way point will spawn (where the arrows point to)

[B]Set Objective[/B]
-------------------------
SetObjective(onEntity, iconIndex, Origin[3]);
onEntity = Will set the origin/position of the objective to an entity (0x3FF Makes it show up at the origin/position you set)
iconIndex = The icon the objective will show
Origin[3] = Where the objective will spawn (where it is located on the minimap/compass)



Q & A For The Newbs

Q: Why Am I Getting An Error About Lib. Not existing!!!
A: Because you dont have a reference/class file called Lib, you can just use PS3Lib By iMCSx, Found here -> You must login or register to view this content.

Q: What does getMaterialIndex(stringhere) do?
A: Incase you dont want to use an icon index (the number) you can use getMaterialIndex to get it, example
SetObjective(0x3FF, getMaterialIndex("perk_hardline", getPlayerPosition(0)); //this will spawn the hard line
perk on the minimap

Q: Where can I get material names from for getMaterialIndex?
A: From this pastebin link -> You must login or register to view this content.


Offsets didnt changed, just change the title to 1.18 Smile
05-22-2014, 01:49 PM #6
Chris
Former Staff
I might make a custom game mode... They are hella fun haha.

The following user thanked Chris for this useful post:

Mango_Knife
05-24-2014, 01:50 AM #7
Shark
Retired.
Originally posted by Vessel View Post
I might make a custom game mode... They are hella fun haha.


aha yea this is good for custom game modes :P!

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo