Tue Jan 11, 2022 9:45 am
Wed Jan 12, 2022 9:02 am
Wed Jan 12, 2022 9:40 am
// ACS
#library "cam"
#include "zcommon.acs"
#include "GravityValues.acs"
// Original script by RomioTheBadass - aka LordOZ_98, based on
// the ArmyGuy's code
// Currently no modifications have been made, as I am still rather new to
// ACS and trying to figure out how it works compared to Decorate and ZScript
script 815 (void) NET CLIENTSIDE //Managing chasecam
{
if(IsNetworkGame())
{
consolecommand("chase");
}
else
if (GetCVar("chase_active") == true)
{
SetCVar("Chase_Active", False);
}
else
if (GetCVar("chase_active") == False)
{
SetCVar("Chase_Active", True);
}
}
// Scripts
Script "WaypointSpawn" (void)
{
int tid = UniqueTID(-32768, 32767);
Thing_ChangeTID(ActivatorTID(), tid);
SetActivatorToTarget(tid);
int playerNum = PlayerNumber();
camWayTID[playerNum] = tid;
SetActorProperty(camTID[playerNum], APROP_MasterTID, camWayTID[playerNum]);
SetActorPosition(tid, GetActorX(tid), GetActorY(tid), GetActorZ(0) + GetActorProperty(0, APROP_Height) + GetCVar("chase_height"), false);
GiveActorInventory(camTID[playerNum], "WarpToWaypoint", 1);
}
Script "CameraMain" ENTER
{
// Set up the TID's and spawn the waypoint
int tid, playerNum, plrInput, yawAdd, pitchAdd, plrRotType, a, p;
int plrAngle = GetActorAngle(0);
playerNum = PlayerNumber();
tid = UniqueTID(-32768, 32767);
camTID[playerNum] = tid;
SpawnForced("ChaseCam", GetActorX(0), GetActorY(0), GetActorZ(0), tid, GetActorAngle(0));
while (true)
{
plrInput = GetPlayerInput(-1, INPUT_BUTTONS);
yawAdd = GetPlayerInput(-1, INPUT_YAW);
pitchAdd = -GetPlayerInput(-1, INPUT_PITCH);
a = a + yawAdd;
p = p + pitchAdd;
if (p > 0.23)
p = 0.23;
if (p < -0.23)
p = -0.23;
Thing_Remove(camWayTID[playerNum]);
LineAttack(0, a + 0.5, -p, 0, "ChaseCamWaypoint", "", GetCVar("chase_dist"), FHF_NORANDOMPUFFZ);
SetActorAngle(camWayTID[playerNum], a);
SetActorPitch(camWayTID[playerNum], p);
SetActorAngle(camTID[playerNum], a);
SetActorPitch(camTID[playerNum], p);
plrRotType = GetCVar("chase_rotateplr");
if (plrRotType == 1)
plrAngle = a;
else if (plrRotType == 2)
{
if (plrInput & BT_FORWARD || plrInput & BT_BACK || plrInput & BT_MOVELEFT || plrInput & BT_MOVERIGHT || plrInput & BT_ATTACK || plrInput & BT_ALTATTACK)
plrAngle = a;
}
If(IsNetworkGame())
{
terminate;
}
else
if (GetCVar("chase_active"))
ChangeCamera(camTID[playerNum], 0, 0);
else
{
plrAngle = a;
ChangeCamera(0, 0, 0);
}
SetActorAngle(0, plrAngle);
SetActorPitch(0, p);
Delay(1);
}
}
script "coopchase" (void)
{
ConsoleCommand("chase");
}
#DEFINE WATERGRAVITY 0.4
#DEFINE GLIDEGRAVITY 0.1
#DEFINE DEFAULTGRAVITY 0.90
int candrown = 0;
int nojump = 1;
int spinning[64];
int GlideState[64];
int monitorthrust[64];
#define MAXPLAYERS 64
#define PLAYER_TID_START 300
int camTID[MAXPLAYERS];
int camWayTID[MAXPLAYERS];