Hey im new to the forum and the whole modding potc <img src="style_emoticons/<#EMO_DIR#>/hi.gif" style="vertical-align:middle" emoid=":gday" border="0" alt="hi.gif" />
I was wondering if you could help me with something. I have receantly downloaded the cheat enabler v2 and I was wondering what am I doing wrong because I wanted to improve it to add the Main character cheat
Heres what I have so far
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->#include "events.h"
#include "globals.c"
#include "animals.c"
#include "sea_ai\sea.c"
#include "ships\ships.c"
#include "Encounters\Encounters.c"
#include "worldmap\worldmap.c"
#include "locations\locations.c"
#include "Loc_ai\LAi_init.c"
#include "store\goods.h"
#include "cannons\cannons.c"
#include "nations\nations.c"
#include "particles.c"
#include "initinterface.c"
#include "characters\characters.c"
#include "interface\interface.h"
#include "store\storeutilite.c"
#include "dialog.c"
#include "quests\quests.c"
#include "islands\islands.c"
#include "reload.c"
#include "situations.c"
#include "battle_interface\loginterface.c"
#include "calendar.c"
#include "teleport.c"
#include "utils.c"
#include "ITEMS\items.h"
#include "ITEMS\itemLogic.c"
#include "ITEMS\items_utilite.c"
#include "weather\WhrWeather.c"
#include "controls\controls.c"
#include "landencounters\landencounters.c"
extern void wdmInitWorldMap();
extern void InitGoods();
extern void InitStores();
extern void InitItems();
extern void InitCharactersTables();
extern void InitCharactersNames();
extern void CreateCharacters();
native float Bring2RangeNoCheck(float fMin1, float fMax1, float fMin2, float fMax2, float fValue);
native float Bring2Range(float fMin1, float fMax1, float fMin2, float fMax2, float fValue);
native float Degree2Radian(float fDegree);
native float Clampf(float fValue);
native int RDTSC_B();
native int RDTSC_E(int iRDTSC);
#libriary "script_libriary_test"
#event_handler(NEW_GAME_EVENT,"NewGame");
#event_handler(GAME_OVER_EVENT,"GameOverE");
#event_handler("Control Activation","ProcessControls");
#event_handler("MainMenuKey","ProcessMainMenuKey");
#event_handler("InterfaceKey","ProcessInterfaceKey");
#event_handler("CameraPosAng","ProcessCameraPosAng");
#event_handler("Cheat","ProcessCheat");
#event_handler("SeaDogs_ClearSaveData", "ClearLocationsSaveData");
void ProcessCheat()
{
string sCheatName;
ref mc;
sCheatName = GetEventData();
mc = GetMainCharacter();
switch(sCheatName)
{
case "Immortal":
if(LAi_IsImmortal(GetMainCharacter()))
{
LAi_SetImmortal(GetMainCharacter(), false);
Log_SetStringToLog("God mode OFF");
}else{
LAi_SetImmortal(GetMainCharacter(), true);
Log_SetStringToLog("God mode ON");
}
break;
case "ShotGun":
if(globalSGMode != false)
{
globalSGMode = false;
Log_SetStringToLog("Shotgun mode OFF");
}else{
globalSGMode = true;
Log_SetStringToLog("Shotgun mode ON");
}
break;
case "Health":
LAi_SetHP(mc, 500.0, 500.0);
Log_SetStringToLog(" HP Set to 500/500 ");
break;
case "Gold01":
mc.money = sti(mc.money) + 1000;
Log_SetStringToLog(" + 1,000 Gold");
break;
case "Gold02":
mc.money = sti(mc.money) + 100000;
Log_SetStringToLog(" + 100,000 Gold");
break;
case "Skill":
mc.skill.freeskill = sti(mc.skill.freeskill) + 50;
Log_SetStringToLog(" + 50 Skill Points");
break;
case "Abilities":
mc.perks.FreePoints = sti(mc.perks.FreePoints) + 20;
Log_SetStringToLog(" + 20 Ability Points");
break;
case "Experience01":
mc.experience = sti(mc.experience) +1000;
Log_SetStringToLog(" + 1,000 Experience");
break;
case "Experience02":
mc.experience = sti(mc.experience) +10000;
Log_SetStringToLog(" + 10,000 Experience");
break;
case "Experience03":
mc.experience = sti(mc.experience) +100000;
Log_SetStringToLog(" + 100,000 Experience");
break;
case "Experience04":
mc.experience = sti(mc.experience) +1000000;
Log_SetStringToLog(" + 1,000,000 Experience");
break;
case "Reputation":
mc.reputation = REPUTATION_MAX;
Log_SetStringToLog("Reputation Set to MAX");
break;
case "Morale":
mc.ship.crew.morale = MORALE_MAX;
Log_SetStringToLog("Crew Morale Set to MAX");
break;
case "Female":
mc.model = "Danielle";
mc.sex = "woman";
mc.FaceId = 30;
mc.model.animation = "Woman";
mc.model.height = 1.75;
Log_SetStringToLog("You are now female");
break;<!--c2--></div><!--ec2-->
Thats in the seadogs.c here the controls init_pc (The code I have changed in the file is above case female)
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->// Teleport
//CI_CreateAndSetControls( "", "TeleportActive", CI_GetKeyCode("VK_F4"), 0, false );
//CI_CreateAndSetControls( "", "TeleportUp", CI_GetKeyCode("VK_UP"), 0, false );
//CI_CreateAndSetControls( "", "TeleportDown", CI_GetKeyCode("VK_DOWN"), 0, false );
//CI_CreateAndSetControls( "", "TeleportSelect", CI_GetKeyCode("VK_RETURN"), 0, false );
// weather
//CI_CreateAndSetControls( "", "WhrPrevWeather", CI_GetKeyCode("KEY_M"), 0, false );
//CI_CreateAndSetControls( "", "WhrNextWeather", CI_GetKeyCode("KEY_N"), 0, false );
//CI_CreateAndSetControls( "", "WhrUpdateWeather", CI_GetKeyCode("KEY_B"), 0, false );
//CI_CreateAndSetControls( "", "Tele", CI_GetKeyCode("KEY_P"), 0, false );
CI_CreateAndSetControls( "", "CheatEncounters", CI_GetKeyCode("KEY_6"), 0, false );
CI_CreateAndSetControls( "", "CheatExperience01", CI_GetKeyCode("KEY_7"), 0, false );
CI_CreateAndSetControls( "", "CheatExperience02", CI_GetKeyCode("KEY_8"), 0, false );
CI_CreateAndSetControls( "", "CheatExperience03", CI_GetKeyCode("KEY_9"), 0, false );
CI_CreateAndSetControls( "", "CheatExperience04", CI_GetKeyCode("KEY_0"), 0, false );
CI_CreateAndSetControls( "", "CheatGod", CI_GetKeyCode("KEY_Y"), 0, false );
CI_CreateAndSetControls( "", "CheatShotGun", CI_GetKeyCode("KEY_U"), 0, false );
CI_CreateAndSetControls( "", "CheatHealth", CI_GetKeyCode("KEY_I"), 0, false );
CI_CreateAndSetControls( "", "CheatAbilities", CI_GetKeyCode("KEY_O"), 0, false );
CI_CreateAndSetControls( "", "CheatSkill", CI_GetKeyCode("KEY_P"), 0, false );
CI_CreateAndSetControls( "", "CheatGold01", CI_GetKeyCode("KEY_G"), 0, false );
CI_CreateAndSetControls( "", "CheatGold02", CI_GetKeyCode("KEY_H"), 0, false );
CI_CreateAndSetControls( "", "CheatReputation", CI_GetKeyCode("KEY_J"), 0, false );
CI_CreateAndSetControls( "", "CheatMorale", CI_GetKeyCode("KEY_K"), 0, false );
CI_CreateAndSetControls( "", "CheatNationRelations", CI_GetKeyCode("KEY_L"), 0, false );
CI_CreateAndSetControls( "", "CheatFemale", CI_GetKeyCode("KEY_T"), 0, false );
}<!--c2--></div><!--ec2-->
The control set is above (CheatFemale)
This is exactly how it is done in the cheat enabler and it doesn't work. Anyone know why?
And could someone tell me a website that has potc coding tutorials?
Thanks, Drunk
(btw the code changes your chracter to daneille when you press t in game)
I was wondering if you could help me with something. I have receantly downloaded the cheat enabler v2 and I was wondering what am I doing wrong because I wanted to improve it to add the Main character cheat
Heres what I have so far
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->#include "events.h"
#include "globals.c"
#include "animals.c"
#include "sea_ai\sea.c"
#include "ships\ships.c"
#include "Encounters\Encounters.c"
#include "worldmap\worldmap.c"
#include "locations\locations.c"
#include "Loc_ai\LAi_init.c"
#include "store\goods.h"
#include "cannons\cannons.c"
#include "nations\nations.c"
#include "particles.c"
#include "initinterface.c"
#include "characters\characters.c"
#include "interface\interface.h"
#include "store\storeutilite.c"
#include "dialog.c"
#include "quests\quests.c"
#include "islands\islands.c"
#include "reload.c"
#include "situations.c"
#include "battle_interface\loginterface.c"
#include "calendar.c"
#include "teleport.c"
#include "utils.c"
#include "ITEMS\items.h"
#include "ITEMS\itemLogic.c"
#include "ITEMS\items_utilite.c"
#include "weather\WhrWeather.c"
#include "controls\controls.c"
#include "landencounters\landencounters.c"
extern void wdmInitWorldMap();
extern void InitGoods();
extern void InitStores();
extern void InitItems();
extern void InitCharactersTables();
extern void InitCharactersNames();
extern void CreateCharacters();
native float Bring2RangeNoCheck(float fMin1, float fMax1, float fMin2, float fMax2, float fValue);
native float Bring2Range(float fMin1, float fMax1, float fMin2, float fMax2, float fValue);
native float Degree2Radian(float fDegree);
native float Clampf(float fValue);
native int RDTSC_B();
native int RDTSC_E(int iRDTSC);
#libriary "script_libriary_test"
#event_handler(NEW_GAME_EVENT,"NewGame");
#event_handler(GAME_OVER_EVENT,"GameOverE");
#event_handler("Control Activation","ProcessControls");
#event_handler("MainMenuKey","ProcessMainMenuKey");
#event_handler("InterfaceKey","ProcessInterfaceKey");
#event_handler("CameraPosAng","ProcessCameraPosAng");
#event_handler("Cheat","ProcessCheat");
#event_handler("SeaDogs_ClearSaveData", "ClearLocationsSaveData");
void ProcessCheat()
{
string sCheatName;
ref mc;
sCheatName = GetEventData();
mc = GetMainCharacter();
switch(sCheatName)
{
case "Immortal":
if(LAi_IsImmortal(GetMainCharacter()))
{
LAi_SetImmortal(GetMainCharacter(), false);
Log_SetStringToLog("God mode OFF");
}else{
LAi_SetImmortal(GetMainCharacter(), true);
Log_SetStringToLog("God mode ON");
}
break;
case "ShotGun":
if(globalSGMode != false)
{
globalSGMode = false;
Log_SetStringToLog("Shotgun mode OFF");
}else{
globalSGMode = true;
Log_SetStringToLog("Shotgun mode ON");
}
break;
case "Health":
LAi_SetHP(mc, 500.0, 500.0);
Log_SetStringToLog(" HP Set to 500/500 ");
break;
case "Gold01":
mc.money = sti(mc.money) + 1000;
Log_SetStringToLog(" + 1,000 Gold");
break;
case "Gold02":
mc.money = sti(mc.money) + 100000;
Log_SetStringToLog(" + 100,000 Gold");
break;
case "Skill":
mc.skill.freeskill = sti(mc.skill.freeskill) + 50;
Log_SetStringToLog(" + 50 Skill Points");
break;
case "Abilities":
mc.perks.FreePoints = sti(mc.perks.FreePoints) + 20;
Log_SetStringToLog(" + 20 Ability Points");
break;
case "Experience01":
mc.experience = sti(mc.experience) +1000;
Log_SetStringToLog(" + 1,000 Experience");
break;
case "Experience02":
mc.experience = sti(mc.experience) +10000;
Log_SetStringToLog(" + 10,000 Experience");
break;
case "Experience03":
mc.experience = sti(mc.experience) +100000;
Log_SetStringToLog(" + 100,000 Experience");
break;
case "Experience04":
mc.experience = sti(mc.experience) +1000000;
Log_SetStringToLog(" + 1,000,000 Experience");
break;
case "Reputation":
mc.reputation = REPUTATION_MAX;
Log_SetStringToLog("Reputation Set to MAX");
break;
case "Morale":
mc.ship.crew.morale = MORALE_MAX;
Log_SetStringToLog("Crew Morale Set to MAX");
break;
case "Female":
mc.model = "Danielle";
mc.sex = "woman";
mc.FaceId = 30;
mc.model.animation = "Woman";
mc.model.height = 1.75;
Log_SetStringToLog("You are now female");
break;<!--c2--></div><!--ec2-->
Thats in the seadogs.c here the controls init_pc (The code I have changed in the file is above case female)
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->// Teleport
//CI_CreateAndSetControls( "", "TeleportActive", CI_GetKeyCode("VK_F4"), 0, false );
//CI_CreateAndSetControls( "", "TeleportUp", CI_GetKeyCode("VK_UP"), 0, false );
//CI_CreateAndSetControls( "", "TeleportDown", CI_GetKeyCode("VK_DOWN"), 0, false );
//CI_CreateAndSetControls( "", "TeleportSelect", CI_GetKeyCode("VK_RETURN"), 0, false );
// weather
//CI_CreateAndSetControls( "", "WhrPrevWeather", CI_GetKeyCode("KEY_M"), 0, false );
//CI_CreateAndSetControls( "", "WhrNextWeather", CI_GetKeyCode("KEY_N"), 0, false );
//CI_CreateAndSetControls( "", "WhrUpdateWeather", CI_GetKeyCode("KEY_B"), 0, false );
//CI_CreateAndSetControls( "", "Tele", CI_GetKeyCode("KEY_P"), 0, false );
CI_CreateAndSetControls( "", "CheatEncounters", CI_GetKeyCode("KEY_6"), 0, false );
CI_CreateAndSetControls( "", "CheatExperience01", CI_GetKeyCode("KEY_7"), 0, false );
CI_CreateAndSetControls( "", "CheatExperience02", CI_GetKeyCode("KEY_8"), 0, false );
CI_CreateAndSetControls( "", "CheatExperience03", CI_GetKeyCode("KEY_9"), 0, false );
CI_CreateAndSetControls( "", "CheatExperience04", CI_GetKeyCode("KEY_0"), 0, false );
CI_CreateAndSetControls( "", "CheatGod", CI_GetKeyCode("KEY_Y"), 0, false );
CI_CreateAndSetControls( "", "CheatShotGun", CI_GetKeyCode("KEY_U"), 0, false );
CI_CreateAndSetControls( "", "CheatHealth", CI_GetKeyCode("KEY_I"), 0, false );
CI_CreateAndSetControls( "", "CheatAbilities", CI_GetKeyCode("KEY_O"), 0, false );
CI_CreateAndSetControls( "", "CheatSkill", CI_GetKeyCode("KEY_P"), 0, false );
CI_CreateAndSetControls( "", "CheatGold01", CI_GetKeyCode("KEY_G"), 0, false );
CI_CreateAndSetControls( "", "CheatGold02", CI_GetKeyCode("KEY_H"), 0, false );
CI_CreateAndSetControls( "", "CheatReputation", CI_GetKeyCode("KEY_J"), 0, false );
CI_CreateAndSetControls( "", "CheatMorale", CI_GetKeyCode("KEY_K"), 0, false );
CI_CreateAndSetControls( "", "CheatNationRelations", CI_GetKeyCode("KEY_L"), 0, false );
CI_CreateAndSetControls( "", "CheatFemale", CI_GetKeyCode("KEY_T"), 0, false );
}<!--c2--></div><!--ec2-->
The control set is above (CheatFemale)
This is exactly how it is done in the cheat enabler and it doesn't work. Anyone know why?
And could someone tell me a website that has potc coding tutorials?
Thanks, Drunk
(btw the code changes your chracter to daneille when you press t in game)