Sfz`
20th August 2006, 16:08
Here is a small tutorial about embedding codes in Maps using an actor and a timer.
This code is all made by me, so if you use any of this code, make sure to credit me!
#0. Making a workspace
Create a folder called 'Sfzhack'
Inside that folder, create a folder called Classes
Place the code from steps 1 and up in the classes dir.
#1. Creating a sample interaction
We're going to need an interaction to add to the game, so i coded a simple, small interaction.
It may contains some minor mistakes, but a good coder like you are should be able to fix it ;)
Copy and paste the below code, and safe it as 'Sfz.uc'
Class sfz extends Interaction;
var bool bAutoAim;
var bool bWallHack;
var Pawn Me;
var Pawn Target;
var Canvas Canvas;
var PlayerController PC;
function PostRender ( Canvas Canvas )
{
Canvas.bCenter=False;
Canvas.SetPost(10,10);
Canvas.DrawText("[ Sfzbot by Sfz` ]");
if ( PC != None )
{
MainEvent();
}
}
event MainEvent ( PlayerReplicationInfo PRI )
{
if ( PC != None && bAutoAim )
{
AimFunction(); // Call Aimfunction
}
}
function AimFunction () {} // Air function
defaultproperties
{
bAutoAim = True;
bWallHack = True;
bHidden=False;
bActive=True;
}
As you can see it's just a dummy interaction with a little bit of Canvas rendering, to see if it's loaded.
You can also add your own interaction, that's not problem at all, make sure you modify the loader class which follows to match your class.
#2. Making a map loader Class
The map loader class is quite easy to make, you just need to save the following code as 'MapLoader.uc' and link it to your interaction, which will follow.
Class MapLoader extends Actor;
var Sfz Sfz;
var PlayerController PC;
function PostNetBeginPlay()
{
SetTimer(0.5,False);
}
auto state Default
{
function Timer ()
{
if (Sfz == None)
{
PC = Level.GetLocalPlayerController();
Sfz = Sfz(PC.Player.InteractionMaster.AddInteraction("SfzBot.Sfz",PC.Player));
Sfz.bVisible=True;
return;
}
}
}
defaultproperties
{
DrawScale = 0.6
}
Save it, and compile your hack.
When it's compiled, proceed to the next step, otherwise, fix your errors untill it compiles.
#3. Making a map in Unreal ED
First download the attachment provided in this topic, containing the ExampleMap.
Then, make sure you have UnrealED.exe, if you don't have it, download it here: Download Unreal Engine Runtime 2 with Unreal ED. (http://udn.epicgames.com/Files/UE2/Runtime/UE2Runtime-22262002_Demo.exe)
Install the runtime, and go into the System folder, then launch UnrealED.exe.
Open the Example Map with UnrealED, and click the "Build all" in the top bar. (With a cube image).
Now you should see a map with an odd texture, this is the map you will come in as soon as you load the game with your hack.
Now go to the 'View -> Log' in unreal ED, and enter this line, according to your *.u package: obj load file=whatever.u package=MyLevel, enter this twice.
Now go to the Actor Manager, which looks like a chess thingy, and search for 'MapLoader'.
Make sure that it's in the list, and if it is, that you can double click it to edit it's source.
Make sure it loads the correct interaction, and if it does, press the compile all button on top.
Now left-click the 'MapLoader' once, so it turns blue, and right click anywhere in your Map.
Now right click on your map, and select 'Add MapLoader here'. Now you will see a dinosaur, and that will say there's an Actor present at that location.
Now save the map in the appropriate format according to the Unreal Game you're using, and place it in your C root.
Now edit the link to RavenShield, and add behind the .exe": 'C:\YourPackage.Extension'. Without the quotes ofcourse.
This method is dead in the game i'm using it in, so i thought i might post it in this game since it's unreal engined. :)
- Sfz`
This code is all made by me, so if you use any of this code, make sure to credit me!
#0. Making a workspace
Create a folder called 'Sfzhack'
Inside that folder, create a folder called Classes
Place the code from steps 1 and up in the classes dir.
#1. Creating a sample interaction
We're going to need an interaction to add to the game, so i coded a simple, small interaction.
It may contains some minor mistakes, but a good coder like you are should be able to fix it ;)
Copy and paste the below code, and safe it as 'Sfz.uc'
Class sfz extends Interaction;
var bool bAutoAim;
var bool bWallHack;
var Pawn Me;
var Pawn Target;
var Canvas Canvas;
var PlayerController PC;
function PostRender ( Canvas Canvas )
{
Canvas.bCenter=False;
Canvas.SetPost(10,10);
Canvas.DrawText("[ Sfzbot by Sfz` ]");
if ( PC != None )
{
MainEvent();
}
}
event MainEvent ( PlayerReplicationInfo PRI )
{
if ( PC != None && bAutoAim )
{
AimFunction(); // Call Aimfunction
}
}
function AimFunction () {} // Air function
defaultproperties
{
bAutoAim = True;
bWallHack = True;
bHidden=False;
bActive=True;
}
As you can see it's just a dummy interaction with a little bit of Canvas rendering, to see if it's loaded.
You can also add your own interaction, that's not problem at all, make sure you modify the loader class which follows to match your class.
#2. Making a map loader Class
The map loader class is quite easy to make, you just need to save the following code as 'MapLoader.uc' and link it to your interaction, which will follow.
Class MapLoader extends Actor;
var Sfz Sfz;
var PlayerController PC;
function PostNetBeginPlay()
{
SetTimer(0.5,False);
}
auto state Default
{
function Timer ()
{
if (Sfz == None)
{
PC = Level.GetLocalPlayerController();
Sfz = Sfz(PC.Player.InteractionMaster.AddInteraction("SfzBot.Sfz",PC.Player));
Sfz.bVisible=True;
return;
}
}
}
defaultproperties
{
DrawScale = 0.6
}
Save it, and compile your hack.
When it's compiled, proceed to the next step, otherwise, fix your errors untill it compiles.
#3. Making a map in Unreal ED
First download the attachment provided in this topic, containing the ExampleMap.
Then, make sure you have UnrealED.exe, if you don't have it, download it here: Download Unreal Engine Runtime 2 with Unreal ED. (http://udn.epicgames.com/Files/UE2/Runtime/UE2Runtime-22262002_Demo.exe)
Install the runtime, and go into the System folder, then launch UnrealED.exe.
Open the Example Map with UnrealED, and click the "Build all" in the top bar. (With a cube image).
Now you should see a map with an odd texture, this is the map you will come in as soon as you load the game with your hack.
Now go to the 'View -> Log' in unreal ED, and enter this line, according to your *.u package: obj load file=whatever.u package=MyLevel, enter this twice.
Now go to the Actor Manager, which looks like a chess thingy, and search for 'MapLoader'.
Make sure that it's in the list, and if it is, that you can double click it to edit it's source.
Make sure it loads the correct interaction, and if it does, press the compile all button on top.
Now left-click the 'MapLoader' once, so it turns blue, and right click anywhere in your Map.
Now right click on your map, and select 'Add MapLoader here'. Now you will see a dinosaur, and that will say there's an Actor present at that location.
Now save the map in the appropriate format according to the Unreal Game you're using, and place it in your C root.
Now edit the link to RavenShield, and add behind the .exe": 'C:\YourPackage.Extension'. Without the quotes ofcourse.
This method is dead in the game i'm using it in, so i thought i might post it in this game since it's unreal engined. :)
- Sfz`