From a5b84eb9fe32689f0aee10077854a3652c986c08 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sun, 17 May 2020 21:43:11 +0300 Subject: full script basic support --- src/control/Script.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/control/Script.h') diff --git a/src/control/Script.h b/src/control/Script.h index 9931f13e..c7a6e1e6 100644 --- a/src/control/Script.h +++ b/src/control/Script.h @@ -221,8 +221,8 @@ enum { }; enum { - SIZE_MAIN_SCRIPT = 128 * 1024, - SIZE_MISSION_SCRIPT = 32 * 1024, + SIZE_MAIN_SCRIPT = 225512, + SIZE_MISSION_SCRIPT = 35000, SIZE_SCRIPT_SPACE = SIZE_MAIN_SCRIPT + SIZE_MISSION_SCRIPT }; @@ -507,4 +507,6 @@ private: return false; } } + + static bool ThisIsAValidRandomCop(int32 mi, bool cop, bool swat, bool fbi, bool army, bool miami); }; -- cgit v1.2.3 From 6510b15704998b14b89fa453ba9d142f85c30dd5 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Tue, 19 May 2020 01:49:09 +0300 Subject: script revision --- src/control/Script.h | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/control/Script.h') diff --git a/src/control/Script.h b/src/control/Script.h index c7a6e1e6..e84e76bf 100644 --- a/src/control/Script.h +++ b/src/control/Script.h @@ -228,12 +228,10 @@ enum { enum { MAX_NUM_SCRIPTS = 128, - MAX_NUM_CONTACTS = 16, MAX_NUM_INTRO_TEXT_LINES = 2, MAX_NUM_INTRO_RECTANGLES = 16, MAX_NUM_SCRIPT_SRPITES = 16, MAX_NUM_SCRIPT_SPHERES = 16, - MAX_NUM_COLLECTIVES = 32, MAX_NUM_USED_OBJECTS = 200, MAX_NUM_MISSION_SCRIPTS = 120, MAX_NUM_BUILDING_SWAPS = 25, @@ -245,13 +243,10 @@ class CTheScripts { static uint8 ScriptSpace[SIZE_SCRIPT_SPACE]; static CRunningScript ScriptsArray[MAX_NUM_SCRIPTS]; - static int32 BaseBriefIdForContact[MAX_NUM_CONTACTS]; - static int32 OnAMissionForContactFlag[MAX_NUM_CONTACTS]; static intro_text_line IntroTextLines[MAX_NUM_INTRO_TEXT_LINES]; static intro_script_rectangle IntroRectangles[MAX_NUM_INTRO_RECTANGLES]; static CSprite2d ScriptSprites[MAX_NUM_SCRIPT_SRPITES]; static script_sphere_struct ScriptSphereArray[MAX_NUM_SCRIPT_SPHERES]; - static tCollectiveData CollectiveArray[MAX_NUM_COLLECTIVES]; static tUsedObject UsedObjectArray[MAX_NUM_USED_OBJECTS]; static int32 MultiScriptArray[MAX_NUM_MISSION_SCRIPTS]; static tBuildingSwap BuildingSwapArray[MAX_NUM_BUILDING_SWAPS]; @@ -275,14 +270,17 @@ class CTheScripts static uint32 LargestMissionScriptSize; static uint32 MainScriptSize; static uint8 FailCurrentMission; - static uint8 CountdownToMakePlayerUnsafe; - static uint8 DelayMakingPlayerUnsafeThisTime; static uint16 NumScriptDebugLines; static uint16 NumberOfIntroRectanglesThisFrame; static uint16 NumberOfIntroTextLinesThisFrame; static uint8 UseTextCommands; static uint16 CommandsExecuted; static uint16 ScriptsUpdated; + static uint8 RiotIntensity; + static uint32 LastMissionPassedTime; + static uint16 NumberOfExclusiveMissionScripts; + static bool bPlayerIsInTheStatium; + static bool bPlayerHasMetDebbieHarry; public: static void Init(); @@ -306,9 +304,6 @@ public: static int32* GetPointerToScriptVariable(int32 offset) { assert(offset >= 8 && offset < CTheScripts::GetSizeOfVariableSpace()); return (int32*)&ScriptSpace[offset]; } - static void ResetCountdownToMakePlayerUnsafe() { CountdownToMakePlayerUnsafe = 0; } - static bool IsCountdownToMakePlayerUnsafeOn() { return CountdownToMakePlayerUnsafe != 0; } - static int32 Read4BytesFromScript(uint32* pIp) { int32 retval = ScriptSpace[*pIp + 3] << 24 | ScriptSpace[*pIp + 2] << 16 | ScriptSpace[*pIp + 1] << 8 | ScriptSpace[*pIp]; *pIp += 4; @@ -371,6 +366,7 @@ private: static int32 AddScriptSphere(int32 id, CVector pos, float radius); static int32 GetNewUniqueScriptSphereIndex(int32 index); static void RemoveScriptSphere(int32 index); + static void RemoveScriptTextureDictionary(); friend class CRunningScript; friend class CHud; @@ -414,6 +410,7 @@ class CRunningScript uint32 m_anStack[MAX_STACK_DEPTH]; uint16 m_nStackPointer; int32 m_anLocalVariables[NUM_LOCAL_VARS + NUM_TIMERS]; + bool m_bIsActive; bool m_bCondResult; bool m_bIsMissionScript; bool m_bSkipWakeTime; -- cgit v1.2.3 From 4c822e8375268ac34f92af3f1960965446d32506 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Tue, 19 May 2020 20:54:05 +0300 Subject: script revision --- src/control/Script.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/control/Script.h') diff --git a/src/control/Script.h b/src/control/Script.h index e84e76bf..3393467e 100644 --- a/src/control/Script.h +++ b/src/control/Script.h @@ -367,6 +367,7 @@ private: static int32 GetNewUniqueScriptSphereIndex(int32 index); static void RemoveScriptSphere(int32 index); static void RemoveScriptTextureDictionary(); + static void RemoveThisPed(CPed* pPed); friend class CRunningScript; friend class CHud; -- cgit v1.2.3 From 2ab3fb5dd02aad980718f1ac176f06f7b7e25f41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Wed, 20 May 2020 20:10:05 +0300 Subject: Fixes for melees and various things --- src/control/Script.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/control/Script.h') diff --git a/src/control/Script.h b/src/control/Script.h index 3393467e..f7aaa46c 100644 --- a/src/control/Script.h +++ b/src/control/Script.h @@ -232,7 +232,7 @@ enum { MAX_NUM_INTRO_RECTANGLES = 16, MAX_NUM_SCRIPT_SRPITES = 16, MAX_NUM_SCRIPT_SPHERES = 16, - MAX_NUM_USED_OBJECTS = 200, + MAX_NUM_USED_OBJECTS = 220, MAX_NUM_MISSION_SCRIPTS = 120, MAX_NUM_BUILDING_SWAPS = 25, MAX_NUM_INVISIBILITY_SETTINGS = 20, -- cgit v1.2.3 From d84650fbe5c9c90e4b1f2a68018fe246029b1dff Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Wed, 20 May 2020 20:40:04 +0300 Subject: script revision --- src/control/Script.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/control/Script.h') diff --git a/src/control/Script.h b/src/control/Script.h index 3393467e..4f9f6b74 100644 --- a/src/control/Script.h +++ b/src/control/Script.h @@ -485,10 +485,11 @@ private: float LimitAngleOnCircle(float angle) { return angle < 0.0f ? angle + 360.0f : angle; } - bool ThisIsAValidRandomPed(uint32 pedtype) { + bool ThisIsAValidRandomPed(uint32 pedtype, int civ, int gang, int criminal) { switch (pedtype) { case PEDTYPE_CIVMALE: case PEDTYPE_CIVFEMALE: + return civ; case PEDTYPE_GANG1: case PEDTYPE_GANG2: case PEDTYPE_GANG3: @@ -498,13 +499,16 @@ private: case PEDTYPE_GANG7: case PEDTYPE_GANG8: case PEDTYPE_GANG9: + return gang; case PEDTYPE_CRIMINAL: case PEDTYPE_PROSTITUTE: - return true; + return criminal; default: return false; } } + + bool CheckDamagedWeaponType(int32 type, int32 actual); static bool ThisIsAValidRandomCop(int32 mi, bool cop, bool swat, bool fbi, bool army, bool miami); }; -- cgit v1.2.3 From 7e5342e9f0b27d69eaf0e3c6e1d14333ab5c4083 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Thu, 21 May 2020 11:22:25 +0300 Subject: script revision --- src/control/Script.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/control/Script.h') diff --git a/src/control/Script.h b/src/control/Script.h index f335c148..811fbef5 100644 --- a/src/control/Script.h +++ b/src/control/Script.h @@ -15,6 +15,12 @@ class CPlayerInfo; class CRunningScript; #define KEY_LENGTH_IN_SCRIPT 8 +#define SPHERE_MARKER_R 252 +#define SPHERE_MARKER_G 138 +#define SPHERE_MARKER_B 242 +#define SPHERE_MARKER_A 228 +#define SPHERE_MARKER_PULSE_PERIOD 2048 +#define SPHERE_MARKER_PULSE_FRACTION 0.1f struct intro_script_rectangle { -- cgit v1.2.3 From 864847a6fe5461581232a68b64d98dd15d035330 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Fri, 22 May 2020 02:42:04 +0300 Subject: new script commands - mostly stubs --- src/control/Script.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/control/Script.h') diff --git a/src/control/Script.h b/src/control/Script.h index 811fbef5..75a2c1e0 100644 --- a/src/control/Script.h +++ b/src/control/Script.h @@ -488,6 +488,8 @@ private: void PlayerInAngledAreaCheckCommand(int32, uint32*); void CharInAreaCheckCommand(int32, uint32*); void CarInAreaCheckCommand(int32, uint32*); + void LocateObjectCommand(int32, uint32*); + void ObjectInAreaCheckCommand(int32, uint32*); float LimitAngleOnCircle(float angle) { return angle < 0.0f ? angle + 360.0f : angle; } -- cgit v1.2.3 From 5357957fe124afb8e9a5f737510fe4c96a7dc327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Sat, 23 May 2020 16:53:20 +0300 Subject: Compatibility with VC weapon.dat + new shotguns --- src/control/Script.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/control/Script.h') diff --git a/src/control/Script.h b/src/control/Script.h index 75a2c1e0..57b997b1 100644 --- a/src/control/Script.h +++ b/src/control/Script.h @@ -516,7 +516,7 @@ private: } } - bool CheckDamagedWeaponType(int32 type, int32 actual); + bool CheckDamagedWeaponType(int32 actual, int32 type); static bool ThisIsAValidRandomCop(int32 mi, bool cop, bool swat, bool fbi, bool army, bool miami); }; -- cgit v1.2.3