Merge pull request #637 from Nick007J/master

script logging
This commit is contained in:
Nikolay Korolev 2020-06-22 13:27:25 +03:00 committed by GitHub
commit 043f09f3fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 1469 additions and 50 deletions

View File

@ -230,7 +230,7 @@ CCutsceneMgr::LoadCutsceneData(const char *szCutsceneName)
pPlayerPed->m_pWanted->ClearQdCrimes();
pPlayerPed->bIsVisible = false;
pPlayerPed->m_fCurrentStamina = pPlayerPed->m_fMaxStamina;
CPad::GetPad(0)->DisablePlayerControls |= PLAYERCONTROL_DISABLED_80;
CPad::GetPad(0)->SetDisablePlayerControls(PLAYERCONTROL_CUTSCENE);
CWorld::Players[CWorld::PlayerInFocus].MakePlayerSafe(true);
}
@ -365,7 +365,7 @@ CCutsceneMgr::DeleteCutsceneData(void)
ms_loaded = false;
FindPlayerPed()->bIsVisible = true;
CPad::GetPad(0)->DisablePlayerControls &= ~PLAYERCONTROL_DISABLED_80;
CPad::GetPad(0)->SetEnablePlayerControls(PLAYERCONTROL_CUTSCENE);
CWorld::Players[CWorld::PlayerInFocus].MakePlayerSafe(false);
if (CGeneral::faststricmp(ms_cutsceneName, "end")) {

View File

@ -66,7 +66,7 @@ CPhoneInfo::Update(void)
endAssoc->flags &= ~ASSOC_DELETEFADEDOUT;
endAssoc->SetFinishCallback(PhonePutDownCB, player);
} else {
CPad::GetPad(0)->DisablePlayerControls &= ~PLAYERCONTROL_DISABLED_40;
CPad::GetPad(0)->SetEnablePlayerControls(PLAYERCONTROL_PHONE);
if (player->m_nPedState == PED_MAKE_CALL)
player->m_nPedState = PED_IDLE;
}
@ -116,7 +116,7 @@ CPhoneInfo::Update(void)
player->m_fRotationDest = angleToFace;
player->SetHeading(angleToFace);
player->m_nPedState = PED_MAKE_CALL;
CPad::GetPad(0)->DisablePlayerControls |= PLAYERCONTROL_DISABLED_40;
CPad::GetPad(0)->SetDisablePlayerControls(PLAYERCONTROL_PHONE);
TheCamera.SetWideScreenOn();
playerInfo->MakePlayerSafe(true);
CAnimBlendAssociation *phonePickAssoc = CAnimManager::BlendAnimation(player->GetClump(), ASSOCGRP_STD, ANIM_PHONE_IN, 4.0f);
@ -340,7 +340,7 @@ PhonePutDownCB(CAnimBlendAssociation *assoc, void *arg)
{
assoc->flags |= ASSOC_DELETEFADEDOUT;
assoc->blendDelta = -1000.0f;
CPad::GetPad(0)->DisablePlayerControls &= ~PLAYERCONTROL_DISABLED_40;
CPad::GetPad(0)->SetEnablePlayerControls(PLAYERCONTROL_PHONE);
CPed *ped = (CPed*)arg;
if (assoc->blendAmount > 0.5f)

File diff suppressed because it is too large Load Diff

View File

@ -350,6 +350,7 @@ private:
static bool IsPlayerStopped(CPlayerInfo*);
static bool IsVehicleStopped(CVehicle*);
static void PrintListSizes();
static void ReadObjectNamesFromScript();
static void UpdateObjectIndices();
static void ReadMultiScriptFileOffsetsFromScript();
@ -486,6 +487,11 @@ private:
bool CanAllowMissionReplay();
#endif
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
int CollectParameterForDebug(char* buf, bool& var);
void GetStoredParameterForDebug(char* buf);
#endif
float LimitAngleOnCircle(float angle) { return angle < 0.0f ? angle + 360.0f : angle; }
bool ThisIsAValidRandomPed(uint32 pedtype) {

View File

@ -1157,7 +1157,38 @@ enum {
COMMAND_CAN_CHAR_SEE_DEAD_CHAR,
COMMAND_SET_ENTER_CAR_RANGE_MULTIPLIER,
#ifndef GTA3_1_1_PATCH
COMMAND_SET_THREAT_REACTION_RANGE_MULTIPLIER
COMMAND_SET_THREAT_REACTION_RANGE_MULTIPLIER,
#endif
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
LAST_SCRIPT_COMMAND
#endif
#endif
};
};
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
enum eScriptArgument
{
ARGTYPE_NONE = 0,
ARGTYPE_INT,
ARGTYPE_FLOAT,
ARGTYPE_STRING,
ARGTYPE_LABEL,
ARGTYPE_BOOL,
ARGTYPE_PED_HANDLE,
ARGTYPE_VEHICLE_HANDLE,
ARGTYPE_OBJECT_HANDLE,
ARGTYPE_ANDOR
};
struct tScriptCommandData
{
int id;
const char name[64];
eScriptArgument input[18];
eScriptArgument output[18];
bool cond;
int position;
const char name_override[8];
};
#endif

View File

@ -3834,7 +3834,11 @@ CCam::Process_Debug(const CVector&, float, float, float)
Source.y += 1.0f;
GetVectorsReadyForRW();
CPad::GetPad(0)->DisablePlayerControls = PLAYERCONTROL_DISABLED_1;
#ifdef FIX_BUGS
CPad::GetPad(0)->SetDisablePlayerControls(PLAYERCONTROL_CAMERA);
#else
CPad::GetPad(0)->DisablePlayerControls = PLAYERCONTROL_CAMERA;
#endif
if(CPad::GetPad(1)->GetLeftShockJustDown() && gbBigWhiteDebugLightSwitchedOn)
CShadows::StoreShadowToBeRendered(SHADOWTYPE_ADDITIVE, gpShadowExplosionTex, &Source,

View File

@ -781,7 +781,7 @@ CCamera::CamControl(void)
m_bFailedCullZoneTestPreviously = CCullZones::CamCloseInForPlayer();
if(m_bLookingAtPlayer){
CPad::GetPad(0)->DisablePlayerControls &= ~PLAYERCONTROL_DISABLED_1;
CPad::GetPad(0)->SetEnablePlayerControls(PLAYERCONTROL_CAMERA);
FindPlayerPed()->bIsVisible = true;
}
@ -1049,7 +1049,7 @@ CCamera::CamControl(void)
m_bFirstPersonBeingUsed = false;
if(m_bFirstPersonBeingUsed){
ReqMode = CCam::MODE_1STPERSON;
CPad::GetPad(0)->DisablePlayerControls |= PLAYERCONTROL_DISABLED_1;
CPad::GetPad(0)->SetDisablePlayerControls(PLAYERCONTROL_CAMERA);
}
// Zoom value

View File

@ -2,14 +2,14 @@
enum {
PLAYERCONTROL_ENABLED = 0,
PLAYERCONTROL_DISABLED_1 = 1, // used by first person camera
PLAYERCONTROL_DISABLED_2 = 2,
PLAYERCONTROL_CAMERA = 1,
PLAYERCONTROL_UNK2 = 2,
PLAYERCONTROL_GARAGE = 4,
PLAYERCONTROL_DISABLED_8 = 8,
PLAYERCONTROL_DISABLED_10 = 16,
PLAYERCONTROL_DISABLED_20 = 32, // used on CPlayerInfo::MakePlayerSafe
PLAYERCONTROL_DISABLED_40 = 64, // used on phone calls
PLAYERCONTROL_DISABLED_80 = 128,// used on cutscenes
PLAYERCONTROL_UNK8 = 8,
PLAYERCONTROL_UNK10 = 16,
PLAYERCONTROL_PLAYERINFO = 32,
PLAYERCONTROL_PHONE = 64,
PLAYERCONTROL_CUTSCENE = 128,
};
class CControllerState

View File

@ -174,7 +174,7 @@ CPlayerInfo::MakePlayerSafe(bool toggle)
CTheScripts::ResetCountdownToMakePlayerUnsafe();
m_pPed->m_pWanted->m_bIgnoredByEveryone = true;
CWorld::StopAllLawEnforcersInTheirTracks();
CPad::GetPad(0)->DisablePlayerControls |= PLAYERCONTROL_DISABLED_20;
CPad::GetPad(0)->SetDisablePlayerControls(PLAYERCONTROL_PLAYERINFO);
CPad::StopPadsShaking();
m_pPed->bBulletProof = true;
m_pPed->bFireProof = true;
@ -194,7 +194,7 @@ CPlayerInfo::MakePlayerSafe(bool toggle)
} else if (!CGame::playingIntro && !CTheScripts::IsCountdownToMakePlayerUnsafeOn()) {
m_pPed->m_pWanted->m_bIgnoredByEveryone = false;
CPad::GetPad(0)->DisablePlayerControls &= ~PLAYERCONTROL_DISABLED_20;
CPad::GetPad(0)->SetEnablePlayerControls(PLAYERCONTROL_PLAYERINFO);
m_pPed->bBulletProof = false;
m_pPed->bFireProof = false;
m_pPed->bCollisionProof = false;

View File

@ -233,6 +233,8 @@ enum Config {
#define USE_PRECISE_MEASUREMENT_CONVERTION // makes game convert feet to meeters more precisely
#define MISSION_REPLAY // mobile feature
//#define SIMPLIER_MISSIONS // apply simplifications from mobile
#define USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
#define SCRIPT_LOG_FILE_LEVEL 1 // 0 == no log, 1 == overwrite every frame, 2 == full log
// Replay
//#define DONT_FIX_REPLAY_BUGS // keeps various bugs in CReplay, some of which are fairly cool!