-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ns race server script and ignore 3 scripts from pet cove (#…
…1682) * brother * use some better logic * Implement spider boss msg script tested that the message now shows up when hitting the survival spider entrance area * add drag to start race feature * ignore 3 more scripts * add Ns race server script * remove logs * unique * Update RaceImaginationServer.cpp * Update CppScripts.cpp
- Loading branch information
Showing
12 changed files
with
170 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
set(DSCRIPTS_SOURCES_AI_RACING) | ||
set(DSCRIPTS_SOURCES_AI_RACING | ||
"RaceImaginationServer.cpp") | ||
|
||
add_subdirectory(OBJECTS) | ||
|
||
foreach(file ${DSCRIPTS_SOURCES_AI_RACING_OBJECTS}) | ||
set(DSCRIPTS_SOURCES_AI_RACING ${DSCRIPTS_SOURCES_AI_RACING} "OBJECTS/${file}") | ||
endforeach() | ||
|
||
add_subdirectory(TRACK_NS) | ||
|
||
foreach(file ${DSCRIPTS_SOURCES_AI_RACING_TRACK_NS}) | ||
set(DSCRIPTS_SOURCES_AI_RACING ${DSCRIPTS_SOURCES_AI_RACING} "TRACK_NS/${file}") | ||
endforeach() | ||
|
||
add_library(dScriptsAiRacing OBJECT ${DSCRIPTS_SOURCES_AI_RACING}) | ||
target_include_directories(dScriptsAiRacing PUBLIC "." "OBJECTS") | ||
target_include_directories(dScriptsAiRacing PUBLIC "." "OBJECTS" "TRACK_NS") | ||
target_precompile_headers(dScriptsAiRacing REUSE_FROM dScriptsBase) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "RaceImaginationServer.h" | ||
#include "dZoneManager.h" | ||
|
||
void StartSpawner(const std::vector<Spawner*>& spawner) { | ||
for (auto* const entity : spawner) { | ||
entity->Activate(); | ||
} | ||
} | ||
|
||
void RaceImaginationServer::OnZoneLoadedInfo(Entity* self, const GameMessages::ZoneLoadedInfo& info) { | ||
// Spawn imagination pickups | ||
StartSpawner(Game::zoneManager->GetSpawnersByName("ImaginationSpawn_Min")); | ||
if (info.maxPlayers > 2) { | ||
StartSpawner(Game::zoneManager->GetSpawnersByName("ImaginationSpawn_Med")); | ||
} | ||
if (info.maxPlayers > 4) { | ||
StartSpawner(Game::zoneManager->GetSpawnersByName("ImaginationSpawn_Max")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#ifndef RACEIMAGINATIONSERVER_H | ||
#define RACEIMAGINATIONSERVER_H | ||
|
||
#include "CppScripts.h" | ||
|
||
class RaceImaginationServer : public virtual CppScripts::Script { | ||
public: | ||
void OnZoneLoadedInfo(Entity* self, const GameMessages::ZoneLoadedInfo& info) override; | ||
}; | ||
|
||
#endif //!RACEIMAGINATIONSERVER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
set(DSCRIPTS_SOURCES_AI_RACING_TRACK_NS | ||
"NsRaceServer.cpp" | ||
PARENT_SCOPE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#include "NsRaceServer.h" | ||
|
||
#include "RacingControlComponent.h" | ||
#include "Entity.h" | ||
|
||
using std::unique_ptr; | ||
using std::make_unique; | ||
|
||
void NsRaceServer::OnStartup(Entity* self) { | ||
GameMessages::ConfigureRacingControl config; | ||
auto& raceSet = config.racingSettings; | ||
|
||
raceSet.push_back(make_unique<LDFData<std::u16string>>(u"GameType", u"Racing")); | ||
raceSet.push_back(make_unique<LDFData<std::u16string>>(u"GameState", u"Starting")); | ||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Number_Of_PlayersPerTeam", 6)); | ||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Minimum_Players_to_Start", 2)); | ||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Minimum_Players_for_Group_Achievements", 2)); | ||
|
||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Car_Object", 7703)); | ||
raceSet.push_back(make_unique<LDFData<std::u16string>>(u"Race_PathName", u"MainPath")); | ||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Current_Lap", 1)); | ||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Number_of_Laps", 3)); | ||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"activityID", 42)); | ||
|
||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_1", 100)); | ||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_2", 90)); | ||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_3", 80)); | ||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_4", 70)); | ||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_5", 60)); | ||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Place_6", 50)); | ||
|
||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_1", 15)); | ||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_2", 25)); | ||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_3", 50)); | ||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_4", 85)); | ||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_5", 90)); | ||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Num_of_Players_6", 100)); | ||
|
||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Number_of_Spawn_Groups", 1)); | ||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Red_Spawners", 4847)); | ||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Blue_Spawners", 4848)); | ||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Blue_Flag", 4850)); | ||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Red_Flag", 4851)); | ||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Red_Point", 4846)); | ||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Blue_Point", 4845)); | ||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Red_Mark", 4844)); | ||
raceSet.push_back(make_unique<LDFData<int32_t>>(u"Blue_Mark", 4843)); | ||
|
||
std::vector<Entity*> racingControllers = Game::entityManager->GetEntitiesByComponent(eReplicaComponentType::RACING_CONTROL); | ||
for (auto* const racingController : racingControllers) { | ||
auto* racingComponent = racingController->GetComponent<RacingControlComponent>(); | ||
if (racingComponent) racingComponent->MsgConfigureRacingControl(config); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#ifndef NSRACESERVER_H | ||
#define NSRACESERVER_H | ||
|
||
#include "CppScripts.h" | ||
#include "RaceImaginationServer.h" | ||
|
||
class NsRaceServer : public RaceImaginationServer { | ||
public: | ||
void OnStartup(Entity* self) override; | ||
}; | ||
|
||
#endif //!NSRACESERVER_H |