Basically I am aiming for more of a 3D platformer-style camera, like what many PS1 and N64 games used. Sonic Robo-Blast 2 managed to do it on Doom Legacy, so I'd assume GZDoom would have a way to do it too.
My code is currently a simple chasecam script I got from the wiki. The ACS for it is below.
Code: Select all
//Third person camera simulation.
//solarsnowfall
#include "zcommon.acs"
#define C_TID 1000 //Default camera tid
#define MAX_R 192 //Maximum radius (or distance from the player) (128 def)
#define ADJUST_R 8 //Amount to adjust the camera by (8 def)
#define VIEW_HEIGHT 61.0 //The approximate height of the player's view (41 def)
bool cam_mode[8]; //Variable for turning the camera on or off.
Script 1 ENTER
{
cam_mode[PlayerNumber ()] = ON;
ACS_ExecuteAlways (3, 0, PlayerNumber ());
}
Script 2 RESPAWN
{
cam_mode[PlayerNumber ()] = ON;
ACS_ExecuteAlways (3, 0, PlayerNumber ());
}
Script 3 (int p_num)
{
int r = MAX_R;
while (cam_mode[p_num] == ON)
{
int a = GetActorAngle (0);
int p = GetActorPitch (0);
int x = GetActorX (0);
int y = GetActorY (0);
int z = GetActorZ (0) + VIEW_HEIGHT;
int xyr = r * cos (p) >> 16;
if (!ThingCountName ("ChaseCam", C_TID+p_num))
{
while (!Spawn ("ChaseCam", x-cos(a)*xyr, y-sin(a)*xyr, z+sin(p)*r, C_TID+p_num, a >> 8) && r > 0)
{
r -= ADJUST_R;
xyr = cos (p) * r >> 16;
}
if (ThingCountName ("ChaseCam", C_TID + p_num))
ChangeCamera (C_TID + p_num, 0, 0);
else
{
cam_mode[p_num] = OFF;
print (s:"Camera script failed to initialize.");
}
}
else
{
while (!SetActorPosition (C_TID+p_num, x-cos(a)*xyr, y-sin(a)*xyr, z+sin(p)*r, 0) && r > 0)
{
r -= ADJUST_R;
xyr = cos (p) * r >> 16;
}
SetActorAngle (C_TID + p_num, a);
SetActorPitch (C_TID + p_num, p);
if (r < MAX_R)
r += ADJUST_R;
}
delay (1);
}
}
Script 4 DEATH
{
cam_mode[PlayerNumber ()] = OFF;
Thing_Remove (C_TID + PlayerNumber ());
}
Script 5 (int p_num) DISCONNECT
{
cam_mode[p_num] = OFF;
Thing_Remove (C_TID + p_num);
}
Edit: I understand the gist of what the script does. My guess is changing some values in this block would do something.
Code: Select all
while (!SetActorPosition (C_TID+p_num, x-cos(a)*xyr, y-sin(a)*xyr, z+sin(p)*r, 0) && r > 0)
{
r -= ADJUST_R;
xyr = cos (p) * r >> 16;
}
SetActorAngle (C_TID + p_num, a);
SetActorPitch (C_TID + p_num, p);
if (r < MAX_R)
r += ADJUST_R;
}
delay (1);