Well, I decided to post some of my tutorials here...
Okay, this is the first one. In this I teach you how to make new
Cheat-system.
---
I have used WSJ's ingame-message in this tutorial,
they can be found here (just scroll down the page):
http://diehardwolfers.areyep.com/viewtopic.php?t=1795
First open WL_DEF.H and add this somewhere
to the WL_PLAY.C definitions.
Then open the WL_PLAY.C and go to the "CheckKeys"-function.
Now we shall modify the "M-L-I"-cheat a bit (to make the
cheat-system work but you can make your own letter
combination for the cheats too):
Then we must add this red line to the "NewGame"-function
in the WL_MAIN.C (So the debugmode won't be open
when player starts the game):
Remember to add this line to the "Died"-funcion
in the WL_GAME.C too (so the cheats will turn of
if player die) and if you want, to the GameLoop function
(it can be find also in the WL_GAME.C).
Okay, this is the first one. In this I teach you how to make new
Cheat-system.
---
I have used WSJ's ingame-message in this tutorial,
they can be found here (just scroll down the page):
http://diehardwolfers.areyep.com/viewtopic.php?t=1795
First open WL_DEF.H and add this somewhere
to the WL_PLAY.C definitions.
- Code:
int cheater;
Then open the WL_PLAY.C and go to the "CheckKeys"-function.
Now we shall modify the "M-L-I"-cheat a bit (to make the
cheat-system work but you can make your own letter
combination for the cheats too):
- Code:
//
// Activate cheat-system
//
if (Keyboard[sc_M] &&
Keyboard[sc_L] &&
Keyboard[sc_I])
{
GetMessage("Press 'W' for weapons and ammo,\n 'K' for all keys and\n 'H' for full health.");
cheater = true;
IN_ClearKeysDown();
}
// Cheats
if (!cheater)
SD_PlaySound(DONOTHINGSND);
else
{
if(Keyboard[sc_W]) // ammunition cheat
{
GiveWeapon(wp_chaingun);
gamestate.ammo=99;
GetMessage("Weapons and ammo.");
DrawAmmo();
IN_ClearKeysDown();
}
if(Keyboard[sc_K]) // cheat for keys
{
gamestate.keys = 3; // change the value to 15 for four keys
GetMessage("All keys acquired.");
DrawKeys();
IN_ClearKeysDown();
}
if(Keyboard[sc_H]) // cheat for life
{
gamestate.health = 100;
GiveExtraMan();
GetMessage("Full recovery.");
IN_ClearKeysDown();
}
}
Then we must add this red line to the "NewGame"-function
in the WL_MAIN.C (So the debugmode won't be open
when player starts the game):
- Code:
gamestate.episode=episode;
[color=red]cheater = false; [/color]
startgame = true
Remember to add this line to the "Died"-funcion
in the WL_GAME.C too (so the cheats will turn of
if player die) and if you want, to the GameLoop function
(it can be find also in the WL_GAME.C).