mirror of
https://github.com/halpz/re3.git
synced 2024-12-26 18:15:27 +00:00
commit
3a2a4dee5c
|
@ -33,6 +33,7 @@ public:
|
||||||
static void RequestCollision(const CVector2D &pos);
|
static void RequestCollision(const CVector2D &pos);
|
||||||
static void EnsureCollisionIsInMemory(const CVector2D &pos);
|
static void EnsureCollisionIsInMemory(const CVector2D &pos);
|
||||||
static bool HasCollisionLoaded(const CVector2D &pos);
|
static bool HasCollisionLoaded(const CVector2D &pos);
|
||||||
|
static bool HasCollisionLoaded(eLevelName level) { return true; }; // TODO
|
||||||
|
|
||||||
static ColDef *GetSlot(int slot) {
|
static ColDef *GetSlot(int slot) {
|
||||||
assert(slot >= 0);
|
assert(slot >= 0);
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#include "Accident.h"
|
#include "Accident.h"
|
||||||
#include "AutoPilot.h"
|
#include "AutoPilot.h"
|
||||||
|
#include "Bridge.h"
|
||||||
#include "CarCtrl.h"
|
#include "CarCtrl.h"
|
||||||
#include "General.h"
|
#include "General.h"
|
||||||
#include "HandlingMgr.h"
|
#include "HandlingMgr.h"
|
||||||
|
@ -74,6 +75,18 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
|
||||||
case STATUS_PLAYER_DISABLED:
|
case STATUS_PLAYER_DISABLED:
|
||||||
break;
|
break;
|
||||||
case STATUS_SIMPLE:
|
case STATUS_SIMPLE:
|
||||||
|
{
|
||||||
|
if (pVehicle->m_pCurGroundEntity && CBridge::ThisIsABridgeObjectMovingUp(pVehicle->m_pCurGroundEntity->GetModelIndex()))
|
||||||
|
pVehicle->SetStatus(STATUS_PHYSICS);
|
||||||
|
CColPoint colPoint;
|
||||||
|
CEntity* pEntity;
|
||||||
|
if ((pVehicle->m_randomSeed & 0x3F) == (CTimer::GetFrameCounter() & 0x3F) &&
|
||||||
|
!CWorld::ProcessVerticalLine(pVehicle->GetPosition(), -2.0f, colPoint, pEntity, true, false, false, false, true, false, nil)) {
|
||||||
|
debug("FLOATING CAR TURNED INTO PHYSICS CAR!\n");
|
||||||
|
pVehicle->SetStatus(STATUS_PHYSICS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// fallthough
|
||||||
case STATUS_PHYSICS:
|
case STATUS_PHYSICS:
|
||||||
switch (pVehicle->AutoPilot.m_nCarMission) {
|
switch (pVehicle->AutoPilot.m_nCarMission) {
|
||||||
case MISSION_RAMPLAYER_FARAWAY:
|
case MISSION_RAMPLAYER_FARAWAY:
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include "Cranes.h"
|
#include "Cranes.h"
|
||||||
#include "Curves.h"
|
#include "Curves.h"
|
||||||
#include "CutsceneMgr.h"
|
#include "CutsceneMgr.h"
|
||||||
|
#include "Frontend.h"
|
||||||
#include "Gangs.h"
|
#include "Gangs.h"
|
||||||
#include "Game.h"
|
#include "Game.h"
|
||||||
#include "Garages.h"
|
#include "Garages.h"
|
||||||
|
@ -76,10 +77,11 @@
|
||||||
#define DISTANCE_BETWEEN_CAR_AND_DEAD_PED (6.0f)
|
#define DISTANCE_BETWEEN_CAR_AND_DEAD_PED (6.0f)
|
||||||
#define PROBABILITY_OF_PASSENGER_IN_VEHICLE (0.125f)
|
#define PROBABILITY_OF_PASSENGER_IN_VEHICLE (0.125f)
|
||||||
|
|
||||||
#define ONSCREEN_DESPAWN_RANGE (120.0f)
|
#define ONSCREEN_DESPAWN_RANGE (190.0f)
|
||||||
#define MINIMAL_DISTANCE_TO_SPAWN_ONSCREEN (100.0f)
|
#define MINIMAL_DISTANCE_TO_SPAWN_ONSCREEN (130.0f)
|
||||||
#define REQUEST_ONSCREEN_DISTANCE ((ONSCREEN_DESPAWN_RANGE + MINIMAL_DISTANCE_TO_SPAWN_ONSCREEN) / 2)
|
#define REQUEST_ONSCREEN_DISTANCE (140.0f)
|
||||||
#define OFFSCREEN_DESPAWN_RANGE (40.0f)
|
#define OFFSCREEN_DESPAWN_RANGE (60.0f)
|
||||||
|
#define MINIMAL_DISTANCE_TO_SPAWN_OFFSCREEN (40.0f)
|
||||||
#define EXTENDED_RANGE_DESPAWN_MULTIPLIER (1.5f)
|
#define EXTENDED_RANGE_DESPAWN_MULTIPLIER (1.5f)
|
||||||
|
|
||||||
//--MIAMI: file done
|
//--MIAMI: file done
|
||||||
|
@ -95,7 +97,7 @@ int32 CCarCtrl::NumRandomCars;
|
||||||
int32 CCarCtrl::NumParkedCars;
|
int32 CCarCtrl::NumParkedCars;
|
||||||
int32 CCarCtrl::NumPermanentCars;
|
int32 CCarCtrl::NumPermanentCars;
|
||||||
int8 CCarCtrl::CountDownToCarsAtStart;
|
int8 CCarCtrl::CountDownToCarsAtStart;
|
||||||
int32 CCarCtrl::MaxNumberOfCarsInUse = 12;
|
int32 CCarCtrl::MaxNumberOfCarsInUse = 30;
|
||||||
uint32 CCarCtrl::LastTimeLawEnforcerCreated;
|
uint32 CCarCtrl::LastTimeLawEnforcerCreated;
|
||||||
uint32 CCarCtrl::LastTimeFireTruckCreated;
|
uint32 CCarCtrl::LastTimeFireTruckCreated;
|
||||||
uint32 CCarCtrl::LastTimeAmbulanceCreated;
|
uint32 CCarCtrl::LastTimeAmbulanceCreated;
|
||||||
|
@ -161,14 +163,19 @@ CCarCtrl::GenerateOneRandomCar()
|
||||||
carClass = COPS;
|
carClass = COPS;
|
||||||
carModel = ChoosePoliceCarModel();
|
carModel = ChoosePoliceCarModel();
|
||||||
}else{
|
}else{
|
||||||
|
for (int i = 0; i < 5; i++) {
|
||||||
carModel = ChooseModel(&zone, &carClass);
|
carModel = ChooseModel(&zone, &carClass);
|
||||||
if (carModel == -1 || (carClass == COPS && pWanted->m_nWantedLevel >= 1))
|
if (carModel == -1)
|
||||||
|
return;
|
||||||
|
if (!(carClass == COPS && pWanted->m_nWantedLevel >= 1))
|
||||||
/* All cop spawns with wanted level are handled by condition above. */
|
/* All cop spawns with wanted level are handled by condition above. */
|
||||||
/* In particular it means that cop cars never spawn if player has wanted level of 1. */
|
/* In particular it means that cop cars never spawn if player has wanted level of 1. */
|
||||||
return;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
float frontX, frontY;
|
float frontX, frontY;
|
||||||
float preferredDistance, angleLimit;
|
float preferredDistance, angleLimit;
|
||||||
|
float requestMultiplier;
|
||||||
bool invertAngleLimitTest;
|
bool invertAngleLimitTest;
|
||||||
CVector spawnPosition;
|
CVector spawnPosition;
|
||||||
int32 curNodeId, nextNodeId;
|
int32 curNodeId, nextNodeId;
|
||||||
|
@ -188,11 +195,14 @@ CCarCtrl::GenerateOneRandomCar()
|
||||||
angleLimit = -1.0f;
|
angleLimit = -1.0f;
|
||||||
bTopDownCamera = true;
|
bTopDownCamera = true;
|
||||||
invertAngleLimitTest = true;
|
invertAngleLimitTest = true;
|
||||||
preferredDistance = OFFSCREEN_DESPAWN_RANGE + 15.0f;
|
preferredDistance = MINIMAL_DISTANCE_TO_SPAWN_OFFSCREEN + 15.0f;
|
||||||
/* BUG: testForCollision not initialized in original game. */
|
/* BUG: testForCollision not initialized in original game. */
|
||||||
testForCollision = false;
|
testForCollision = false;
|
||||||
}else if (!pPlayerVehicle){
|
}else if (!pPlayerVehicle){
|
||||||
/* Player is not in vehicle. */
|
/* Player is not in vehicle. */
|
||||||
|
requestMultiplier = 13.0f / 20.0f;
|
||||||
|
if (FrontEndMenuManager.m_PrefsUseWideScreen) // TODO(LCS): static
|
||||||
|
requestMultiplier *= 4.0f / 3.0f;
|
||||||
testForCollision = true;
|
testForCollision = true;
|
||||||
frontX = TheCamera.CamFrontXNorm;
|
frontX = TheCamera.CamFrontXNorm;
|
||||||
frontY = TheCamera.CamFrontYNorm;
|
frontY = TheCamera.CamFrontYNorm;
|
||||||
|
@ -202,17 +212,24 @@ CCarCtrl::GenerateOneRandomCar()
|
||||||
/* Forward to his current direction (camera direction). */
|
/* Forward to his current direction (camera direction). */
|
||||||
angleLimit = 0.707f; /* 45 degrees */
|
angleLimit = 0.707f; /* 45 degrees */
|
||||||
invertAngleLimitTest = true;
|
invertAngleLimitTest = true;
|
||||||
preferredDistance = REQUEST_ONSCREEN_DISTANCE * TheCamera.GenerationDistMultiplier;
|
preferredDistance = REQUEST_ONSCREEN_DISTANCE * requestMultiplier * TheCamera.GenerationDistMultiplier;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
/* Spawn a vehicle close to player to his side. */
|
/* Spawn a vehicle close to player to his side. */
|
||||||
/* Kinda not within camera angle. */
|
/* Kinda not within camera angle. */
|
||||||
angleLimit = 0.707f; /* 45 degrees */
|
angleLimit = 0.707f; /* 45 degrees */
|
||||||
invertAngleLimitTest = false;
|
invertAngleLimitTest = false;
|
||||||
preferredDistance = OFFSCREEN_DESPAWN_RANGE;
|
preferredDistance = MINIMAL_DISTANCE_TO_SPAWN_OFFSCREEN;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}else if (fPlayerVehicleSpeed > 0.4f){ /* 72 km/h */
|
}
|
||||||
|
else {
|
||||||
|
requestMultiplier = 13.0f / 20.0f;
|
||||||
|
if (TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_1STPERSON && !FrontEndMenuManager.m_PrefsUseWideScreen)
|
||||||
|
requestMultiplier *= 0.9f;
|
||||||
|
if (FrontEndMenuManager.m_PrefsUseWideScreen) // TODO(LCS): static
|
||||||
|
requestMultiplier *= 4.0f / 3.0f;
|
||||||
|
if (fPlayerVehicleSpeed > 0.4f) { /* 72 km/h */
|
||||||
/* Player is moving fast in vehicle */
|
/* Player is moving fast in vehicle */
|
||||||
/* Prefer spawning vehicles very far away from him. */
|
/* Prefer spawning vehicles very far away from him. */
|
||||||
frontX = vecPlayerVehicleSpeed.x / fPlayerVehicleSpeed;
|
frontX = vecPlayerVehicleSpeed.x / fPlayerVehicleSpeed;
|
||||||
|
@ -224,24 +241,25 @@ CCarCtrl::GenerateOneRandomCar()
|
||||||
/* Spawn a vehicle in a very narrow gap in front of a player */
|
/* Spawn a vehicle in a very narrow gap in front of a player */
|
||||||
angleLimit = 0.85f; /* approx 30 degrees */
|
angleLimit = 0.85f; /* approx 30 degrees */
|
||||||
invertAngleLimitTest = true;
|
invertAngleLimitTest = true;
|
||||||
preferredDistance = REQUEST_ONSCREEN_DISTANCE * TheCamera.GenerationDistMultiplier;
|
preferredDistance = REQUEST_ONSCREEN_DISTANCE * requestMultiplier * TheCamera.GenerationDistMultiplier;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
/* Spawn a vehicle relatively far away from player. */
|
/* Spawn a vehicle relatively far away from player. */
|
||||||
/* Forward to his current direction (camera direction). */
|
/* Forward to his current direction (camera direction). */
|
||||||
angleLimit = 0.707f; /* 45 degrees */
|
angleLimit = 0.707f; /* 45 degrees */
|
||||||
invertAngleLimitTest = true;
|
invertAngleLimitTest = true;
|
||||||
preferredDistance = REQUEST_ONSCREEN_DISTANCE * TheCamera.GenerationDistMultiplier;
|
preferredDistance = REQUEST_ONSCREEN_DISTANCE * requestMultiplier * TheCamera.GenerationDistMultiplier;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
/* Spawn a vehicle close to player to his side. */
|
/* Spawn a vehicle close to player to his side. */
|
||||||
/* Kinda not within camera angle. */
|
/* Kinda not within camera angle. */
|
||||||
angleLimit = 0.707f; /* 45 degrees */
|
angleLimit = 0.707f; /* 45 degrees */
|
||||||
invertAngleLimitTest = false;
|
invertAngleLimitTest = false;
|
||||||
preferredDistance = OFFSCREEN_DESPAWN_RANGE;
|
preferredDistance = MINIMAL_DISTANCE_TO_SPAWN_OFFSCREEN;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}else if (fPlayerVehicleSpeed > 0.1f){ /* 18 km/h */
|
}
|
||||||
|
else if (fPlayerVehicleSpeed > 0.1f) { /* 18 km/h */
|
||||||
/* Player is moving moderately fast in vehicle */
|
/* Player is moving moderately fast in vehicle */
|
||||||
/* Spawn more vehicles to player's side. */
|
/* Spawn more vehicles to player's side. */
|
||||||
frontX = vecPlayerVehicleSpeed.x / fPlayerVehicleSpeed;
|
frontX = vecPlayerVehicleSpeed.x / fPlayerVehicleSpeed;
|
||||||
|
@ -252,14 +270,14 @@ CCarCtrl::GenerateOneRandomCar()
|
||||||
/* Spawn a vehicle in a very narrow gap in front of a player */
|
/* Spawn a vehicle in a very narrow gap in front of a player */
|
||||||
angleLimit = 0.85f; /* approx 30 degrees */
|
angleLimit = 0.85f; /* approx 30 degrees */
|
||||||
invertAngleLimitTest = true;
|
invertAngleLimitTest = true;
|
||||||
preferredDistance = REQUEST_ONSCREEN_DISTANCE * TheCamera.GenerationDistMultiplier;
|
preferredDistance = REQUEST_ONSCREEN_DISTANCE * requestMultiplier * TheCamera.GenerationDistMultiplier;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
/* Spawn a vehicle relatively far away from player. */
|
/* Spawn a vehicle relatively far away from player. */
|
||||||
/* Forward to his current direction (camera direction). */
|
/* Forward to his current direction (camera direction). */
|
||||||
angleLimit = 0.707f; /* 45 degrees */
|
angleLimit = 0.707f; /* 45 degrees */
|
||||||
invertAngleLimitTest = true;
|
invertAngleLimitTest = true;
|
||||||
preferredDistance = REQUEST_ONSCREEN_DISTANCE * TheCamera.GenerationDistMultiplier;
|
preferredDistance = REQUEST_ONSCREEN_DISTANCE * requestMultiplier * TheCamera.GenerationDistMultiplier;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
case 3:
|
case 3:
|
||||||
|
@ -267,10 +285,11 @@ CCarCtrl::GenerateOneRandomCar()
|
||||||
/* Kinda not within camera angle. */
|
/* Kinda not within camera angle. */
|
||||||
angleLimit = 0.707f; /* 45 degrees */
|
angleLimit = 0.707f; /* 45 degrees */
|
||||||
invertAngleLimitTest = false;
|
invertAngleLimitTest = false;
|
||||||
preferredDistance = OFFSCREEN_DESPAWN_RANGE;
|
preferredDistance = MINIMAL_DISTANCE_TO_SPAWN_OFFSCREEN;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}else{
|
}
|
||||||
|
else {
|
||||||
/* Player is in vehicle but moving very slow. */
|
/* Player is in vehicle but moving very slow. */
|
||||||
/* Then use camera direction instead of vehicle direction. */
|
/* Then use camera direction instead of vehicle direction. */
|
||||||
testForCollision = true;
|
testForCollision = true;
|
||||||
|
@ -282,17 +301,18 @@ CCarCtrl::GenerateOneRandomCar()
|
||||||
/* Forward to his current direction (camera direction). */
|
/* Forward to his current direction (camera direction). */
|
||||||
angleLimit = 0.707f; /* 45 degrees */
|
angleLimit = 0.707f; /* 45 degrees */
|
||||||
invertAngleLimitTest = true;
|
invertAngleLimitTest = true;
|
||||||
preferredDistance = REQUEST_ONSCREEN_DISTANCE * TheCamera.GenerationDistMultiplier;
|
preferredDistance = REQUEST_ONSCREEN_DISTANCE * requestMultiplier * TheCamera.GenerationDistMultiplier;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
/* Spawn a vehicle close to player to his side. */
|
/* Spawn a vehicle close to player to his side. */
|
||||||
/* Kinda not within camera angle. */
|
/* Kinda not within camera angle. */
|
||||||
angleLimit = 0.707f; /* 45 degrees */
|
angleLimit = 0.707f; /* 45 degrees */
|
||||||
invertAngleLimitTest = false;
|
invertAngleLimitTest = false;
|
||||||
preferredDistance = OFFSCREEN_DESPAWN_RANGE;
|
preferredDistance = MINIMAL_DISTANCE_TO_SPAWN_OFFSCREEN;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!ThePaths.GenerateCarCreationCoors(vecTargetPos.x, vecTargetPos.y, frontX, frontY,
|
if (!ThePaths.GenerateCarCreationCoors(vecTargetPos.x, vecTargetPos.y, frontX, frontY,
|
||||||
preferredDistance, angleLimit, invertAngleLimitTest, &spawnPosition, &curNodeId, &nextNodeId,
|
preferredDistance, angleLimit, invertAngleLimitTest, &spawnPosition, &curNodeId, &nextNodeId,
|
||||||
&positionBetweenNodes, carClass == COPS && pWanted->m_nWantedLevel >= 1))
|
&positionBetweenNodes, carClass == COPS && pWanted->m_nWantedLevel >= 1))
|
||||||
|
@ -300,6 +320,8 @@ CCarCtrl::GenerateOneRandomCar()
|
||||||
CPathNode* pCurNode = &ThePaths.m_pathNodes[curNodeId];
|
CPathNode* pCurNode = &ThePaths.m_pathNodes[curNodeId];
|
||||||
CPathNode* pNextNode = &ThePaths.m_pathNodes[nextNodeId];
|
CPathNode* pNextNode = &ThePaths.m_pathNodes[nextNodeId];
|
||||||
bool bBoatGenerated = false;
|
bool bBoatGenerated = false;
|
||||||
|
if (!OkToCreateVehicleAtThisPosition(spawnPosition))
|
||||||
|
return;
|
||||||
if ((CGeneral::GetRandomNumber() & 0xF) > Min(pCurNode->spawnRate, pNextNode->spawnRate))
|
if ((CGeneral::GetRandomNumber() & 0xF) > Min(pCurNode->spawnRate, pNextNode->spawnRate))
|
||||||
return;
|
return;
|
||||||
if (pCurNode->bWaterPath) {
|
if (pCurNode->bWaterPath) {
|
||||||
|
@ -599,12 +621,12 @@ CCarCtrl::GenerateOneRandomCar()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if ((vecTargetPos - pVehicle->GetPosition()).Magnitude2D() > TheCamera.GenerationDistMultiplier * (pVehicle->bExtendedRange ? EXTENDED_RANGE_DESPAWN_MULTIPLIER : 1.0f) * ONSCREEN_DESPAWN_RANGE ||
|
if ((vecTargetPos - pVehicle->GetPosition()).Magnitude2D() > TheCamera.GenerationDistMultiplier * requestMultiplier * (pVehicle->bExtendedRange ? EXTENDED_RANGE_DESPAWN_MULTIPLIER : 1.0f) * ONSCREEN_DESPAWN_RANGE ||
|
||||||
(vecTargetPos - pVehicle->GetPosition()).Magnitude2D() < TheCamera.GenerationDistMultiplier * MINIMAL_DISTANCE_TO_SPAWN_ONSCREEN) {
|
(vecTargetPos - pVehicle->GetPosition()).Magnitude2D() < TheCamera.GenerationDistMultiplier * requestMultiplier * MINIMAL_DISTANCE_TO_SPAWN_ONSCREEN) {
|
||||||
delete pVehicle;
|
delete pVehicle;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((TheCamera.GetPosition() - pVehicle->GetPosition()).Magnitude2D() < 82.5f * TheCamera.GenerationDistMultiplier || bTopDownCamera) {
|
if ((TheCamera.GetPosition() - pVehicle->GetPosition()).Magnitude2D() < 105.0f * requestMultiplier * TheCamera.GenerationDistMultiplier || bTopDownCamera) {
|
||||||
delete pVehicle;
|
delete pVehicle;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -654,13 +676,13 @@ CCarCtrl::GenerateOneRandomCar()
|
||||||
int nMadDrivers;
|
int nMadDrivers;
|
||||||
switch (pVehicle->GetVehicleAppearance()) {
|
switch (pVehicle->GetVehicleAppearance()) {
|
||||||
case VEHICLE_APPEARANCE_BIKE:
|
case VEHICLE_APPEARANCE_BIKE:
|
||||||
nMadDrivers = 30;
|
nMadDrivers = 20;
|
||||||
break;
|
break;
|
||||||
case VEHICLE_APPEARANCE_BOAT:
|
case VEHICLE_APPEARANCE_BOAT:
|
||||||
nMadDrivers = 40;
|
nMadDrivers = 40;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
nMadDrivers = 6;
|
nMadDrivers = 3;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ((CGeneral::GetRandomNumber() & 0x7F) < nMadDrivers || bMadDriversCheat) {
|
if ((CGeneral::GetRandomNumber() & 0x7F) < nMadDrivers || bMadDriversCheat) {
|
||||||
|
@ -719,12 +741,6 @@ CCarCtrl::GenerateOneRandomCar()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
CCarCtrl::BoatWithTallMast(int32 mi)
|
|
||||||
{
|
|
||||||
return mi == MI_RIO || mi == MI_TROPIC || mi == MI_MARQUIS;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32
|
int32
|
||||||
CCarCtrl::ChooseBoatModel(int32 rating)
|
CCarCtrl::ChooseBoatModel(int32 rating)
|
||||||
{
|
{
|
||||||
|
@ -944,6 +960,7 @@ CCarCtrl::RemoveCarsIfThePoolGetsFull(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pClosestVehicle) {
|
if (pClosestVehicle) {
|
||||||
|
debug(":::::::::::\'Nearest removed\' cause pools was full -> NumRandomCars %d\n", NumRandomCars);
|
||||||
CWorld::Remove(pClosestVehicle);
|
CWorld::Remove(pClosestVehicle);
|
||||||
delete pClosestVehicle;
|
delete pClosestVehicle;
|
||||||
}
|
}
|
||||||
|
@ -966,7 +983,10 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
float distanceToPlayer = (pVehicle->GetPosition() - vecPlayerPos).Magnitude2D();
|
float distanceToPlayer = (pVehicle->GetPosition() - vecPlayerPos).Magnitude2D();
|
||||||
float threshold = OFFSCREEN_DESPAWN_RANGE;
|
float despawnMultiplier = 1.0f;
|
||||||
|
if (FindPlayerVehicle() && TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_1STPERSON && !FrontEndMenuManager.m_PrefsUseWideScreen)
|
||||||
|
despawnMultiplier = 0.75f;
|
||||||
|
float threshold = OFFSCREEN_DESPAWN_RANGE * despawnMultiplier;
|
||||||
if (pVehicle->GetIsOnScreen() ||
|
if (pVehicle->GetIsOnScreen() ||
|
||||||
TheCamera.Cams[TheCamera.ActiveCam].LookingLeft ||
|
TheCamera.Cams[TheCamera.ActiveCam].LookingLeft ||
|
||||||
TheCamera.Cams[TheCamera.ActiveCam].LookingRight ||
|
TheCamera.Cams[TheCamera.ActiveCam].LookingRight ||
|
||||||
|
@ -979,7 +999,7 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle)
|
||||||
pVehicle->bIsCarParkVehicle ||
|
pVehicle->bIsCarParkVehicle ||
|
||||||
CTimer::GetTimeInMilliseconds() < pVehicle->m_nSetPieceExtendedRangeTime
|
CTimer::GetTimeInMilliseconds() < pVehicle->m_nSetPieceExtendedRangeTime
|
||||||
){
|
){
|
||||||
threshold = ONSCREEN_DESPAWN_RANGE * TheCamera.GenerationDistMultiplier;
|
threshold = ONSCREEN_DESPAWN_RANGE * despawnMultiplier * TheCamera.GenerationDistMultiplier;
|
||||||
}
|
}
|
||||||
if (TheCamera.GetForward().z < -0.9f)
|
if (TheCamera.GetForward().z < -0.9f)
|
||||||
threshold = 70.0f;
|
threshold = 70.0f;
|
||||||
|
@ -1572,7 +1592,7 @@ void CCarCtrl::WeaveForOtherCar(CEntity* pOtherEntity, CVehicle* pVehicle, float
|
||||||
if (pVehicle->AutoPilot.m_nCarMission == MISSION_RAMCAR_CLOSE && pOtherEntity == pVehicle->AutoPilot.m_pTargetCar)
|
if (pVehicle->AutoPilot.m_nCarMission == MISSION_RAMCAR_CLOSE && pOtherEntity == pVehicle->AutoPilot.m_pTargetCar)
|
||||||
return;
|
return;
|
||||||
CVector2D vecDiff = pOtherCar->GetPosition() - pVehicle->GetPosition();
|
CVector2D vecDiff = pOtherCar->GetPosition() - pVehicle->GetPosition();
|
||||||
float angleBetweenVehicles = CGeneral::GetATanOfXY(vecDiff.x, vecDiff.y);
|
float angleBetweenVehicles = GetATanOfXY(vecDiff.x, vecDiff.y);
|
||||||
float distance = vecDiff.Magnitude();
|
float distance = vecDiff.Magnitude();
|
||||||
if (distance < 1.0f)
|
if (distance < 1.0f)
|
||||||
return;
|
return;
|
||||||
|
@ -1582,7 +1602,7 @@ void CCarCtrl::WeaveForOtherCar(CEntity* pOtherEntity, CVehicle* pVehicle, float
|
||||||
return;
|
return;
|
||||||
CVector2D forward = pVehicle->GetForward();
|
CVector2D forward = pVehicle->GetForward();
|
||||||
forward.Normalise();
|
forward.Normalise();
|
||||||
float forwardAngle = CGeneral::GetATanOfXY(forward.x, forward.y);
|
float forwardAngle = GetATanOfXY(forward.x, forward.y);
|
||||||
float angleDiff = angleBetweenVehicles - forwardAngle;
|
float angleDiff = angleBetweenVehicles - forwardAngle;
|
||||||
float lenProjection = ABS(pOtherCar->GetColModel()->boundingBox.max.y * sin(angleDiff));
|
float lenProjection = ABS(pOtherCar->GetColModel()->boundingBox.max.y * sin(angleDiff));
|
||||||
float widthProjection = ABS(pOtherCar->GetColModel()->boundingBox.max.x * cos(angleDiff));
|
float widthProjection = ABS(pOtherCar->GetColModel()->boundingBox.max.x * cos(angleDiff));
|
||||||
|
@ -1591,16 +1611,12 @@ void CCarCtrl::WeaveForOtherCar(CEntity* pOtherEntity, CVehicle* pVehicle, float
|
||||||
diffToLeftAngle = ABS(diffToLeftAngle);
|
diffToLeftAngle = ABS(diffToLeftAngle);
|
||||||
float angleToWeave = lengthToEvade / 2;
|
float angleToWeave = lengthToEvade / 2;
|
||||||
if (diffToLeftAngle < angleToWeave){
|
if (diffToLeftAngle < angleToWeave){
|
||||||
*pAngleToWeaveLeft = angleBetweenVehicles - angleToWeave;
|
*pAngleToWeaveLeft = LimitRadianAngle(angleBetweenVehicles - angleToWeave);
|
||||||
while (*pAngleToWeaveLeft < -PI)
|
|
||||||
*pAngleToWeaveLeft += TWOPI;
|
|
||||||
}
|
}
|
||||||
float diffToRightAngle = LimitRadianAngle(angleBetweenVehicles - *pAngleToWeaveRight);
|
float diffToRightAngle = LimitRadianAngle(angleBetweenVehicles - *pAngleToWeaveRight);
|
||||||
diffToRightAngle = ABS(diffToRightAngle);
|
diffToRightAngle = ABS(diffToRightAngle);
|
||||||
if (diffToRightAngle < angleToWeave){
|
if (diffToRightAngle < angleToWeave){
|
||||||
*pAngleToWeaveRight = angleBetweenVehicles + angleToWeave;
|
*pAngleToWeaveRight = LimitRadianAngle(angleBetweenVehicles + angleToWeave);
|
||||||
while (*pAngleToWeaveRight > PI)
|
|
||||||
*pAngleToWeaveRight -= TWOPI;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1632,23 +1648,19 @@ void CCarCtrl::WeaveForPed(CEntity* pOtherEntity, CVehicle* pVehicle, float* pAn
|
||||||
return;
|
return;
|
||||||
CPed* pPed = (CPed*)pOtherEntity;
|
CPed* pPed = (CPed*)pOtherEntity;
|
||||||
CVector2D vecDiff = pPed->GetPosition() - pVehicle->GetPosition();
|
CVector2D vecDiff = pPed->GetPosition() - pVehicle->GetPosition();
|
||||||
float angleBetweenVehicleAndPed = CGeneral::GetATanOfXY(vecDiff.x, vecDiff.y);
|
float angleBetweenVehicleAndPed = GetATanOfXY(vecDiff.x, vecDiff.y);
|
||||||
float distance = vecDiff.Magnitude();
|
float distance = vecDiff.Magnitude();
|
||||||
float lengthToEvade = (WIDTH_COEF_TO_WEAVE_SAFELY * 2 * pVehicle->GetColModel()->boundingBox.max.x + PED_WIDTH_TO_WEAVE) / distance;
|
float lengthToEvade = (WIDTH_COEF_TO_WEAVE_SAFELY * 2 * pVehicle->GetColModel()->boundingBox.max.x + PED_WIDTH_TO_WEAVE) / distance;
|
||||||
float diffToLeftAngle = LimitRadianAngle(angleBetweenVehicleAndPed - *pAngleToWeaveLeft);
|
float diffToLeftAngle = LimitRadianAngle(angleBetweenVehicleAndPed - *pAngleToWeaveLeft);
|
||||||
diffToLeftAngle = ABS(diffToLeftAngle);
|
diffToLeftAngle = ABS(diffToLeftAngle);
|
||||||
float angleToWeave = lengthToEvade / 2;
|
float angleToWeave = lengthToEvade / 2;
|
||||||
if (diffToLeftAngle < angleToWeave) {
|
if (diffToLeftAngle < angleToWeave) {
|
||||||
*pAngleToWeaveLeft = angleBetweenVehicleAndPed - angleToWeave;
|
*pAngleToWeaveLeft = LimitRadianAngle(angleBetweenVehicleAndPed - angleToWeave);
|
||||||
while (*pAngleToWeaveLeft < -PI)
|
|
||||||
*pAngleToWeaveLeft += TWOPI;
|
|
||||||
}
|
}
|
||||||
float diffToRightAngle = LimitRadianAngle(angleBetweenVehicleAndPed - *pAngleToWeaveRight);
|
float diffToRightAngle = LimitRadianAngle(angleBetweenVehicleAndPed - *pAngleToWeaveRight);
|
||||||
diffToRightAngle = ABS(diffToRightAngle);
|
diffToRightAngle = ABS(diffToRightAngle);
|
||||||
if (diffToRightAngle < angleToWeave) {
|
if (diffToRightAngle < angleToWeave) {
|
||||||
*pAngleToWeaveRight = angleBetweenVehicleAndPed + angleToWeave;
|
*pAngleToWeaveRight = LimitRadianAngle(angleBetweenVehicleAndPed + angleToWeave);
|
||||||
while (*pAngleToWeaveRight > PI)
|
|
||||||
*pAngleToWeaveRight -= TWOPI;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1704,23 +1716,19 @@ void CCarCtrl::WeaveForObject(CEntity* pOtherEntity, CVehicle* pVehicle, float*
|
||||||
rightCoef * pObject->GetRight() +
|
rightCoef * pObject->GetRight() +
|
||||||
forwardCoef * pObject->GetForward() -
|
forwardCoef * pObject->GetForward() -
|
||||||
pVehicle->GetPosition();
|
pVehicle->GetPosition();
|
||||||
float angleBetweenVehicleAndObject = CGeneral::GetATanOfXY(vecDiff.x, vecDiff.y);
|
float angleBetweenVehicleAndObject = GetATanOfXY(vecDiff.x, vecDiff.y);
|
||||||
float distance = vecDiff.Magnitude();
|
float distance = vecDiff.Magnitude();
|
||||||
float lengthToEvade = (WIDTH_COEF_TO_WEAVE_SAFELY * 2 * pVehicle->GetColModel()->boundingBox.max.x + OBJECT_WIDTH_TO_WEAVE) / distance;
|
float lengthToEvade = (WIDTH_COEF_TO_WEAVE_SAFELY * 2 * pVehicle->GetColModel()->boundingBox.max.x + OBJECT_WIDTH_TO_WEAVE) / distance;
|
||||||
float diffToLeftAngle = LimitRadianAngle(angleBetweenVehicleAndObject - *pAngleToWeaveLeft);
|
float diffToLeftAngle = LimitRadianAngle(angleBetweenVehicleAndObject - *pAngleToWeaveLeft);
|
||||||
diffToLeftAngle = ABS(diffToLeftAngle);
|
diffToLeftAngle = ABS(diffToLeftAngle);
|
||||||
float angleToWeave = lengthToEvade / 2;
|
float angleToWeave = lengthToEvade / 2;
|
||||||
if (diffToLeftAngle < angleToWeave) {
|
if (diffToLeftAngle < angleToWeave) {
|
||||||
*pAngleToWeaveLeft = angleBetweenVehicleAndObject - angleToWeave;
|
*pAngleToWeaveLeft = LimitRadianAngle(angleBetweenVehicleAndObject - angleToWeave);
|
||||||
while (*pAngleToWeaveLeft < -PI)
|
|
||||||
*pAngleToWeaveLeft += TWOPI;
|
|
||||||
}
|
}
|
||||||
float diffToRightAngle = LimitRadianAngle(angleBetweenVehicleAndObject - *pAngleToWeaveRight);
|
float diffToRightAngle = LimitRadianAngle(angleBetweenVehicleAndObject - *pAngleToWeaveRight);
|
||||||
diffToRightAngle = ABS(diffToRightAngle);
|
diffToRightAngle = ABS(diffToRightAngle);
|
||||||
if (diffToRightAngle < angleToWeave) {
|
if (diffToRightAngle < angleToWeave) {
|
||||||
*pAngleToWeaveRight = angleBetweenVehicleAndObject + angleToWeave;
|
*pAngleToWeaveRight = LimitRadianAngle(angleBetweenVehicleAndObject + angleToWeave);
|
||||||
while (*pAngleToWeaveRight > PI)
|
|
||||||
*pAngleToWeaveRight -= TWOPI;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1762,7 +1770,7 @@ bool CCarCtrl::PickNextNodeAccordingStrategy(CVehicle* pVehicle)
|
||||||
void CCarCtrl::PickNextNodeRandomly(CVehicle* pVehicle)
|
void CCarCtrl::PickNextNodeRandomly(CVehicle* pVehicle)
|
||||||
{
|
{
|
||||||
if (pVehicle->m_nRouteSeed)
|
if (pVehicle->m_nRouteSeed)
|
||||||
CGeneral::SetRandomSeed(pVehicle->m_nRouteSeed);
|
CGeneral::SetRandomSeed(pVehicle->m_nRouteSeed++);
|
||||||
int32 prevNode = pVehicle->AutoPilot.m_nCurrentRouteNode;
|
int32 prevNode = pVehicle->AutoPilot.m_nCurrentRouteNode;
|
||||||
int32 curNode = pVehicle->AutoPilot.m_nNextRouteNode;
|
int32 curNode = pVehicle->AutoPilot.m_nNextRouteNode;
|
||||||
uint8 totalLinks = ThePaths.m_pathNodes[curNode].numLinks;
|
uint8 totalLinks = ThePaths.m_pathNodes[curNode].numLinks;
|
||||||
|
@ -1848,14 +1856,16 @@ void CCarCtrl::PickNextNodeRandomly(CVehicle* pVehicle)
|
||||||
pNextPathNode = &ThePaths.m_pathNodes[pVehicle->AutoPilot.m_nNextRouteNode];
|
pNextPathNode = &ThePaths.m_pathNodes[pVehicle->AutoPilot.m_nNextRouteNode];
|
||||||
if ((!pNextPathNode->bDisabled || pPrevPathNode->bDisabled) &&
|
if ((!pNextPathNode->bDisabled || pPrevPathNode->bDisabled) &&
|
||||||
(!pNextPathNode->bBetweenLevels || pPrevPathNode->bBetweenLevels || !pVehicle->AutoPilot.m_bStayInCurrentLevel))
|
(!pNextPathNode->bBetweenLevels || pPrevPathNode->bBetweenLevels || !pVehicle->AutoPilot.m_bStayInCurrentLevel))
|
||||||
/* Nice way to exit loop but this will fail because this is used for indexing! */
|
break;
|
||||||
nextLink = 1000;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (nextLink < 999)
|
if (nextLink >= totalLinks) {
|
||||||
/* If everything else failed, turn vehicle around */
|
/* If everything else failed, turn vehicle around */
|
||||||
|
nextLink = 0;
|
||||||
|
debug("Couldn\'t find ANYTHING. Just go back from where we came.\n");
|
||||||
pVehicle->AutoPilot.m_nNextRouteNode = prevNode;
|
pVehicle->AutoPilot.m_nNextRouteNode = prevNode;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
pNextPathNode = &ThePaths.m_pathNodes[pVehicle->AutoPilot.m_nNextRouteNode];
|
pNextPathNode = &ThePaths.m_pathNodes[pVehicle->AutoPilot.m_nNextRouteNode];
|
||||||
pNextLink = &ThePaths.m_carPathLinks[ThePaths.m_carPathConnections[nextLink + pCurPathNode->firstLink]];
|
pNextLink = &ThePaths.m_carPathLinks[ThePaths.m_carPathConnections[nextLink + pCurPathNode->firstLink]];
|
||||||
if (prevNode == pVehicle->AutoPilot.m_nNextRouteNode){
|
if (prevNode == pVehicle->AutoPilot.m_nNextRouteNode){
|
||||||
|
@ -1967,7 +1977,7 @@ void CCarCtrl::PickNextNodeToChaseCar(CVehicle* pVehicle, float targetX, float t
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (pVehicle->m_nRouteSeed)
|
if (pVehicle->m_nRouteSeed)
|
||||||
CGeneral::SetRandomSeed(pVehicle->m_nRouteSeed);
|
CGeneral::SetRandomSeed(pVehicle->m_nRouteSeed++);
|
||||||
int prevNode = pVehicle->AutoPilot.m_nCurrentRouteNode;
|
int prevNode = pVehicle->AutoPilot.m_nCurrentRouteNode;
|
||||||
int curNode = pVehicle->AutoPilot.m_nNextRouteNode;
|
int curNode = pVehicle->AutoPilot.m_nNextRouteNode;
|
||||||
CPathNode* pPrevNode = &ThePaths.m_pathNodes[prevNode];
|
CPathNode* pPrevNode = &ThePaths.m_pathNodes[prevNode];
|
||||||
|
@ -1987,7 +1997,7 @@ void CCarCtrl::PickNextNodeToChaseCar(CVehicle* pVehicle, float targetX, float t
|
||||||
int nextLink;
|
int nextLink;
|
||||||
if (numNodes != 1 && numNodes != 2 || pTargetNode[0] == pCurNode){
|
if (numNodes != 1 && numNodes != 2 || pTargetNode[0] == pCurNode){
|
||||||
if (numNodes != 2 || pTargetNode[1] == pCurNode) {
|
if (numNodes != 2 || pTargetNode[1] == pCurNode) {
|
||||||
float currentAngle = CGeneral::GetATanOfXY(targetX - pVehicle->GetPosition().x, targetY - pVehicle->GetPosition().y);
|
float currentAngle = GetATanOfXY(targetX - pVehicle->GetPosition().x, targetY - pVehicle->GetPosition().y);
|
||||||
nextLink = 0;
|
nextLink = 0;
|
||||||
float lowestAngleChange = 10.0f;
|
float lowestAngleChange = 10.0f;
|
||||||
int numLinks = pCurNode->numLinks;
|
int numLinks = pCurNode->numLinks;
|
||||||
|
@ -1997,7 +2007,7 @@ void CCarCtrl::PickNextNodeToChaseCar(CVehicle* pVehicle, float targetX, float t
|
||||||
if (conNode == prevNode && i > 1)
|
if (conNode == prevNode && i > 1)
|
||||||
continue;
|
continue;
|
||||||
CPathNode* pTestNode = &ThePaths.m_pathNodes[conNode];
|
CPathNode* pTestNode = &ThePaths.m_pathNodes[conNode];
|
||||||
float angle = CGeneral::GetATanOfXY(pTestNode->GetX() - pCurNode->GetX(), pTestNode->GetY() - pCurNode->GetY());
|
float angle = GetATanOfXY(pTestNode->GetX() - pCurNode->GetX(), pTestNode->GetY() - pCurNode->GetY());
|
||||||
angle = LimitRadianAngle(angle - currentAngle);
|
angle = LimitRadianAngle(angle - currentAngle);
|
||||||
angle = ABS(angle);
|
angle = ABS(angle);
|
||||||
if (angle < lowestAngleChange) {
|
if (angle < lowestAngleChange) {
|
||||||
|
@ -2415,6 +2425,16 @@ void CCarCtrl::SteerAICarWithPhysics_OnlyMission(CVehicle* pVehicle, float* pSwe
|
||||||
*pHandbrake = true;
|
*pHandbrake = true;
|
||||||
return;
|
return;
|
||||||
case MISSION_CRUISE:
|
case MISSION_CRUISE:
|
||||||
|
if (CTrafficLights::ShouldCarStopForBridge(pVehicle)) {
|
||||||
|
*pAccel = 0.0f;
|
||||||
|
*pBrake = 1.0f;
|
||||||
|
*pHandbrake = true;
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
*pSwerve = 0.0f;
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// fallthough
|
||||||
case MISSION_RAMPLAYER_FARAWAY:
|
case MISSION_RAMPLAYER_FARAWAY:
|
||||||
case MISSION_BLOCKPLAYER_FARAWAY:
|
case MISSION_BLOCKPLAYER_FARAWAY:
|
||||||
case MISSION_GOTOCOORDS:
|
case MISSION_GOTOCOORDS:
|
||||||
|
@ -2485,11 +2505,19 @@ void CCarCtrl::SteerAICarWithPhysics_OnlyMission(CVehicle* pVehicle, float* pSwe
|
||||||
*pHandbrake = false;
|
*pHandbrake = false;
|
||||||
return;
|
return;
|
||||||
case MISSION_RAMCAR_CLOSE:
|
case MISSION_RAMCAR_CLOSE:
|
||||||
|
if (!pVehicle->AutoPilot.m_pTargetCar) {
|
||||||
|
debug("NO TARGET VEHICLE FOR MISSION_RAMCAR_CLOSE\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
SteerAICarWithPhysicsHeadingForTarget(pVehicle, pVehicle->AutoPilot.m_pTargetCar,
|
SteerAICarWithPhysicsHeadingForTarget(pVehicle, pVehicle->AutoPilot.m_pTargetCar,
|
||||||
pVehicle->AutoPilot.m_pTargetCar->GetPosition().x, pVehicle->AutoPilot.m_pTargetCar->GetPosition().y,
|
pVehicle->AutoPilot.m_pTargetCar->GetPosition().x, pVehicle->AutoPilot.m_pTargetCar->GetPosition().y,
|
||||||
pSwerve, pAccel, pBrake, pHandbrake);
|
pSwerve, pAccel, pBrake, pHandbrake);
|
||||||
return;
|
return;
|
||||||
case MISSION_BLOCKCAR_CLOSE:
|
case MISSION_BLOCKCAR_CLOSE:
|
||||||
|
if (!pVehicle->AutoPilot.m_pTargetCar) {
|
||||||
|
debug("NO TARGET VEHICLE FOR MISSION_BLOCKCAR_CLOSE\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
SteerAICarWithPhysicsTryingToBlockTarget(pVehicle,
|
SteerAICarWithPhysicsTryingToBlockTarget(pVehicle,
|
||||||
pVehicle->AutoPilot.m_pTargetCar->GetPosition().x,
|
pVehicle->AutoPilot.m_pTargetCar->GetPosition().x,
|
||||||
pVehicle->AutoPilot.m_pTargetCar->GetPosition().y,
|
pVehicle->AutoPilot.m_pTargetCar->GetPosition().y,
|
||||||
|
@ -2498,6 +2526,9 @@ void CCarCtrl::SteerAICarWithPhysics_OnlyMission(CVehicle* pVehicle, float* pSwe
|
||||||
pSwerve, pAccel, pBrake, pHandbrake);
|
pSwerve, pAccel, pBrake, pHandbrake);
|
||||||
return;
|
return;
|
||||||
case MISSION_BLOCKCAR_HANDBRAKESTOP:
|
case MISSION_BLOCKCAR_HANDBRAKESTOP:
|
||||||
|
if (!pVehicle->AutoPilot.m_pTargetCar) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
SteerAICarWithPhysicsTryingToBlockTarget_Stop(pVehicle,
|
SteerAICarWithPhysicsTryingToBlockTarget_Stop(pVehicle,
|
||||||
pVehicle->AutoPilot.m_pTargetCar->GetPosition().x,
|
pVehicle->AutoPilot.m_pTargetCar->GetPosition().x,
|
||||||
pVehicle->AutoPilot.m_pTargetCar->GetPosition().y,
|
pVehicle->AutoPilot.m_pTargetCar->GetPosition().y,
|
||||||
|
@ -2575,8 +2606,8 @@ void CCarCtrl::SteerAIBoatWithPhysicsHeadingForTarget(CVehicle* pVehicle, float
|
||||||
{
|
{
|
||||||
CVector2D forward = pVehicle->GetForward();
|
CVector2D forward = pVehicle->GetForward();
|
||||||
forward.Normalise();
|
forward.Normalise();
|
||||||
float angleToTarget = CGeneral::GetATanOfXY(targetX - pVehicle->GetPosition().x, targetY - pVehicle->GetPosition().y);
|
float angleToTarget = GetATanOfXY(targetX - pVehicle->GetPosition().x, targetY - pVehicle->GetPosition().y);
|
||||||
float angleForward = CGeneral::GetATanOfXY(forward.x, forward.y);
|
float angleForward = GetATanOfXY(forward.x, forward.y);
|
||||||
float steerAngle = LimitRadianAngle(angleToTarget - angleForward);
|
float steerAngle = LimitRadianAngle(angleToTarget - angleForward);
|
||||||
steerAngle = clamp(steerAngle, -DEFAULT_MAX_STEER_ANGLE, DEFAULT_MAX_STEER_ANGLE);
|
steerAngle = clamp(steerAngle, -DEFAULT_MAX_STEER_ANGLE, DEFAULT_MAX_STEER_ANGLE);
|
||||||
#ifdef FIX_BUGS
|
#ifdef FIX_BUGS
|
||||||
|
@ -2607,8 +2638,8 @@ void CCarCtrl::SteerAIBoatWithPhysicsAttackingPlayer(CVehicle* pVehicle, float*
|
||||||
CVector2D forward = pVehicle->GetForward();
|
CVector2D forward = pVehicle->GetForward();
|
||||||
forward.Normalise();
|
forward.Normalise();
|
||||||
CVector2D vecToProjection = FindPlayerCoors() + FindPlayerSpeed() * projection * GAME_SPEED_TO_CARAI_SPEED;
|
CVector2D vecToProjection = FindPlayerCoors() + FindPlayerSpeed() * projection * GAME_SPEED_TO_CARAI_SPEED;
|
||||||
float angleToTarget = CGeneral::GetATanOfXY(vecToProjection.x - pVehicle->GetPosition().x, vecToProjection.y - pVehicle->GetPosition().y);
|
float angleToTarget = GetATanOfXY(vecToProjection.x - pVehicle->GetPosition().x, vecToProjection.y - pVehicle->GetPosition().y);
|
||||||
float angleForward = CGeneral::GetATanOfXY(forward.x, forward.y);
|
float angleForward = GetATanOfXY(forward.x, forward.y);
|
||||||
float steerAngle = LimitRadianAngle(angleToTarget - angleForward);
|
float steerAngle = LimitRadianAngle(angleToTarget - angleForward);
|
||||||
#ifdef FIX_BUGS
|
#ifdef FIX_BUGS
|
||||||
float speedTarget = pVehicle->AutoPilot.GetCruiseSpeed();
|
float speedTarget = pVehicle->AutoPilot.GetCruiseSpeed();
|
||||||
|
@ -2696,7 +2727,7 @@ void CCarCtrl::SteerAIHeliTowardsTargetCoors(CAutomobile* pHeli)
|
||||||
if (distanceToTarget < 8.0f && pHeli->m_fHeliOrientation < 0.0f)
|
if (distanceToTarget < 8.0f && pHeli->m_fHeliOrientation < 0.0f)
|
||||||
ZTurnSpeedTarget = 0.0f;
|
ZTurnSpeedTarget = 0.0f;
|
||||||
else {
|
else {
|
||||||
float fAngleTarget = CGeneral::GetATanOfXY(vecToTarget.x, vecToTarget.y) + PI;
|
float fAngleTarget = GetATanOfXY(vecToTarget.x, vecToTarget.y) + PI;
|
||||||
if (pHeli->m_fHeliOrientation >= 0.0f)
|
if (pHeli->m_fHeliOrientation >= 0.0f)
|
||||||
fAngleTarget = pHeli->m_fHeliOrientation;
|
fAngleTarget = pHeli->m_fHeliOrientation;
|
||||||
fAngleTarget -= pHeli->m_fOrientation;
|
fAngleTarget -= pHeli->m_fOrientation;
|
||||||
|
@ -2739,7 +2770,7 @@ void CCarCtrl::SteerAIPlaneTowardsTargetCoors(CAutomobile* pPlane)
|
||||||
CVector2D vecToTarget = pPlane->AutoPilot.m_vecDestinationCoors - pPlane->GetPosition();
|
CVector2D vecToTarget = pPlane->AutoPilot.m_vecDestinationCoors - pPlane->GetPosition();
|
||||||
float fForwardZ = (pPlane->AutoPilot.m_vecDestinationCoors.z - pPlane->GetPosition().z) / vecToTarget.Magnitude();
|
float fForwardZ = (pPlane->AutoPilot.m_vecDestinationCoors.z - pPlane->GetPosition().z) / vecToTarget.Magnitude();
|
||||||
fForwardZ = clamp(fForwardZ, -0.3f, 0.3f);
|
fForwardZ = clamp(fForwardZ, -0.3f, 0.3f);
|
||||||
float angle = CGeneral::GetATanOfXY(vecToTarget.x, vecToTarget.y);
|
float angle = GetATanOfXY(vecToTarget.x, vecToTarget.y);
|
||||||
while (angle > TWOPI)
|
while (angle > TWOPI)
|
||||||
angle -= TWOPI;
|
angle -= TWOPI;
|
||||||
float difference = LimitRadianAngle(angle - pPlane->m_fOrientation);
|
float difference = LimitRadianAngle(angle - pPlane->m_fOrientation);
|
||||||
|
@ -2836,8 +2867,8 @@ void CCarCtrl::SteerAICarWithPhysicsFollowPath(CVehicle* pVehicle, float* pSwerv
|
||||||
projectedPosition.y = positionOnCurrentLinkIncludingLane.y;
|
projectedPosition.y = positionOnCurrentLinkIncludingLane.y;
|
||||||
}
|
}
|
||||||
CVector2D distanceToProjectedPosition = projectedPosition - pVehicle->GetPosition();
|
CVector2D distanceToProjectedPosition = projectedPosition - pVehicle->GetPosition();
|
||||||
float angleCurrentLink = CGeneral::GetATanOfXY(distanceToProjectedPosition.x, distanceToProjectedPosition.y);
|
float angleCurrentLink = GetATanOfXY(distanceToProjectedPosition.x, distanceToProjectedPosition.y);
|
||||||
float angleForward = CGeneral::GetATanOfXY(forward.x, forward.y);
|
float angleForward = GetATanOfXY(forward.x, forward.y);
|
||||||
if (pVehicle->AutoPilot.m_nDrivingStyle == DRIVINGSTYLE_AVOID_CARS)
|
if (pVehicle->AutoPilot.m_nDrivingStyle == DRIVINGSTYLE_AVOID_CARS)
|
||||||
angleCurrentLink = FindAngleToWeaveThroughTraffic(pVehicle, nil, angleCurrentLink, angleForward);
|
angleCurrentLink = FindAngleToWeaveThroughTraffic(pVehicle, nil, angleCurrentLink, angleForward);
|
||||||
float steerAngle = LimitRadianAngle(angleCurrentLink - angleForward);
|
float steerAngle = LimitRadianAngle(angleCurrentLink - angleForward);
|
||||||
|
@ -2882,11 +2913,11 @@ void CCarCtrl::SteerAICarWithPhysicsFollowPath(CVehicle* pVehicle, float* pSwerv
|
||||||
pCurrentLink->GetY() - ((pVehicle->AutoPilot.m_nCurrentLane + pCurrentLink->OneWayLaneOffset()) * LANE_WIDTH) * currentPathLinkForward.x);
|
pCurrentLink->GetY() - ((pVehicle->AutoPilot.m_nCurrentLane + pCurrentLink->OneWayLaneOffset()) * LANE_WIDTH) * currentPathLinkForward.x);
|
||||||
trajectory -= pVehicle->GetPosition();
|
trajectory -= pVehicle->GetPosition();
|
||||||
float speedAngleMultiplier = FindSpeedMultiplier(
|
float speedAngleMultiplier = FindSpeedMultiplier(
|
||||||
CGeneral::GetATanOfXY(trajectory.x, trajectory.y) - angleForward,
|
GetATanOfXY(trajectory.x, trajectory.y) - angleForward,
|
||||||
MIN_ANGLE_FOR_SPEED_LIMITING, MAX_ANGLE_FOR_SPEED_LIMITING, MIN_LOWERING_SPEED_COEFFICIENT);
|
MIN_ANGLE_FOR_SPEED_LIMITING, MAX_ANGLE_FOR_SPEED_LIMITING, MIN_LOWERING_SPEED_COEFFICIENT);
|
||||||
float tmpWideMultiplier = FindSpeedMultiplier(
|
float tmpWideMultiplier = FindSpeedMultiplier(
|
||||||
CGeneral::GetATanOfXY(currentPathLinkForward.x, currentPathLinkForward.y) -
|
GetATanOfXY(currentPathLinkForward.x, currentPathLinkForward.y) -
|
||||||
CGeneral::GetATanOfXY(nextPathLinkForwardX, nextPathLinkForwardY),
|
GetATanOfXY(nextPathLinkForwardX, nextPathLinkForwardY),
|
||||||
MIN_ANGLE_FOR_SPEED_LIMITING_BETWEEN_NODES, MAX_ANGLE_FOR_SPEED_LIMITING, MIN_LOWERING_SPEED_COEFFICIENT);
|
MIN_ANGLE_FOR_SPEED_LIMITING_BETWEEN_NODES, MAX_ANGLE_FOR_SPEED_LIMITING, MIN_LOWERING_SPEED_COEFFICIENT);
|
||||||
float speedNodesMultiplier;
|
float speedNodesMultiplier;
|
||||||
if (scalarDistanceToNextNode > DISTANCE_TO_NEXT_NODE_TO_CONSIDER_SLOWING_DOWN || pVehicle->AutoPilot.m_nCruiseSpeed < 12)
|
if (scalarDistanceToNextNode > DISTANCE_TO_NEXT_NODE_TO_CONSIDER_SLOWING_DOWN || pVehicle->AutoPilot.m_nCruiseSpeed < 12)
|
||||||
|
@ -2920,8 +2951,8 @@ void CCarCtrl::SteerAICarWithPhysicsHeadingForTarget(CVehicle* pVehicle, CPhysic
|
||||||
*pHandbrake = false;
|
*pHandbrake = false;
|
||||||
CVector2D forward = pVehicle->GetForward();
|
CVector2D forward = pVehicle->GetForward();
|
||||||
forward.Normalise();
|
forward.Normalise();
|
||||||
float angleToTarget = CGeneral::GetATanOfXY(targetX - pVehicle->GetPosition().x, targetY - pVehicle->GetPosition().y);
|
float angleToTarget = GetATanOfXY(targetX - pVehicle->GetPosition().x, targetY - pVehicle->GetPosition().y);
|
||||||
float angleForward = CGeneral::GetATanOfXY(forward.x, forward.y);
|
float angleForward = GetATanOfXY(forward.x, forward.y);
|
||||||
if (pVehicle->AutoPilot.m_nDrivingStyle == DRIVINGSTYLE_AVOID_CARS)
|
if (pVehicle->AutoPilot.m_nDrivingStyle == DRIVINGSTYLE_AVOID_CARS)
|
||||||
angleToTarget = FindAngleToWeaveThroughTraffic(pVehicle, pTarget, angleToTarget, angleForward);
|
angleToTarget = FindAngleToWeaveThroughTraffic(pVehicle, pTarget, angleToTarget, angleForward);
|
||||||
float steerAngle = LimitRadianAngle(angleToTarget - angleForward);
|
float steerAngle = LimitRadianAngle(angleToTarget - angleForward);
|
||||||
|
@ -3127,7 +3158,7 @@ bool CCarCtrl::JoinCarWithRoadSystemGotoCoors(CVehicle* pVehicle, CVector vecTar
|
||||||
void CCarCtrl::FindLinksToGoWithTheseNodes(CVehicle* pVehicle)
|
void CCarCtrl::FindLinksToGoWithTheseNodes(CVehicle* pVehicle)
|
||||||
{
|
{
|
||||||
if (pVehicle->m_nRouteSeed)
|
if (pVehicle->m_nRouteSeed)
|
||||||
CGeneral::SetRandomSeed(pVehicle->m_nRouteSeed);
|
CGeneral::SetRandomSeed(pVehicle->m_nRouteSeed++);
|
||||||
int nextLink;
|
int nextLink;
|
||||||
CPathNode* pCurNode = &ThePaths.m_pathNodes[pVehicle->AutoPilot.m_nCurrentRouteNode];
|
CPathNode* pCurNode = &ThePaths.m_pathNodes[pVehicle->AutoPilot.m_nCurrentRouteNode];
|
||||||
for (nextLink = 0; nextLink < 12; nextLink++)
|
for (nextLink = 0; nextLink < 12; nextLink++)
|
||||||
|
@ -3169,10 +3200,12 @@ void CCarCtrl::GenerateEmergencyServicesCar(void)
|
||||||
return;
|
return;
|
||||||
if (CGame::IsInInterior())
|
if (CGame::IsInInterior())
|
||||||
return;
|
return;
|
||||||
|
if (TheCamera.m_WideScreenOn) // TODO(LCS): verify
|
||||||
|
return;
|
||||||
if (NumFiretrucksOnDuty + NumAmbulancesOnDuty + NumParkedCars + NumMissionCars +
|
if (NumFiretrucksOnDuty + NumAmbulancesOnDuty + NumParkedCars + NumMissionCars +
|
||||||
NumLawEnforcerCars + NumRandomCars > MaxNumberOfCarsInUse)
|
NumLawEnforcerCars + NumRandomCars > MaxNumberOfCarsInUse)
|
||||||
return;
|
return;
|
||||||
if (NumAmbulancesOnDuty == 0){
|
if (NumAmbulancesOnDuty == 0 /* TODO(LCS): && gbEmergencyVehiclesEnabled */){
|
||||||
if (gAccidentManager.CountActiveAccidents() < 2){
|
if (gAccidentManager.CountActiveAccidents() < 2){
|
||||||
if (CStreaming::HasModelLoaded(MI_AMBULAN))
|
if (CStreaming::HasModelLoaded(MI_AMBULAN))
|
||||||
CStreaming::SetModelIsDeletable(MI_MEDIC);
|
CStreaming::SetModelIsDeletable(MI_MEDIC);
|
||||||
|
@ -3191,7 +3224,7 @@ void CCarCtrl::GenerateEmergencyServicesCar(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (NumFiretrucksOnDuty == 0){
|
if (NumFiretrucksOnDuty == 0 /* TODO(LCS): && gbEmergencyVehiclesEnabled */){
|
||||||
if (gFireManager.GetTotalActiveFires() < 3){
|
if (gFireManager.GetTotalActiveFires() < 3){
|
||||||
if (CStreaming::HasModelLoaded(MI_FIRETRUCK))
|
if (CStreaming::HasModelLoaded(MI_FIRETRUCK))
|
||||||
CStreaming::SetModelIsDeletable(MI_FIREMAN);
|
CStreaming::SetModelIsDeletable(MI_FIREMAN);
|
||||||
|
@ -3348,6 +3381,17 @@ bool CCarCtrl::MapCouldMoveInThisArea(float x, float y)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
CCarCtrl::BoatWithTallMast(int32 mi)
|
||||||
|
{
|
||||||
|
return mi == MI_RIO || mi == MI_TROPIC || mi == MI_MARQUIS;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CCarCtrl::OkToCreateVehicleAtThisPosition(const CVector& pos)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
float CCarCtrl::FindSpeedMultiplierWithSpeedFromNodes(int8 type)
|
float CCarCtrl::FindSpeedMultiplierWithSpeedFromNodes(int8 type)
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
|
@ -3357,3 +3401,8 @@ float CCarCtrl::FindSpeedMultiplierWithSpeedFromNodes(int8 type)
|
||||||
}
|
}
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CCarCtrl::RenderDebugInfo(CVehicle*)
|
||||||
|
{
|
||||||
|
//TODO(LCS)
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "PathFind.h"
|
#include "PathFind.h"
|
||||||
#include "Boat.h"
|
#include "Boat.h"
|
||||||
|
#include "General.h"
|
||||||
#include "Vehicle.h"
|
#include "Vehicle.h"
|
||||||
|
|
||||||
#define GAME_SPEED_TO_METERS_PER_SECOND 50.0f
|
#define GAME_SPEED_TO_METERS_PER_SECOND 50.0f
|
||||||
|
@ -130,6 +131,10 @@ public:
|
||||||
static void SteerAIBoatWithPhysicsAttackingPlayer(CVehicle*, float*, float*, float*, bool*);
|
static void SteerAIBoatWithPhysicsAttackingPlayer(CVehicle*, float*, float*, float*, bool*);
|
||||||
static void SteerAICarBlockingPlayerForwardAndBack(CVehicle*, float*, float*, float*, bool*);
|
static void SteerAICarBlockingPlayerForwardAndBack(CVehicle*, float*, float*, float*, bool*);
|
||||||
|
|
||||||
|
static bool OkToCreateVehicleAtThisPosition(const CVector&);
|
||||||
|
static void RenderDebugInfo(CVehicle*);
|
||||||
|
static float GetATanOfXY(float x, float y) { float t = CGeneral::GetATanOfXY(x, y); if (t < 0.0f) t += TWOPI; return t; }
|
||||||
|
|
||||||
static float GetPositionAlongCurrentCurve(CVehicle* pVehicle)
|
static float GetPositionAlongCurrentCurve(CVehicle* pVehicle)
|
||||||
{
|
{
|
||||||
uint32 timeInCurve = CTimer::GetTimeInMilliseconds() - pVehicle->AutoPilot.m_nTimeEnteredCurve;
|
uint32 timeInCurve = CTimer::GetTimeInMilliseconds() - pVehicle->AutoPilot.m_nTimeEnteredCurve;
|
||||||
|
@ -138,11 +143,7 @@ public:
|
||||||
|
|
||||||
static float LimitRadianAngle(float angle)
|
static float LimitRadianAngle(float angle)
|
||||||
{
|
{
|
||||||
while (angle < -PI)
|
return CGeneral::LimitRadianAngle(angle);
|
||||||
angle += TWOPI;
|
|
||||||
while (angle > PI)
|
|
||||||
angle -= TWOPI;
|
|
||||||
return angle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool bMadDriversCheat;
|
static bool bMadDriversCheat;
|
||||||
|
|
|
@ -1494,9 +1494,9 @@ void CGarage::BuildRotatedDoorMatrix(CEntity * pDoor, float fPosition)
|
||||||
void CGarage::UpdateCrusherAngle()
|
void CGarage::UpdateCrusherAngle()
|
||||||
{
|
{
|
||||||
RefreshDoorPointers(false);
|
RefreshDoorPointers(false);
|
||||||
m_pDoor2->GetMatrix().SetRotateXOnly(TWOPI - m_fDoorPos);
|
//m_pDoor2->GetMatrix().SetRotateXOnly(TWOPI - m_fDoorPos); TODO
|
||||||
m_pDoor2->GetMatrix().UpdateRW();
|
//m_pDoor2->GetMatrix().UpdateRW();
|
||||||
m_pDoor2->UpdateRwFrame();
|
//m_pDoor2->UpdateRwFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGarage::UpdateCrusherShake(float X, float Y)
|
void CGarage::UpdateCrusherShake(float X, float Y)
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -47,7 +47,7 @@ void FlushLog();
|
||||||
|
|
||||||
#define KEY_LENGTH_IN_SCRIPT (8)
|
#define KEY_LENGTH_IN_SCRIPT (8)
|
||||||
|
|
||||||
//#define GTA_SCRIPT_COLLECTIVE
|
#define GTA_SCRIPT_COLLECTIVE
|
||||||
|
|
||||||
struct intro_script_rectangle
|
struct intro_script_rectangle
|
||||||
{
|
{
|
||||||
|
@ -214,16 +214,34 @@ public:
|
||||||
bool HasCarBeenStuckForAWhile(int32);
|
bool HasCarBeenStuckForAWhile(int32);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
MAX_STACK_DEPTH = 16,
|
||||||
|
NUM_LOCAL_VARS = 96,
|
||||||
|
NUM_TIMERS = 2,
|
||||||
|
NUM_GLOBAL_SLOTS = 26
|
||||||
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
ARGUMENT_END = 0,
|
ARGUMENT_END = 0,
|
||||||
|
ARGUMENT_INT_ZERO,
|
||||||
|
ARGUMENT_FLOAT_ZERO,
|
||||||
|
ARGUMENT_FLOAT_1BYTE,
|
||||||
|
ARGUMENT_FLOAT_2BYTES,
|
||||||
|
ARGUMENT_FLOAT_3BYTES,
|
||||||
ARGUMENT_INT32,
|
ARGUMENT_INT32,
|
||||||
ARGUMENT_GLOBALVAR,
|
|
||||||
ARGUMENT_LOCALVAR,
|
|
||||||
ARGUMENT_INT8,
|
ARGUMENT_INT8,
|
||||||
ARGUMENT_INT16,
|
ARGUMENT_INT16,
|
||||||
ARGUMENT_FLOAT
|
ARGUMENT_FLOAT,
|
||||||
|
ARGUMENT_TIMER,
|
||||||
|
ARGUMENT_LOCAL = ARGUMENT_TIMER + NUM_TIMERS,
|
||||||
|
ARGUMENT_LOCAL_ARRAY = ARGUMENT_LOCAL + NUM_LOCAL_VARS,
|
||||||
|
ARGUMENT_GLOBAL = ARGUMENT_LOCAL_ARRAY + NUM_LOCAL_VARS,
|
||||||
|
ARGUMENT_GLOBAL_ARRAY = ARGUMENT_GLOBAL + NUM_GLOBAL_SLOTS,
|
||||||
|
MAX_ARGUMENT = ARGUMENT_GLOBAL_ARRAY + NUM_GLOBAL_SLOTS
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static_assert(MAX_ARGUMENT <= 256, "MAX_ARGUMENT must be less or equal to 256");
|
||||||
|
|
||||||
struct tCollectiveData
|
struct tCollectiveData
|
||||||
{
|
{
|
||||||
int32 colIndex;
|
int32 colIndex;
|
||||||
|
@ -253,38 +271,31 @@ enum {
|
||||||
VAR_GLOBAL = 2,
|
VAR_GLOBAL = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
|
||||||
#ifdef PS2
|
|
||||||
SIZE_MAIN_SCRIPT = 205512,
|
|
||||||
#else
|
|
||||||
SIZE_MAIN_SCRIPT = 225512,
|
|
||||||
#endif
|
|
||||||
SIZE_MISSION_SCRIPT = 35000,
|
|
||||||
SIZE_SCRIPT_SPACE = SIZE_MAIN_SCRIPT + SIZE_MISSION_SCRIPT
|
|
||||||
};
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
MAX_NUM_SCRIPTS = 128,
|
MAX_NUM_SCRIPTS = 128,
|
||||||
MAX_NUM_INTRO_TEXT_LINES = 48,
|
MAX_NUM_INTRO_TEXT_LINES = 48,
|
||||||
MAX_NUM_INTRO_RECTANGLES = 16,
|
MAX_NUM_INTRO_RECTANGLES = 16,
|
||||||
MAX_NUM_SCRIPT_SRPITES = 16,
|
MAX_NUM_SCRIPT_SRPITES = 16,
|
||||||
MAX_NUM_SCRIPT_SPHERES = 16,
|
MAX_NUM_SCRIPT_SPHERES = 16,
|
||||||
MAX_NUM_USED_OBJECTS = 220,
|
MAX_NUM_COLLECTIVES = 32,
|
||||||
MAX_NUM_MISSION_SCRIPTS = 120,
|
MAX_NUM_USED_OBJECTS = 305,
|
||||||
MAX_NUM_BUILDING_SWAPS = 25,
|
MAX_NUM_MISSION_SCRIPTS = 150,
|
||||||
MAX_NUM_INVISIBILITY_SETTINGS = 20,
|
MAX_NUM_BUILDING_SWAPS = 80,
|
||||||
MAX_NUM_STORED_LINES = 1024
|
MAX_NUM_INVISIBILITY_SETTINGS = 52,
|
||||||
|
MAX_NUM_STORED_LINES = 1024,
|
||||||
|
MAX_ALLOWED_COLLISIONS = 2
|
||||||
};
|
};
|
||||||
|
|
||||||
class CTheScripts
|
class CTheScripts
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static uint8 ScriptSpace[SIZE_SCRIPT_SPACE];
|
static uint8* ScriptSpace;
|
||||||
static CRunningScript ScriptsArray[MAX_NUM_SCRIPTS];
|
static CRunningScript ScriptsArray[MAX_NUM_SCRIPTS];
|
||||||
static intro_text_line IntroTextLines[MAX_NUM_INTRO_TEXT_LINES];
|
static intro_text_line IntroTextLines[MAX_NUM_INTRO_TEXT_LINES];
|
||||||
static intro_script_rectangle IntroRectangles[MAX_NUM_INTRO_RECTANGLES];
|
static intro_script_rectangle IntroRectangles[MAX_NUM_INTRO_RECTANGLES];
|
||||||
static CSprite2d ScriptSprites[MAX_NUM_SCRIPT_SRPITES];
|
static CSprite2d ScriptSprites[MAX_NUM_SCRIPT_SRPITES];
|
||||||
static script_sphere_struct ScriptSphereArray[MAX_NUM_SCRIPT_SPHERES];
|
static script_sphere_struct ScriptSphereArray[MAX_NUM_SCRIPT_SPHERES];
|
||||||
|
static tCollectiveData CollectiveArray[MAX_NUM_COLLECTIVES];
|
||||||
static tUsedObject UsedObjectArray[MAX_NUM_USED_OBJECTS];
|
static tUsedObject UsedObjectArray[MAX_NUM_USED_OBJECTS];
|
||||||
static int32 MultiScriptArray[MAX_NUM_MISSION_SCRIPTS];
|
static int32 MultiScriptArray[MAX_NUM_MISSION_SCRIPTS];
|
||||||
static tBuildingSwap BuildingSwapArray[MAX_NUM_BUILDING_SWAPS];
|
static tBuildingSwap BuildingSwapArray[MAX_NUM_BUILDING_SWAPS];
|
||||||
|
@ -316,20 +327,22 @@ public:
|
||||||
static uint16 ScriptsUpdated;
|
static uint16 ScriptsUpdated;
|
||||||
static uint32 LastMissionPassedTime;
|
static uint32 LastMissionPassedTime;
|
||||||
static uint16 NumberOfExclusiveMissionScripts;
|
static uint16 NumberOfExclusiveMissionScripts;
|
||||||
#if (defined GTA_PC && !defined GTAVC_JP_PATCH || defined GTA_XBOX || defined SUPPORT_XBOX_SCRIPT || defined GTA_MOBILE || defined SUPPORT_MOBILE_SCRIPT)
|
|
||||||
#define CARDS_IN_SUIT (13)
|
|
||||||
#define NUM_SUITS (4)
|
|
||||||
#define MAX_DECKS (6)
|
|
||||||
#define CARDS_IN_DECK (CARDS_IN_SUIT * NUM_SUITS)
|
|
||||||
#define CARDS_IN_STACK (CARDS_IN_DECK * MAX_DECKS)
|
|
||||||
static int16 CardStack[CARDS_IN_STACK];
|
|
||||||
static int16 CardStackPosition;
|
|
||||||
#endif
|
|
||||||
static bool bPlayerIsInTheStatium;
|
static bool bPlayerIsInTheStatium;
|
||||||
static uint8 RiotIntensity;
|
static uint8 RiotIntensity;
|
||||||
static bool bPlayerHasMetDebbieHarry;
|
static bool bPlayerHasMetDebbieHarry;
|
||||||
|
|
||||||
static void Init();
|
static int AllowedCollision[MAX_ALLOWED_COLLISIONS];
|
||||||
|
static short* SavedVarIndices;
|
||||||
|
static int NumSaveVars;
|
||||||
|
static bool FSDestroyedFlag;
|
||||||
|
static int NextProcessId;
|
||||||
|
static bool InTheScripts;
|
||||||
|
static CRunningScript* pCurrent;
|
||||||
|
static uint16 NumTrueGlobals;
|
||||||
|
static uint16 MostGlobals;
|
||||||
|
|
||||||
|
static bool Init(bool loaddata = false);
|
||||||
static void Process();
|
static void Process();
|
||||||
|
|
||||||
static CRunningScript* StartTestScript();
|
static CRunningScript* StartTestScript();
|
||||||
|
@ -420,6 +433,9 @@ public:
|
||||||
static void SwitchToMission(int32 mission);
|
static void SwitchToMission(int32 mission);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static int GetSaveVarIndex(int);
|
||||||
|
static void Shutdown(void);
|
||||||
|
|
||||||
#ifdef GTA_SCRIPT_COLLECTIVE
|
#ifdef GTA_SCRIPT_COLLECTIVE
|
||||||
static void AdvanceCollectiveIndex()
|
static void AdvanceCollectiveIndex()
|
||||||
{
|
{
|
||||||
|
@ -441,12 +457,9 @@ public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern int ScriptParams[32];
|
||||||
|
|
||||||
enum {
|
VALIDATE_SIZE(uStackReturnValue, 4);
|
||||||
MAX_STACK_DEPTH = 6,
|
|
||||||
NUM_LOCAL_VARS = 16,
|
|
||||||
NUM_TIMERS = 2
|
|
||||||
};
|
|
||||||
|
|
||||||
class CRunningScript
|
class CRunningScript
|
||||||
{
|
{
|
||||||
|
@ -470,14 +483,25 @@ class CRunningScript
|
||||||
ORS_8
|
ORS_8
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
STACKVALUE_IP_BITS = 22,
|
||||||
|
STACKVALUE_INVERT_RETURN_BIT = STACKVALUE_IP_BITS,
|
||||||
|
STACKVALUE_IS_FUNCTION_CALL_BIT,
|
||||||
|
STACKVALUE_IP_PARAMS_OFFSET,
|
||||||
|
|
||||||
|
STACKVALUE_IP_MASK = ((1 << STACKVALUE_IP_BITS) - 1)
|
||||||
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CRunningScript* next;
|
CRunningScript* next;
|
||||||
CRunningScript* prev;
|
CRunningScript* prev;
|
||||||
|
int m_nId;
|
||||||
char m_abScriptName[8];
|
char m_abScriptName[8];
|
||||||
uint32 m_nIp;
|
uint32 m_nIp;
|
||||||
uint32 m_anStack[MAX_STACK_DEPTH];
|
uint32 m_anStack[MAX_STACK_DEPTH];
|
||||||
uint16 m_nStackPointer;
|
uint16 m_nStackPointer;
|
||||||
int32 m_anLocalVariables[NUM_LOCAL_VARS + NUM_TIMERS];
|
int32 m_anLocalVariables[NUM_LOCAL_VARS + 8 + NUM_TIMERS]; // TODO(LCS): figure out why 106
|
||||||
|
int32 m_nLocalsPointer;
|
||||||
bool m_bIsActive;
|
bool m_bIsActive;
|
||||||
bool m_bCondResult;
|
bool m_bCondResult;
|
||||||
bool m_bIsMissionScript;
|
bool m_bIsMissionScript;
|
||||||
|
@ -497,8 +521,8 @@ public:
|
||||||
void Load(uint8*& buf);
|
void Load(uint8*& buf);
|
||||||
|
|
||||||
void UpdateTimers(float timeStep) {
|
void UpdateTimers(float timeStep) {
|
||||||
m_anLocalVariables[NUM_LOCAL_VARS] += timeStep;
|
for (int i = 0; i < NUM_TIMERS; i++)
|
||||||
m_anLocalVariables[NUM_LOCAL_VARS + 1] += timeStep;
|
m_anLocalVariables[NUM_LOCAL_VARS + 8 + i] += timeStep;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Init();
|
void Init();
|
||||||
|
@ -509,7 +533,7 @@ public:
|
||||||
|
|
||||||
static const uint32 nSaveStructSize;
|
static const uint32 nSaveStructSize;
|
||||||
|
|
||||||
void CollectParameters(uint32*, int16);
|
void CollectParameters(uint32*, int16, int* pParams = (int*)&ScriptParams);
|
||||||
int32 CollectNextParameterWithoutIncreasingPC(uint32);
|
int32 CollectNextParameterWithoutIncreasingPC(uint32);
|
||||||
int32* GetPointerToScriptVariable(uint32*, int16);
|
int32* GetPointerToScriptVariable(uint32*, int16);
|
||||||
void StoreParameters(uint32*, int16);
|
void StoreParameters(uint32*, int16);
|
||||||
|
@ -534,6 +558,8 @@ public:
|
||||||
int8 ProcessCommands1200To1299(int32);
|
int8 ProcessCommands1200To1299(int32);
|
||||||
int8 ProcessCommands1300To1399(int32);
|
int8 ProcessCommands1300To1399(int32);
|
||||||
int8 ProcessCommands1400To1499(int32);
|
int8 ProcessCommands1400To1499(int32);
|
||||||
|
int8 ProcessCommands1500To1599(int32);
|
||||||
|
int8 ProcessCommands1600To1699(int32);
|
||||||
|
|
||||||
void LocatePlayerCommand(int32, uint32*);
|
void LocatePlayerCommand(int32, uint32*);
|
||||||
void LocatePlayerCharCommand(int32, uint32*);
|
void LocatePlayerCharCommand(int32, uint32*);
|
||||||
|
@ -571,11 +597,11 @@ public:
|
||||||
float LimitAngleOnCircle(float angle) { return angle < 0.0f ? angle + 360.0f : angle; }
|
float LimitAngleOnCircle(float angle) { return angle < 0.0f ? angle + 360.0f : angle; }
|
||||||
|
|
||||||
bool ThisIsAValidRandomPed(uint32 pedtype, int civ, int gang, int criminal);
|
bool ThisIsAValidRandomPed(uint32 pedtype, int civ, int gang, int criminal);
|
||||||
|
|
||||||
bool CheckDamagedWeaponType(int32 actual, int32 type);
|
bool CheckDamagedWeaponType(int32 actual, int32 type);
|
||||||
|
|
||||||
static bool ThisIsAValidRandomCop(int32 mi, bool cop, bool swat, bool fbi, bool army, bool miami);
|
static bool ThisIsAValidRandomCop(int32 mi, bool cop, bool swat, bool fbi, bool army, bool miami);
|
||||||
|
|
||||||
|
void ReturnFromGosubOrFunction();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef USE_DEBUG_SCRIPT_LOADER
|
#ifdef USE_DEBUG_SCRIPT_LOADER
|
||||||
|
@ -600,3 +626,6 @@ void RetryMission(int, int);
|
||||||
#ifdef USE_DEBUG_SCRIPT_LOADER
|
#ifdef USE_DEBUG_SCRIPT_LOADER
|
||||||
extern int scriptToLoad;
|
extern int scriptToLoad;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern int gScriptsFile;
|
||||||
|
|
||||||
|
|
|
@ -168,7 +168,7 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
|
||||||
*/
|
*/
|
||||||
case COMMAND_DISPLAY_ONSCREEN_TIMER:
|
case COMMAND_DISPLAY_ONSCREEN_TIMER:
|
||||||
{
|
{
|
||||||
script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR);
|
//script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR);
|
||||||
m_nIp++;
|
m_nIp++;
|
||||||
uint16 offset = CTheScripts::Read2BytesFromScript(&m_nIp);
|
uint16 offset = CTheScripts::Read2BytesFromScript(&m_nIp);
|
||||||
CollectParameters(&m_nIp, 1);
|
CollectParameters(&m_nIp, 1);
|
||||||
|
@ -177,14 +177,14 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
|
||||||
}
|
}
|
||||||
case COMMAND_CLEAR_ONSCREEN_TIMER:
|
case COMMAND_CLEAR_ONSCREEN_TIMER:
|
||||||
{
|
{
|
||||||
script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR);
|
//script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR);
|
||||||
m_nIp++;
|
m_nIp++;
|
||||||
CUserDisplay::OnscnTimer.ClearClock((uint16)CTheScripts::Read2BytesFromScript(&m_nIp));
|
CUserDisplay::OnscnTimer.ClearClock((uint16)CTheScripts::Read2BytesFromScript(&m_nIp));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
case COMMAND_DISPLAY_ONSCREEN_COUNTER:
|
case COMMAND_DISPLAY_ONSCREEN_COUNTER:
|
||||||
{
|
{
|
||||||
script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR);
|
//script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR);
|
||||||
m_nIp++;
|
m_nIp++;
|
||||||
int16 counter = CTheScripts::Read2BytesFromScript(&m_nIp);
|
int16 counter = CTheScripts::Read2BytesFromScript(&m_nIp);
|
||||||
CollectParameters(&m_nIp, 1);
|
CollectParameters(&m_nIp, 1);
|
||||||
|
@ -193,7 +193,7 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
|
||||||
}
|
}
|
||||||
case COMMAND_CLEAR_ONSCREEN_COUNTER:
|
case COMMAND_CLEAR_ONSCREEN_COUNTER:
|
||||||
{
|
{
|
||||||
script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR);
|
//script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR);
|
||||||
m_nIp++;
|
m_nIp++;
|
||||||
CUserDisplay::OnscnTimer.ClearCounter((uint16)CTheScripts::Read2BytesFromScript(&m_nIp));
|
CUserDisplay::OnscnTimer.ClearCounter((uint16)CTheScripts::Read2BytesFromScript(&m_nIp));
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -590,7 +590,7 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
|
||||||
//case COMMAND_MOVE_CAMERA_ALONG_SPLINE:
|
//case COMMAND_MOVE_CAMERA_ALONG_SPLINE:
|
||||||
//case COMMAND_GET_CAMERA_POSITION_ALONG_SPLINE:
|
//case COMMAND_GET_CAMERA_POSITION_ALONG_SPLINE:
|
||||||
case COMMAND_DECLARE_MISSION_FLAG:
|
case COMMAND_DECLARE_MISSION_FLAG:
|
||||||
CTheScripts::OnAMissionFlag = (uint16)CTheScripts::Read2BytesFromScript(&++m_nIp);
|
CTheScripts::OnAMissionFlag = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL) - (int32*)CTheScripts::ScriptSpace;
|
||||||
return 0;
|
return 0;
|
||||||
case COMMAND_DECLARE_MISSION_FLAG_FOR_CONTACT:
|
case COMMAND_DECLARE_MISSION_FLAG_FOR_CONTACT:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -1639,7 +1639,6 @@ int8 CRunningScript::ProcessCommands700To799(int32 command)
|
||||||
UpdateCompareFlag(TheCamera.IsSphereVisible(pObject->GetBoundCentre(), pObject->GetBoundRadius()));
|
UpdateCompareFlag(TheCamera.IsSphereVisible(pObject->GetBoundCentre(), pObject->GetBoundRadius()));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
case COMMAND_GOSUB_FILE:
|
case COMMAND_GOSUB_FILE:
|
||||||
{
|
{
|
||||||
CollectParameters(&m_nIp, 2);
|
CollectParameters(&m_nIp, 2);
|
||||||
|
@ -1649,7 +1648,6 @@ int8 CRunningScript::ProcessCommands700To799(int32 command)
|
||||||
// ScriptParams[1] == filename
|
// ScriptParams[1] == filename
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
case COMMAND_GET_GROUND_Z_FOR_3D_COORD:
|
case COMMAND_GET_GROUND_Z_FOR_3D_COORD:
|
||||||
{
|
{
|
||||||
CollectParameters(&m_nIp, 3);
|
CollectParameters(&m_nIp, 3);
|
||||||
|
@ -2126,7 +2124,6 @@ int8 CRunningScript::ProcessCommands700To799(int32 command)
|
||||||
CollectParameters(&m_nIp, 2);
|
CollectParameters(&m_nIp, 2);
|
||||||
CGarages::ChangeGarageType(ScriptParams[0], ScriptParams[1], 0);
|
CGarages::ChangeGarageType(ScriptParams[0], ScriptParams[1], 0);
|
||||||
return 0;
|
return 0;
|
||||||
/*
|
|
||||||
case COMMAND_ACTIVATE_CRUSHER_CRANE:
|
case COMMAND_ACTIVATE_CRUSHER_CRANE:
|
||||||
{
|
{
|
||||||
CollectParameters(&m_nIp, 10);
|
CollectParameters(&m_nIp, 10);
|
||||||
|
@ -2148,6 +2145,7 @@ int8 CRunningScript::ProcessCommands700To799(int32 command)
|
||||||
*(float*)&ScriptParams[0], *(float*)&ScriptParams[1]);
|
*(float*)&ScriptParams[0], *(float*)&ScriptParams[1]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
case COMMAND_PRINT_WITH_2_NUMBERS:
|
case COMMAND_PRINT_WITH_2_NUMBERS:
|
||||||
{
|
{
|
||||||
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
||||||
|
|
|
@ -1781,7 +1781,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
|
||||||
*/
|
*/
|
||||||
case COMMAND_DISPLAY_ONSCREEN_TIMER_WITH_STRING:
|
case COMMAND_DISPLAY_ONSCREEN_TIMER_WITH_STRING:
|
||||||
{
|
{
|
||||||
script_assert(CTheScripts::ScriptSpace[m_nIp++] == ARGUMENT_GLOBALVAR);
|
//script_assert(CTheScripts::ScriptSpace[m_nIp++] == ARGUMENT_GLOBALVAR);
|
||||||
uint16 var = CTheScripts::Read2BytesFromScript(&m_nIp);
|
uint16 var = CTheScripts::Read2BytesFromScript(&m_nIp);
|
||||||
CollectParameters(&m_nIp, 1);
|
CollectParameters(&m_nIp, 1);
|
||||||
wchar* text = TheText.Get((char*)&CTheScripts::ScriptSpace[m_nIp]); // ???
|
wchar* text = TheText.Get((char*)&CTheScripts::ScriptSpace[m_nIp]); // ???
|
||||||
|
@ -1792,7 +1792,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
|
||||||
}
|
}
|
||||||
case COMMAND_DISPLAY_ONSCREEN_COUNTER_WITH_STRING:
|
case COMMAND_DISPLAY_ONSCREEN_COUNTER_WITH_STRING:
|
||||||
{
|
{
|
||||||
script_assert(CTheScripts::ScriptSpace[m_nIp++] == ARGUMENT_GLOBALVAR);
|
//script_assert(CTheScripts::ScriptSpace[m_nIp++] == ARGUMENT_GLOBALVAR);
|
||||||
uint16 var = CTheScripts::Read2BytesFromScript(&m_nIp);
|
uint16 var = CTheScripts::Read2BytesFromScript(&m_nIp);
|
||||||
CollectParameters(&m_nIp, 1);
|
CollectParameters(&m_nIp, 1);
|
||||||
wchar* text = TheText.Get((char*)&CTheScripts::ScriptSpace[m_nIp]); // ???
|
wchar* text = TheText.Get((char*)&CTheScripts::ScriptSpace[m_nIp]); // ???
|
||||||
|
|
|
@ -2556,7 +2556,7 @@ void CTheScripts::SetObjectiveForAllPedsInCollective(int colIndex, eObjective ob
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pPed->bScriptObjectiveCompleted = false;
|
pPed->bScriptObjectiveCompleted = false;
|
||||||
pPed->SetObjective(objective, p1, p2);
|
//pPed->SetObjective(objective, p1, p2); TODO!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2740,6 +2740,9 @@ void CTheScripts::ReadObjectNamesFromScript()
|
||||||
{
|
{
|
||||||
int32 varSpace = GetSizeOfVariableSpace();
|
int32 varSpace = GetSizeOfVariableSpace();
|
||||||
uint32 ip = varSpace + 8;
|
uint32 ip = varSpace + 8;
|
||||||
|
NumSaveVars = Read4BytesFromScript(&ip);
|
||||||
|
SavedVarIndices = (short*)&ScriptParams[ip];
|
||||||
|
ip += 2 * NumSaveVars;
|
||||||
NumberOfUsedObjects = Read2BytesFromScript(&ip);
|
NumberOfUsedObjects = Read2BytesFromScript(&ip);
|
||||||
ip += 2;
|
ip += 2;
|
||||||
for (uint16 i = 0; i < NumberOfUsedObjects; i++) {
|
for (uint16 i = 0; i < NumberOfUsedObjects; i++) {
|
||||||
|
@ -2784,7 +2787,8 @@ void CTheScripts::ReadMultiScriptFileOffsetsFromScript()
|
||||||
uint32 ip = varSpace + 3;
|
uint32 ip = varSpace + 3;
|
||||||
int32 objectSize = Read4BytesFromScript(&ip);
|
int32 objectSize = Read4BytesFromScript(&ip);
|
||||||
ip = objectSize + 8;
|
ip = objectSize + 8;
|
||||||
MainScriptSize = Read4BytesFromScript(&ip);
|
NumTrueGlobals = Read2BytesFromScript(&ip);
|
||||||
|
MostGlobals = Read2BytesFromScript(&ip);
|
||||||
LargestMissionScriptSize = Read4BytesFromScript(&ip);
|
LargestMissionScriptSize = Read4BytesFromScript(&ip);
|
||||||
NumberOfMissionScripts = Read2BytesFromScript(&ip);
|
NumberOfMissionScripts = Read2BytesFromScript(&ip);
|
||||||
NumberOfExclusiveMissionScripts = Read2BytesFromScript(&ip);
|
NumberOfExclusiveMissionScripts = Read2BytesFromScript(&ip);
|
||||||
|
|
|
@ -374,32 +374,30 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command)
|
||||||
{
|
{
|
||||||
CollectParameters(&m_nIp, 1);
|
CollectParameters(&m_nIp, 1);
|
||||||
|
|
||||||
if (CTheScripts::NumberOfExclusiveMissionScripts > 0 && ScriptParams[0] <= UINT16_MAX - 2)
|
if (CTheScripts::NumberOfExclusiveMissionScripts > 0) {
|
||||||
|
if (ScriptParams[0] < UINT16_MAX - 1)
|
||||||
return 0;
|
return 0;
|
||||||
|
ScriptParams[0] = UINT16_MAX - ScriptParams[0];
|
||||||
|
}
|
||||||
#ifdef MISSION_REPLAY
|
#ifdef MISSION_REPLAY
|
||||||
missionRetryScriptIndex = ScriptParams[0];
|
missionRetryScriptIndex = ScriptParams[0];
|
||||||
if (missionRetryScriptIndex == 19)
|
if (missionRetryScriptIndex == 19)
|
||||||
CStats::LastMissionPassedName[0] = '\0';
|
CStats::LastMissionPassedName[0] = '\0';
|
||||||
#endif
|
#endif
|
||||||
CTimer::Suspend();
|
CTimer::Suspend();
|
||||||
int offset = CTheScripts::MultiScriptArray[ScriptParams[0]];
|
int offset = CTheScripts::MultiScriptArray[ScriptParams[0]] + 8;
|
||||||
#ifdef USE_DEBUG_SCRIPT_LOADER
|
int size = CTheScripts::MultiScriptArray[ScriptParams[0] + 1] - CTheScripts::MultiScriptArray[ScriptParams[0]];
|
||||||
CFileMgr::ChangeDir("\\data\\");
|
if (size <= 0)
|
||||||
int handle = CFileMgr::OpenFile(scriptfile, "rb");
|
size = CTheScripts::LargestMissionScriptSize;
|
||||||
CFileMgr::ChangeDir("\\");
|
CFileMgr::Seek(gScriptsFile, offset, 0);
|
||||||
#else
|
CFileMgr::Read(gScriptsFile, (const char*)&CTheScripts::ScriptSpace[CTheScripts::MainScriptSize], size); // TODO
|
||||||
CFileMgr::ChangeDir("\\");
|
CRunningScript* pMissionScript = CTheScripts::StartNewScript(CTheScripts::MainScriptSize);
|
||||||
int handle = CFileMgr::OpenFile("data\\main.scm", "rb");
|
|
||||||
#endif
|
|
||||||
CFileMgr::Seek(handle, offset, 0);
|
|
||||||
CFileMgr::Read(handle, (const char*)&CTheScripts::ScriptSpace[SIZE_MAIN_SCRIPT], SIZE_MISSION_SCRIPT);
|
|
||||||
CFileMgr::CloseFile(handle);
|
|
||||||
CRunningScript* pMissionScript = CTheScripts::StartNewScript(SIZE_MAIN_SCRIPT);
|
|
||||||
CTimer::Resume();
|
CTimer::Resume();
|
||||||
pMissionScript->m_bIsMissionScript = true;
|
pMissionScript->m_bIsMissionScript = true;
|
||||||
pMissionScript->m_bMissionFlag = true;
|
pMissionScript->m_bMissionFlag = true;
|
||||||
CTheScripts::bAlreadyRunningAMissionScript = true;
|
CTheScripts::bAlreadyRunningAMissionScript = true;
|
||||||
CGameLogic::ClearShortCut();
|
memset(&CTheScripts::ScriptSpace[CTheScripts::NumTrueGlobals * 4 + 8], 0, CTheScripts::MostGlobals * 4);
|
||||||
|
pMissionScript->Process();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
case COMMAND_SET_OBJECT_DRAW_LAST:
|
case COMMAND_SET_OBJECT_DRAW_LAST:
|
||||||
|
|
|
@ -540,7 +540,7 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command)
|
||||||
case COMMAND_DISPLAY_NTH_ONSCREEN_COUNTER_WITH_STRING:
|
case COMMAND_DISPLAY_NTH_ONSCREEN_COUNTER_WITH_STRING:
|
||||||
{
|
{
|
||||||
char onscreen_str[12];
|
char onscreen_str[12];
|
||||||
script_assert(CTheScripts::ScriptSpace[m_nIp++] == ARGUMENT_GLOBALVAR);
|
//script_assert(CTheScripts::ScriptSpace[m_nIp++] == ARGUMENT_GLOBALVAR);
|
||||||
uint16 var = CTheScripts::Read2BytesFromScript(&m_nIp);
|
uint16 var = CTheScripts::Read2BytesFromScript(&m_nIp);
|
||||||
CollectParameters(&m_nIp, 2);
|
CollectParameters(&m_nIp, 2);
|
||||||
wchar* text = TheText.Get((char*)&CTheScripts::ScriptSpace[m_nIp]); // ???
|
wchar* text = TheText.Get((char*)&CTheScripts::ScriptSpace[m_nIp]); // ???
|
||||||
|
|
|
@ -384,7 +384,6 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command)
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#if (defined GTAVC_JP_PATCH || defined SUPPORT_JAPANESE_SCRIPT)
|
|
||||||
case COMMAND_IS_JAPANESE_GAME:
|
case COMMAND_IS_JAPANESE_GAME:
|
||||||
#ifdef MORE_LANGUAGES
|
#ifdef MORE_LANGUAGES
|
||||||
UpdateCompareFlag(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_JAPANESE);
|
UpdateCompareFlag(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_JAPANESE);
|
||||||
|
@ -394,218 +393,697 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command)
|
||||||
UpdateCompareFlag(false);
|
UpdateCompareFlag(false);
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
#elif (!defined GTA_PS2)
|
case COMMAND_1442:
|
||||||
case COMMAND_SET_ONSCREEN_COUNTER_FLASH_WHEN_FIRST_DISPLAYED:
|
script_assert(false);
|
||||||
script_assert(CTheScripts::ScriptSpace[m_nIp++] == ARGUMENT_GLOBALVAR);
|
return 0;
|
||||||
uint16 var = CTheScripts::Read2BytesFromScript(&m_nIp);
|
case COMMAND_1443:
|
||||||
CollectParameters(&m_nIp, 1);
|
script_assert(false);
|
||||||
//CUserDisplay::OnscnTimer.SetCounterFlashWhenFirstDisplayed(var, ScriptParams[0]);
|
return 0;
|
||||||
break;
|
case COMMAND_1444:
|
||||||
#endif
|
script_assert(false);
|
||||||
#if (defined GTA_PC && !defined GTAVC_JP_PATCH || defined GTA_XBOX || defined SUPPORT_XBOX_SCRIPT || defined GTA_MOBILE || defined SUPPORT_MOBILE_SCRIPT)
|
return 0;
|
||||||
case COMMAND_SHUFFLE_CARD_DECKS:
|
case COMMAND_1445:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1446:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1447:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1448:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1449:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1450:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1451:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1452:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1453:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_CALL:
|
||||||
|
case COMMAND_NOTCALL:
|
||||||
{
|
{
|
||||||
|
m_anStack[m_nStackPointer++] = m_nIp | BIT(STACKVALUE_IS_FUNCTION_CALL_BIT) | ((command == COMMAND_NOTCALL) ? BIT(STACKVALUE_INVERT_RETURN_BIT) : 0);
|
||||||
|
uint8 nInputParams = CTheScripts::Read1ByteFromScript(&m_nIp);
|
||||||
|
uint8 nOutputParameters = CTheScripts::Read1ByteFromScript(&m_nIp);
|
||||||
|
uint8 nLocalsOffset = CTheScripts::Read1ByteFromScript(&m_nIp);
|
||||||
|
uint32 nIPBeforeParameters = m_nIp;
|
||||||
CollectParameters(&m_nIp, 1);
|
CollectParameters(&m_nIp, 1);
|
||||||
script_assert(ScriptParams[0] >= 0 && ScriptParams[0] <= 6);
|
if (nInputParams)
|
||||||
for (int i = 0; i < CARDS_IN_STACK; i++)
|
CollectParameters(&m_nIp, nInputParams, &m_anLocalVariables[m_nLocalsPointer + nLocalsOffset]);
|
||||||
CTheScripts::CardStack[i] = 0;
|
m_nLocalsPointer += nLocalsOffset;
|
||||||
int16 seq[CARDS_IN_STACK];
|
m_anStack[m_nStackPointer - 1] |= (m_nIp - nIPBeforeParameters) << STACKVALUE_IP_PARAMS_OFFSET;
|
||||||
for (int i = 0; i < MAX_DECKS * CARDS_IN_DECK; i++)
|
if (ScriptParams[0] < 0)
|
||||||
seq[i] = i;
|
m_nIp = CTheScripts::MainScriptSize - ScriptParams[0];
|
||||||
int cards_left = CARDS_IN_DECK * ScriptParams[0];
|
|
||||||
for (int k = 1; k < CARDS_IN_DECK + 1; k++) {
|
|
||||||
for (int deck = 0; deck < ScriptParams[0]; deck++) {
|
|
||||||
int index = CGeneral::GetRandomNumberInRange(0, cards_left);
|
|
||||||
CTheScripts::CardStack[seq[index]] = k;
|
|
||||||
for (int l = index; l < cards_left; l++) {
|
|
||||||
if (l + 1 < CARDS_IN_STACK)
|
|
||||||
seq[l] = seq[l + 1];
|
|
||||||
else
|
else
|
||||||
seq[l] = 0;
|
m_nIp = ScriptParams[0];
|
||||||
}
|
|
||||||
--cards_left;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CTheScripts::CardStackPosition = 0;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
case COMMAND_FETCH_NEXT_CARD:
|
case COMMAND_1456:
|
||||||
{
|
script_assert(false);
|
||||||
if (CTheScripts::CardStack[CTheScripts::CardStackPosition] == 0)
|
|
||||||
CTheScripts::CardStackPosition = 0;
|
|
||||||
ScriptParams[0] = CTheScripts::CardStack[CTheScripts::CardStackPosition++];
|
|
||||||
if (CTheScripts::CardStackPosition == CARDS_IN_DECK * MAX_DECKS)
|
|
||||||
CTheScripts::CardStackPosition = 0;
|
|
||||||
StoreParameters(&m_nIp, 1);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
case COMMAND_1457:
|
||||||
case COMMAND_GET_OBJECT_VELOCITY:
|
script_assert(false);
|
||||||
{
|
|
||||||
CollectParameters(&m_nIp, 1);
|
|
||||||
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
|
||||||
*(CVector*)&ScriptParams[0] = GAME_SPEED_TO_METERS_PER_SECOND * pObject->GetMoveSpeed();
|
|
||||||
StoreParameters(&m_nIp, 3);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
case COMMAND_1458:
|
||||||
case COMMAND_IS_DEBUG_CAMERA_ON:
|
script_assert(false);
|
||||||
UpdateCompareFlag(TheCamera.WorldViewerBeingUsed);
|
|
||||||
return 0;
|
return 0;
|
||||||
case COMMAND_ADD_TO_OBJECT_ROTATION_VELOCITY:
|
case COMMAND_1459:
|
||||||
{
|
script_assert(false);
|
||||||
CollectParameters(&m_nIp, 4);
|
|
||||||
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
|
||||||
CVector newSpeed = pObject->GetTurnSpeed() + *(CVector*)&ScriptParams[1] / GAME_SPEED_TO_METERS_PER_SECOND;
|
|
||||||
if (pObject->bIsStatic) {
|
|
||||||
pObject->SetIsStatic(false);
|
|
||||||
pObject->AddToMovingList();
|
|
||||||
}
|
|
||||||
pObject->SetTurnSpeed(newSpeed.x, newSpeed.y, newSpeed.z);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
case COMMAND_1460:
|
||||||
case COMMAND_SET_OBJECT_ROTATION_VELOCITY:
|
script_assert(false);
|
||||||
{
|
|
||||||
CollectParameters(&m_nIp, 4);
|
|
||||||
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
|
||||||
CVector newSpeed = *(CVector*)&ScriptParams[1] / GAME_SPEED_TO_METERS_PER_SECOND;
|
|
||||||
if (pObject->bIsStatic) {
|
|
||||||
pObject->SetIsStatic(false);
|
|
||||||
pObject->AddToMovingList();
|
|
||||||
}
|
|
||||||
pObject->SetTurnSpeed(newSpeed.x, newSpeed.y, newSpeed.z);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
case COMMAND_1461:
|
||||||
case COMMAND_IS_OBJECT_STATIC:
|
script_assert(false);
|
||||||
{
|
|
||||||
CollectParameters(&m_nIp, 1);
|
|
||||||
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
|
||||||
UpdateCompareFlag(pObject->GetIsStatic());
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
case COMMAND_1462:
|
||||||
case COMMAND_GET_ANGLE_BETWEEN_2D_VECTORS:
|
script_assert(false);
|
||||||
{
|
|
||||||
CollectParameters(&m_nIp, 4);
|
|
||||||
CVector2D v1 = *(CVector2D*)&ScriptParams[0];
|
|
||||||
CVector2D v2 = *(CVector2D*)&ScriptParams[2];
|
|
||||||
float c = DotProduct2D(v1, v2) / (v1.Magnitude() * v2.Magnitude());
|
|
||||||
#ifdef FIX_BUGS // command is a SA leftover where it was fixed to this
|
|
||||||
*(float*)&ScriptParams[0] = RADTODEG(Acos(c));
|
|
||||||
#else
|
|
||||||
*(float*)&ScriptParams[0] = Acos(c);
|
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
case COMMAND_1463:
|
||||||
case COMMAND_DO_2D_RECTANGLES_COLLIDE:
|
script_assert(false);
|
||||||
{
|
|
||||||
CollectParameters(&m_nIp, 8);
|
|
||||||
float infX1 = *(float*)&ScriptParams[0] - *(float*)&ScriptParams[2] * 0.5; // NB: not float
|
|
||||||
float supX1 = *(float*)&ScriptParams[0] + *(float*)&ScriptParams[2] * 0.5;
|
|
||||||
float infX2 = *(float*)&ScriptParams[4] - *(float*)&ScriptParams[6] * 0.5;
|
|
||||||
float supX2 = *(float*)&ScriptParams[4] + *(float*)&ScriptParams[6] * 0.5;
|
|
||||||
float infY1 = *(float*)&ScriptParams[1] - *(float*)&ScriptParams[3] * 0.5;
|
|
||||||
float supY1 = *(float*)&ScriptParams[1] + *(float*)&ScriptParams[3] * 0.5;
|
|
||||||
float infY2 = *(float*)&ScriptParams[5] - *(float*)&ScriptParams[7] * 0.5;
|
|
||||||
float supY2 = *(float*)&ScriptParams[5] + *(float*)&ScriptParams[7] * 0.5;
|
|
||||||
bool collide = true;
|
|
||||||
if (infY2 > supY1)
|
|
||||||
collide = false;
|
|
||||||
if (infY1 > supY2)
|
|
||||||
collide = false;
|
|
||||||
if (infX2 > supX1)
|
|
||||||
collide = false;
|
|
||||||
if (infX1 > supX2)
|
|
||||||
collide = false;
|
|
||||||
UpdateCompareFlag(collide);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
case COMMAND_1464:
|
||||||
case COMMAND_GET_OBJECT_ROTATION_VELOCITY:
|
script_assert(false);
|
||||||
{
|
|
||||||
CollectParameters(&m_nIp, 1);
|
|
||||||
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
|
||||||
*(CVector*)&ScriptParams[0] = pObject->GetTurnSpeed() * GAME_SPEED_TO_METERS_PER_SECOND;
|
|
||||||
StoreParameters(&m_nIp, 3);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
case COMMAND_1465:
|
||||||
case COMMAND_ADD_VELOCITY_RELATIVE_TO_OBJECT_VELOCITY:
|
script_assert(false);
|
||||||
{
|
|
||||||
CollectParameters(&m_nIp, 4);
|
|
||||||
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
|
||||||
CVector vecAddition = *(CVector*)&ScriptParams[1] * CTimer::GetTimeStep() / GAME_SPEED_TO_METERS_PER_SECOND;
|
|
||||||
if (!pObject->bIsStatic) {
|
|
||||||
CVector vecCurrSpeed = pObject->GetSpeed();
|
|
||||||
vecCurrSpeed.Normalise();
|
|
||||||
if (vecCurrSpeed.z != 1.0) { // NB: not float!
|
|
||||||
CVector vx = CrossProduct(vecCurrSpeed, CVector(0.0f, 0.0f, 1.0f));
|
|
||||||
vx.Normalise();
|
|
||||||
CVector vz = CrossProduct(vx, vecCurrSpeed);
|
|
||||||
vz.Normalise();
|
|
||||||
CVector vecNewSpeed = pObject->GetSpeed() + vecAddition.x * vx + vecAddition.y * vecCurrSpeed + vecAddition.z * vecCurrSpeed;
|
|
||||||
if (pObject->bIsStatic) {
|
|
||||||
pObject->SetIsStatic(false);
|
|
||||||
pObject->AddToMovingList();
|
|
||||||
}
|
|
||||||
pObject->SetMoveSpeed(vecNewSpeed);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
case COMMAND_1466:
|
||||||
case COMMAND_GET_OBJECT_SPEED:
|
script_assert(false);
|
||||||
{
|
|
||||||
CollectParameters(&m_nIp, 1);
|
|
||||||
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
|
||||||
*(float*)&ScriptParams[0] = pObject->GetMoveSpeed().Magnitude() * GAME_SPEED_TO_METERS_PER_SECOND;
|
|
||||||
StoreParameters(&m_nIp, 1);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
case COMMAND_1467:
|
||||||
#endif
|
script_assert(false);
|
||||||
#if (defined GTA_MOBILE || defined SUPPORT_MOBILE_SCRIPT)
|
|
||||||
case COMMAND_IS_MISSION_SKIP:
|
|
||||||
#ifdef MISSION_REPLAY
|
|
||||||
ScriptParams[0] = MissionSkipLevel;
|
|
||||||
#else
|
|
||||||
ScriptParams[0] = 0;
|
|
||||||
#endif
|
|
||||||
StoreParameters(&m_nIp, 1);
|
|
||||||
return 0;
|
return 0;
|
||||||
case COMMAND_SET_IN_AMMUNATION:
|
case COMMAND_1468:
|
||||||
CollectParameters(&m_nIp, 1);
|
script_assert(false);
|
||||||
#ifdef MISSION_REPLAY
|
|
||||||
IsInAmmunation = ScriptParams[0];
|
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
case COMMAND_DO_SAVE_GAME:
|
case COMMAND_1469:
|
||||||
CollectParameters(&m_nIp, 1);
|
script_assert(false);
|
||||||
#ifdef MISSION_REPLAY
|
|
||||||
SaveGameForPause(ScriptParams[0]);
|
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
case COMMAND_IS_RETRY:
|
case COMMAND_1470:
|
||||||
#ifdef MISSION_REPLAY
|
script_assert(false);
|
||||||
if (strcmp(m_abScriptName, "porno4") != 0)
|
|
||||||
ScriptParams[0] = AllowMissionReplay;
|
|
||||||
#ifdef FIX_BUGS
|
|
||||||
else
|
|
||||||
ScriptParams[0] = gbTryingPorn4Again;
|
|
||||||
#else
|
|
||||||
else if (gbTryingPorn4Again)
|
|
||||||
ScriptParams[0] = 1;
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
ScriptParams[0] = 0;
|
|
||||||
#endif
|
|
||||||
StoreParameters(&m_nIp, 1);
|
|
||||||
return 0;
|
return 0;
|
||||||
case COMMAND_DUMMY:
|
case COMMAND_1471:
|
||||||
|
script_assert(false);
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
case COMMAND_1472:
|
||||||
#if (defined GTA_XBOX || defined SUPPORT_XBOX_SCRIPT || defined GTA_MOBILE || defined SUPPORT_MOBILE_SCRIPT)
|
script_assert(false);
|
||||||
// it is unknown what these commands do but they don't take parameters
|
|
||||||
case COMMAND_MARK_CUTSCENE_START:
|
|
||||||
return 0;
|
return 0;
|
||||||
case COMMAND_MARK_CUTSCENE_END:
|
case COMMAND_1473:
|
||||||
|
script_assert(false);
|
||||||
return 0;
|
return 0;
|
||||||
case COMMAND_CUTSCENE_SCROLL:
|
case COMMAND_1474:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1475:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1476:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1477:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1478:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1479:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1480:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1481:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1482:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1483:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1484:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1485:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1486:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1487:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1488:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1489:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1490:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1491:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1492:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1493:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1494:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1495:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1496:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1497:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1498:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1499:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
default:
|
||||||
|
script_assert(0);
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int8 CRunningScript::ProcessCommands1500To1599(int32 command)
|
||||||
|
{
|
||||||
|
switch (command) {
|
||||||
|
case COMMAND_1500:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1501:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1502:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1503:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1504:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1505:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1506:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1507:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1508:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1509:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1510:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1511:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1512:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1513:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1514:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1515:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1516:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1517:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1518:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1519:
|
||||||
|
CollectParameters(&m_nIp, 1);
|
||||||
|
// TODO (SET_NUMBER_USJ_FOUND?)
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1520:
|
||||||
|
CollectParameters(&m_nIp, 1);
|
||||||
|
// TODO (SET_TOTAL_HIDDEN_PACKAGES?)
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1521:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1522:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1523:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1524:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1525:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1526:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1527:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1528:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1529:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1530:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1531:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1532:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1533:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1534:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1535:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1536:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1537:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1538:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1539:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1540:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1541:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1542:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1543:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1544:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1545:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1546:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1547:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1548:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1549:
|
||||||
|
CollectParameters(&m_nIp, 1);
|
||||||
|
// TODO (SET_ONFOOT_CAMERA_MODE?)
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1550:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1551:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1552:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1553:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1554:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1555:
|
||||||
|
CollectParameters(&m_nIp, 1);
|
||||||
|
// TODO (FREEZE_ONFOOT_CAMERA_MODE?)
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1556:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1557:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1558:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1559:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1560:
|
||||||
|
// TODO (IS_E3_BUILD?)
|
||||||
|
UpdateCompareFlag(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1561:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1562:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1563:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1564:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1565:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1566:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1567:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1568:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1569:
|
||||||
|
// TODO (IS_MULTIPLAYER_ACTIVE?)
|
||||||
|
UpdateCompareFlag(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1570:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1571:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1572:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1573:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1574:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1575:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1576:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1577:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1578:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1579:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1580:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1581:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1582:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1583:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1584:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1585:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1586:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1587:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1588:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1589:
|
||||||
|
CollectParameters(&m_nIp, 2);
|
||||||
|
// TODO (SWAP_BUILDING?)
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1590:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1591:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1592:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1593:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1594:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1595:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1596:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1597:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1598:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1599:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
default:
|
||||||
|
script_assert(0);
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int8 CRunningScript::ProcessCommands1600To1699(int32 command)
|
||||||
|
{
|
||||||
|
switch (command) {
|
||||||
|
case COMMAND_1600:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1601:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1602:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1603:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1604:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1605:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1606:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1607:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1608:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1609:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1610:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1611:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1612:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1613:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1614:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1615:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1616:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1617:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1618:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1619:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1620:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1621:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1622:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1623:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1624:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1625:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1626:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1627:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1628:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1629:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1630:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1631:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1632:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1633:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1634:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1635:
|
||||||
|
{
|
||||||
|
char tmp[12]; // TODO
|
||||||
|
CTheScripts::ReadTextLabelFromScript(&m_nIp, tmp);
|
||||||
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
||||||
|
// TODO (CHANGE_STORED_PLAYER_OUTFIT?)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
case COMMAND_1636:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1637:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1638:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1639:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1640:
|
||||||
|
CollectParameters(&m_nIp, 2);
|
||||||
|
// TODO (LOCK_GARAGE?)
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1641:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1642:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1643:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1644:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1645:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1646:
|
||||||
|
CollectParameters(&m_nIp, 1);
|
||||||
|
// TODO (DISABLE_PAUSE_MENU?)
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1647:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1648:
|
||||||
|
CollectParameters(&m_nIp, 3);
|
||||||
|
// TODO (SET_CLOCK_EVENT_WARNING);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1649:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1650:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1651:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1652:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1653:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1654:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1655:
|
||||||
|
script_assert(false);
|
||||||
|
return 0;
|
||||||
|
case COMMAND_1656:
|
||||||
|
script_assert(false);
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
script_assert(0);
|
script_assert(0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -215,6 +215,11 @@ enum {
|
||||||
COMMAND_WHILE,
|
COMMAND_WHILE,
|
||||||
COMMAND_WHILENOT,
|
COMMAND_WHILENOT,
|
||||||
COMMAND_ENDWHILE,
|
COMMAND_ENDWHILE,
|
||||||
|
COMMAND_214,
|
||||||
|
COMMAND_215,
|
||||||
|
COMMAND_216,
|
||||||
|
COMMAND_217,
|
||||||
|
COMMAND_218,
|
||||||
COMMAND_ANDOR,
|
COMMAND_ANDOR,
|
||||||
COMMAND_LAUNCH_MISSION,
|
COMMAND_LAUNCH_MISSION,
|
||||||
COMMAND_MISSION_HAS_FINISHED,
|
COMMAND_MISSION_HAS_FINISHED,
|
||||||
|
@ -1437,39 +1442,222 @@ enum {
|
||||||
COMMAND_REGISTER_FIRE_LEVEL,
|
COMMAND_REGISTER_FIRE_LEVEL,
|
||||||
COMMAND_IS_AUSTRALIAN_GAME,
|
COMMAND_IS_AUSTRALIAN_GAME,
|
||||||
COMMAND_DISARM_CAR_BOMB,
|
COMMAND_DISARM_CAR_BOMB,
|
||||||
#if (defined GTAVC_JP_PATCH || defined SUPPORT_JAPANESE_SCRIPT)
|
|
||||||
COMMAND_IS_JAPANESE_GAME,
|
COMMAND_IS_JAPANESE_GAME,
|
||||||
#elif (!defined GTA_PS2)
|
COMMAND_1442,
|
||||||
COMMAND_SET_ONSCREEN_COUNTER_FLASH_WHEN_FIRST_DISPLAYED,
|
COMMAND_1443,
|
||||||
#endif
|
COMMAND_1444,
|
||||||
#if (defined GTA_PC && !defined GTAVC_JP_PATCH || defined GTA_XBOX || defined SUPPORT_XBOX_SCRIPT || defined GTA_MOBILE || defined SUPPORT_MOBILE_SCRIPT)
|
COMMAND_1445,
|
||||||
COMMAND_SHUFFLE_CARD_DECKS,
|
COMMAND_1446,
|
||||||
COMMAND_FETCH_NEXT_CARD,
|
COMMAND_1447,
|
||||||
COMMAND_GET_OBJECT_VELOCITY,
|
COMMAND_1448,
|
||||||
COMMAND_IS_DEBUG_CAMERA_ON,
|
COMMAND_1449,
|
||||||
COMMAND_ADD_TO_OBJECT_ROTATION_VELOCITY,
|
COMMAND_1450,
|
||||||
COMMAND_SET_OBJECT_ROTATION_VELOCITY,
|
COMMAND_1451,
|
||||||
COMMAND_IS_OBJECT_STATIC,
|
COMMAND_1452,
|
||||||
COMMAND_GET_ANGLE_BETWEEN_2D_VECTORS,
|
COMMAND_1453,
|
||||||
COMMAND_DO_2D_RECTANGLES_COLLIDE,
|
COMMAND_CALL,
|
||||||
COMMAND_GET_OBJECT_ROTATION_VELOCITY,
|
COMMAND_NOTCALL,
|
||||||
COMMAND_ADD_VELOCITY_RELATIVE_TO_OBJECT_VELOCITY,
|
COMMAND_1456,
|
||||||
COMMAND_GET_OBJECT_SPEED,
|
COMMAND_1457,
|
||||||
#endif
|
COMMAND_1458,
|
||||||
#if (defined GTA_XBOX || defined SUPPORT_XBOX_SCRIPT)
|
COMMAND_1459,
|
||||||
COMMAND_MARK_CUTSCENE_START,
|
COMMAND_1460,
|
||||||
COMMAND_MARK_CUTSCENE_END,
|
COMMAND_1461,
|
||||||
COMMAND_CUTSCENE_SCROLL,
|
COMMAND_1462,
|
||||||
#elif (defined GTA_MOBILE || defined SUPPORT_MOBILE_SCRIPT)
|
COMMAND_1463,
|
||||||
COMMAND_IS_MISSION_SKIP,
|
COMMAND_1464,
|
||||||
COMMAND_SET_IN_AMMUNATION,
|
COMMAND_1465,
|
||||||
COMMAND_DO_SAVE_GAME,
|
COMMAND_1466,
|
||||||
COMMAND_IS_RETRY,
|
COMMAND_1467,
|
||||||
COMMAND_DUMMY,
|
COMMAND_1468,
|
||||||
COMMAND_MARK_CUTSCENE_START,
|
COMMAND_1469,
|
||||||
COMMAND_MARK_CUTSCENE_END,
|
COMMAND_1470,
|
||||||
COMMAND_CUTSCENE_SCROLL,
|
COMMAND_1471,
|
||||||
#endif
|
COMMAND_1472,
|
||||||
|
COMMAND_1473,
|
||||||
|
COMMAND_1474,
|
||||||
|
COMMAND_1475,
|
||||||
|
COMMAND_1476,
|
||||||
|
COMMAND_1477,
|
||||||
|
COMMAND_1478,
|
||||||
|
COMMAND_1479,
|
||||||
|
COMMAND_1480,
|
||||||
|
COMMAND_1481,
|
||||||
|
COMMAND_1482,
|
||||||
|
COMMAND_1483,
|
||||||
|
COMMAND_1484,
|
||||||
|
COMMAND_1485,
|
||||||
|
COMMAND_1486,
|
||||||
|
COMMAND_1487,
|
||||||
|
COMMAND_1488,
|
||||||
|
COMMAND_1489,
|
||||||
|
COMMAND_1490,
|
||||||
|
COMMAND_1491,
|
||||||
|
COMMAND_1492,
|
||||||
|
COMMAND_1493,
|
||||||
|
COMMAND_1494,
|
||||||
|
COMMAND_1495,
|
||||||
|
COMMAND_1496,
|
||||||
|
COMMAND_1497,
|
||||||
|
COMMAND_1498,
|
||||||
|
COMMAND_1499,
|
||||||
|
COMMAND_1500,
|
||||||
|
COMMAND_1501,
|
||||||
|
COMMAND_1502,
|
||||||
|
COMMAND_1503,
|
||||||
|
COMMAND_1504,
|
||||||
|
COMMAND_1505,
|
||||||
|
COMMAND_1506,
|
||||||
|
COMMAND_1507,
|
||||||
|
COMMAND_1508,
|
||||||
|
COMMAND_1509,
|
||||||
|
COMMAND_1510,
|
||||||
|
COMMAND_1511,
|
||||||
|
COMMAND_1512,
|
||||||
|
COMMAND_1513,
|
||||||
|
COMMAND_1514,
|
||||||
|
COMMAND_1515,
|
||||||
|
COMMAND_1516,
|
||||||
|
COMMAND_1517,
|
||||||
|
COMMAND_1518,
|
||||||
|
COMMAND_1519,
|
||||||
|
COMMAND_1520,
|
||||||
|
COMMAND_1521,
|
||||||
|
COMMAND_1522,
|
||||||
|
COMMAND_1523,
|
||||||
|
COMMAND_1524,
|
||||||
|
COMMAND_1525,
|
||||||
|
COMMAND_1526,
|
||||||
|
COMMAND_1527,
|
||||||
|
COMMAND_1528,
|
||||||
|
COMMAND_1529,
|
||||||
|
COMMAND_1530,
|
||||||
|
COMMAND_1531,
|
||||||
|
COMMAND_1532,
|
||||||
|
COMMAND_1533,
|
||||||
|
COMMAND_1534,
|
||||||
|
COMMAND_1535,
|
||||||
|
COMMAND_1536,
|
||||||
|
COMMAND_1537,
|
||||||
|
COMMAND_1538,
|
||||||
|
COMMAND_1539,
|
||||||
|
COMMAND_1540,
|
||||||
|
COMMAND_1541,
|
||||||
|
COMMAND_1542,
|
||||||
|
COMMAND_1543,
|
||||||
|
COMMAND_1544,
|
||||||
|
COMMAND_1545,
|
||||||
|
COMMAND_1546,
|
||||||
|
COMMAND_1547,
|
||||||
|
COMMAND_1548,
|
||||||
|
COMMAND_1549,
|
||||||
|
COMMAND_1550,
|
||||||
|
COMMAND_1551,
|
||||||
|
COMMAND_1552,
|
||||||
|
COMMAND_1553,
|
||||||
|
COMMAND_1554,
|
||||||
|
COMMAND_1555,
|
||||||
|
COMMAND_1556,
|
||||||
|
COMMAND_1557,
|
||||||
|
COMMAND_1558,
|
||||||
|
COMMAND_1559,
|
||||||
|
COMMAND_1560,
|
||||||
|
COMMAND_1561,
|
||||||
|
COMMAND_1562,
|
||||||
|
COMMAND_1563,
|
||||||
|
COMMAND_1564,
|
||||||
|
COMMAND_1565,
|
||||||
|
COMMAND_1566,
|
||||||
|
COMMAND_1567,
|
||||||
|
COMMAND_1568,
|
||||||
|
COMMAND_1569,
|
||||||
|
COMMAND_1570,
|
||||||
|
COMMAND_1571,
|
||||||
|
COMMAND_1572,
|
||||||
|
COMMAND_1573,
|
||||||
|
COMMAND_1574,
|
||||||
|
COMMAND_1575,
|
||||||
|
COMMAND_1576,
|
||||||
|
COMMAND_1577,
|
||||||
|
COMMAND_1578,
|
||||||
|
COMMAND_1579,
|
||||||
|
COMMAND_1580,
|
||||||
|
COMMAND_1581,
|
||||||
|
COMMAND_1582,
|
||||||
|
COMMAND_1583,
|
||||||
|
COMMAND_1584,
|
||||||
|
COMMAND_1585,
|
||||||
|
COMMAND_1586,
|
||||||
|
COMMAND_1587,
|
||||||
|
COMMAND_1588,
|
||||||
|
COMMAND_1589,
|
||||||
|
COMMAND_1590,
|
||||||
|
COMMAND_1591,
|
||||||
|
COMMAND_1592,
|
||||||
|
COMMAND_1593,
|
||||||
|
COMMAND_1594,
|
||||||
|
COMMAND_1595,
|
||||||
|
COMMAND_1596,
|
||||||
|
COMMAND_1597,
|
||||||
|
COMMAND_1598,
|
||||||
|
COMMAND_1599,
|
||||||
|
COMMAND_1600,
|
||||||
|
COMMAND_1601,
|
||||||
|
COMMAND_1602,
|
||||||
|
COMMAND_1603,
|
||||||
|
COMMAND_1604,
|
||||||
|
COMMAND_1605,
|
||||||
|
COMMAND_1606,
|
||||||
|
COMMAND_1607,
|
||||||
|
COMMAND_1608,
|
||||||
|
COMMAND_1609,
|
||||||
|
COMMAND_1610,
|
||||||
|
COMMAND_1611,
|
||||||
|
COMMAND_1612,
|
||||||
|
COMMAND_1613,
|
||||||
|
COMMAND_1614,
|
||||||
|
COMMAND_1615,
|
||||||
|
COMMAND_1616,
|
||||||
|
COMMAND_1617,
|
||||||
|
COMMAND_1618,
|
||||||
|
COMMAND_1619,
|
||||||
|
COMMAND_1620,
|
||||||
|
COMMAND_1621,
|
||||||
|
COMMAND_1622,
|
||||||
|
COMMAND_1623,
|
||||||
|
COMMAND_1624,
|
||||||
|
COMMAND_1625,
|
||||||
|
COMMAND_1626,
|
||||||
|
COMMAND_1627,
|
||||||
|
COMMAND_1628,
|
||||||
|
COMMAND_1629,
|
||||||
|
COMMAND_1630,
|
||||||
|
COMMAND_1631,
|
||||||
|
COMMAND_1632,
|
||||||
|
COMMAND_1633,
|
||||||
|
COMMAND_1634,
|
||||||
|
COMMAND_1635,
|
||||||
|
COMMAND_1636,
|
||||||
|
COMMAND_1637,
|
||||||
|
COMMAND_1638,
|
||||||
|
COMMAND_1639,
|
||||||
|
COMMAND_1640,
|
||||||
|
COMMAND_1641,
|
||||||
|
COMMAND_1642,
|
||||||
|
COMMAND_1643,
|
||||||
|
COMMAND_1644,
|
||||||
|
COMMAND_1645,
|
||||||
|
COMMAND_1646,
|
||||||
|
COMMAND_1647,
|
||||||
|
COMMAND_1648,
|
||||||
|
COMMAND_1649,
|
||||||
|
COMMAND_1650,
|
||||||
|
COMMAND_1651,
|
||||||
|
COMMAND_1652,
|
||||||
|
COMMAND_1653,
|
||||||
|
COMMAND_1654,
|
||||||
|
COMMAND_1655,
|
||||||
|
COMMAND_1656,
|
||||||
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
|
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
|
||||||
LAST_SCRIPT_COMMAND
|
LAST_SCRIPT_COMMAND
|
||||||
#endif
|
#endif
|
||||||
|
@ -1488,7 +1676,9 @@ enum eScriptArgument
|
||||||
ARGTYPE_PED_HANDLE,
|
ARGTYPE_PED_HANDLE,
|
||||||
ARGTYPE_VEHICLE_HANDLE,
|
ARGTYPE_VEHICLE_HANDLE,
|
||||||
ARGTYPE_OBJECT_HANDLE,
|
ARGTYPE_OBJECT_HANDLE,
|
||||||
ARGTYPE_ANDOR
|
ARGTYPE_ANDOR,
|
||||||
|
ARGTYPE_LIST,
|
||||||
|
ARGTYPE_FUNCTION
|
||||||
};
|
};
|
||||||
|
|
||||||
struct tScriptCommandData
|
struct tScriptCommandData
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
// --MIAMI: file done
|
// --MIAMI: file done
|
||||||
|
|
||||||
float CIniFile::PedNumberMultiplier = 0.6f;
|
float CIniFile::PedNumberMultiplier = 0.6f;
|
||||||
float CIniFile::CarNumberMultiplier = 0.6f;
|
float CIniFile::CarNumberMultiplier = 0.8f;
|
||||||
|
|
||||||
void CIniFile::LoadIniFile()
|
void CIniFile::LoadIniFile()
|
||||||
{
|
{
|
||||||
|
@ -27,5 +27,5 @@ void CIniFile::LoadIniFile()
|
||||||
}
|
}
|
||||||
CPopulation::MaxNumberOfPedsInUse = 25.0f * PedNumberMultiplier;
|
CPopulation::MaxNumberOfPedsInUse = 25.0f * PedNumberMultiplier;
|
||||||
CPopulation::MaxNumberOfPedsInUseInterior = 40.0f * PedNumberMultiplier;
|
CPopulation::MaxNumberOfPedsInUseInterior = 40.0f * PedNumberMultiplier;
|
||||||
CCarCtrl::MaxNumberOfCarsInUse = 12.0f * CarNumberMultiplier;
|
CCarCtrl::MaxNumberOfCarsInUse = 30.0f * CarNumberMultiplier;
|
||||||
}
|
}
|
|
@ -164,6 +164,8 @@ public:
|
||||||
int32 LastTimeTouched;
|
int32 LastTimeTouched;
|
||||||
int32 AverageWeapon;
|
int32 AverageWeapon;
|
||||||
int32 AverageEntries;
|
int32 AverageEntries;
|
||||||
|
float unk_B4;
|
||||||
|
float unk_B8;
|
||||||
|
|
||||||
#ifdef DETECT_PAD_INPUT_SWITCH
|
#ifdef DETECT_PAD_INPUT_SWITCH
|
||||||
static bool IsAffectedByController;
|
static bool IsAffectedByController;
|
||||||
|
|
|
@ -123,6 +123,7 @@ public:
|
||||||
static bool HasColLoaded(int32 id) { return HasModelLoaded(id+STREAM_OFFSET_COL); }
|
static bool HasColLoaded(int32 id) { return HasModelLoaded(id+STREAM_OFFSET_COL); }
|
||||||
static bool HasAnimLoaded(int32 id) { return HasModelLoaded(id+STREAM_OFFSET_ANIM); }
|
static bool HasAnimLoaded(int32 id) { return HasModelLoaded(id+STREAM_OFFSET_ANIM); }
|
||||||
static bool CanRemoveModel(int32 id) { return (ms_aInfoForModel[id].m_flags & STREAMFLAGS_CANT_REMOVE) == 0; }
|
static bool CanRemoveModel(int32 id) { return (ms_aInfoForModel[id].m_flags & STREAMFLAGS_CANT_REMOVE) == 0; }
|
||||||
|
static bool IsScriptOwnedModel(int32 id) { return (ms_aInfoForModel[id].m_flags & STREAMFLAGS_SCRIPTOWNED); }
|
||||||
static bool CanRemoveTxd(int32 id) { return CanRemoveModel(id+STREAM_OFFSET_TXD); }
|
static bool CanRemoveTxd(int32 id) { return CanRemoveModel(id+STREAM_OFFSET_TXD); }
|
||||||
static bool CanRemoveCol(int32 id) { return CanRemoveModel(id+STREAM_OFFSET_COL); }
|
static bool CanRemoveCol(int32 id) { return CanRemoveModel(id+STREAM_OFFSET_COL); }
|
||||||
static bool CanRemoveAnim(int32 id) { return CanRemoveModel(id+STREAM_OFFSET_ANIM); }
|
static bool CanRemoveAnim(int32 id) { return CanRemoveModel(id+STREAM_OFFSET_ANIM); }
|
||||||
|
|
|
@ -97,7 +97,7 @@ enum Config {
|
||||||
NUMPACMANPICKUPS = 256,
|
NUMPACMANPICKUPS = 256,
|
||||||
NUMEVENTS = 64,
|
NUMEVENTS = 64,
|
||||||
|
|
||||||
NUM_CARGENS = 185,
|
NUM_CARGENS = 500,
|
||||||
|
|
||||||
NUM_PATH_NODES_IN_AUTOPILOT = 8,
|
NUM_PATH_NODES_IN_AUTOPILOT = 8,
|
||||||
|
|
||||||
|
@ -334,7 +334,7 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually
|
||||||
#endif
|
#endif
|
||||||
//#define SIMPLIER_MISSIONS // apply simplifications from mobile
|
//#define SIMPLIER_MISSIONS // apply simplifications from mobile
|
||||||
#define USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
|
#define USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
|
||||||
#define SCRIPT_LOG_FILE_LEVEL 0 // 0 == no log, 1 == overwrite every frame, 2 == full log
|
#define SCRIPT_LOG_FILE_LEVEL 2 // 0 == no log, 1 == overwrite every frame, 2 == full log
|
||||||
|
|
||||||
#ifndef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
|
#ifndef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
|
||||||
#define USE_BASIC_SCRIPT_DEBUG_OUTPUT
|
#define USE_BASIC_SCRIPT_DEBUG_OUTPUT
|
||||||
|
|
Loading…
Reference in a new issue