Hello everybody. Im here to tell you all about the 2.5D Community Map Pack.
As most of you prabably know. A while ago, The MM8BDM 2.5D Mod was realeased but only had 2 levels.
I'v decided to start a map pack like the CSCM Remix pack. All the information you will need is below.
Please copy everything below and put it in the script
#include "zcommon.acs"
/************
** DEFINES **
************/
//Scripts | V=Void O=Open E=Enter R=Respawn P=Puked D=Death Q=Disconnect
#define S_ESTART 300 //Main ENTER script E
#define S_RSTART 301 //Main RESPAWN script R
#define S_LEAVE 304 //Disconnect Q
#define S_CAMERA 302 //Camera V
#define S_CAMIN 341 //Camera Closer P
#define S_CAMOUT 342 //Camera Farther P
#define S_DIE 303 //Death D
#define S_RTURN 254 //Relative Turning V
#define S_ATURN 253 //Absolute Turning V
#define S_STRAFE 308 //Strafing V
#define S_GOIN 309 //+Inwards P
#define S_GOOUT 310 //+Outwards P
#define S_NGOIN 312 //-Inwards P
#define S_NGOOUT 313 //-Outwards P
#define S_SHADOW 315 //Shadow V
#define S_FORCEA 305 //Forced Angle E
#define S_FACER 306 //Face Right P
#define S_FACEL 307 //Face Left P
#define S_TELE 255 //Teleport V
#define S_EXIT 252 //Exit V
//Settings\
#define C_TID 3200 //Default camera tid
#define MAX_R 384 //Maximum radius (or distance from the player)
#define ADJUST_R 4 //Amount to adjust the camera by
#define DEF_VH 64.0 //The approximate height of the player's view
#define CAM_MIN 128 //cam min distance
#define CAM_MAX 640 //cam max distance
//Constants\
#define EAST 0.0
#define NORTH 0.25
#define WEST 0.5
#define SOUTH 0.75
#define LOOPTIC 1 //adjust if loop delays fail in multiplayer.
#define CLOOPTIC 1 //camera loop delay
/**************
** VARIABLES **
*************/
global int 1:score;
global int 2:bonus; //Bonus Diamonds
int bonus_map=0; //Bonus Map Activator
bool Inwards[8] = {OFF,OFF,OFF,OFF,OFF,OFF,OFF,OFF};
bool Outwards[8] = {OFF,OFF,OFF,OFF,OFF,OFF,OFF,OFF};
bool forward[8] = {ON,ON,ON,ON,ON,ON,ON,ON};
bool cam_mode[8];
int View_H[8] = {DEF_VH,DEF_VH,DEF_VH,DEF_VH,DEF_VH,DEF_VH,DEF_VH,DEF_VH};
int Cam_R[8] = {MAX_R,MAX_R,MAX_R,MAX_R,MAX_R,MAX_R,MAX_R,MAX_R};//Default distances for cameras
int CamPitch[8] = {0.006,0.006,0.006,0.006,0.006,0.006,0.006,0.006}; //player 1-8 camera pitch values
int PCamAngle[8] = {NORTH,NORTH,NORTH,NORTH,NORTH,NORTH,NORTH,NORTH}; //preferred camera angles
int NonGTurnValues[4] = {0.05,0.025,0.005,0.0025};//Values for non-guaranteed turning script 254
int scoreAmount[6] = {5000,1000,500,100,50,10};
int scoreFx[6] = {250,251,252,253,254,255};
int HealthOld[8];
int HealthNew[8];
int GiveTID = 999; //for the Dynamic TID Assigner
// These two arrays should be set on each map.
int CamAngle[8] = {NORTH,NORTH,NORTH,NORTH,NORTH,NORTH,NORTH,NORTH};//player 1-8 camera angles (camera faces in this direction at start)
int MoveAngle[8] = {EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST};//player 1-8 moving angles (they face this direction at start)
/**********************************
** START OF SCRIPTS & FUNCTIONS **
*********************************/
/////////////////////////////
//// Dynamic TID Assigner ///
//// borrowed from ///
//// ACS Prefab database ///
/////////////////////////////
function int NextTID (VOID)
{
for (GiveTID=GiveTID; GiveTID<1050; GiveTID++)
{
if (!ThingCount (T_NONE, GiveTID))
return GiveTID;
}
return 0;
}
//////////////////////////////////
//// Camera Angle Turning ////
//// Script ////
//////////////////////////////////
script S_RTURN (int amount) //relative turning, Best combined with guaranteed forced turning
{
if(LineSide() == LINE_FRONT)
{
PCamAngle[PlayerNumber()] += NonGTurnValues[amount];
MoveAngle[PlayerNumber ()] += NonGTurnValues[amount];
}
if(LineSide() == LINE_BACK)
{
PCamAngle[PlayerNumber()] -= NonGTurnValues[amount];
MoveAngle[PlayerNumber ()] -= NonGTurnValues[amount];
}
}
script S_ATURN (int amount) //Force a camera Angle and Player Angle. use a byte angle for the amount
{
int fangle;
int mangle;
fangle = amount << 8;
mangle = fangle;
fangle = fangle + 0.25;
PCamAngle[PlayerNumber()] = fangle;
MoveAngle[PlayerNumber()] = mangle;
}
///////////////////////////////
//// The Cleaned Up //////
//// Third person Camera //////
//// borrowed from //////
//// ACS Prefab database //////
//// ~Somewhat Modified //////
///////////////////////////////
Script S_ESTART ENTER
{
if (!ActivatorTID ()) { Thing_ChangeTID (0, NextTID ()); }
SetActorProperty(0,APROP_Invulnerable,OFF);
cam_mode[PlayerNumber ()] = ON;
ACS_ExecuteAlways (S_CAMERA, 0, PlayerNumber ());
ACS_ExecuteAlways(S_STRAFE,0,0,0,0);
ACS_ExecuteAlways(S_SHADOW,0,0,0,0);
}
Script S_DIE DEATH
{
fadeto(0.0,0.0,0.0,1.0,1.0);
delay(29);
SetHudSize (640, 480, 1);
SetFont("BIGFONT");
HudMessage (s:"cCYou are cGDead!";HUDMSG_FADEINOUT,4,CR_UNTRANSLATED,320.0,240.0,6.0, 1.0, 1.0);
cam_mode[PlayerNumber ()] = OFF;
Thing_Remove (C_TID + PlayerNumber ());
}
Script S_RSTART RESPAWN
{
if (!ActivatorTID ()) { Thing_ChangeTID (0, NextTID ()); }
cam_mode[PlayerNumber ()] = ON;
ACS_ExecuteAlways (S_CAMERA, 0, PlayerNumber ());
ACS_ExecuteAlways(S_STRAFE,0,0,0,0);
ACS_ExecuteAlways(S_SHADOW,0,0,0,0);
}
Script S_CAMERA (int p_num)
{
int r = Cam_R[p_num];
While (cam_mode[p_num] == ON)
{
int p = CamPitch[p_num];
int x = GetActorX (0);
int y = GetActorY (0);
int z = GetActorZ (0) + View_H[p_num];
int xyr = r * cos (p) >> 16;
For(int i = 0;i < 5;i++)
{
If(CamAngle[p_num]/256 >= 192 && PCamAngle[p_num]/256 <= 64)
{
CamAngle[p_num] -= (256 << 8);
}
If(CamAngle[p_num]/256 <= 64 && PCamAngle[p_num]/256 >= 192)
{
CamAngle[p_num] += (256 << 8);
}
If (CamAngle[p_num]/256 > PCamAngle[p_num]/256)
{
CamAngle[p_num] -= 0.002;
}
If (CamAngle[p_num]/256 < PCamAngle[p_num]/256)
{
CamAngle[p_num] += 0.002;
}
}
If (!ThingCountName ("SecurityCameraNoClip", C_TID+p_num))
{
While (!Spawn ("SecurityCameraNoClip", x-cos(CamAngle[p_num])*xyr, y-sin(CamAngle[p_num])*xyr, z+sin(p)*r, C_TID+p_num, CamAngle[p_num] >> 8) && r > 0)
{
r -= ADJUST_R;
xyr = cos (p) * r >> 16;
}
If (ThingCountName ("SecurityCameraNoClip", 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(CamAngle[p_num])*xyr, y-sin(CamAngle[p_num])*xyr, z+sin(p)*r, 0) && r > 0 )
{
r -= ADJUST_R;
xyr = cos (p) * r >> 16;
}
SetActorAngle (C_TID + p_num, CamAngle[p_num]);
SetActorPitch (C_TID + p_num, p);
If (r < Cam_R[p_num])
r += ADJUST_R;
If (r > Cam_R[p_num])
r -= ADJUST_R;
}
Delay(CLOOPTIC);
}
}
Script S_LEAVE (int p_num) DISCONNECT
{
cam_mode[p_num] = OFF;
Thing_Remove (C_TID + p_num);
}
//CAM_POSITION SWITCHER
//CLOSER
Script S_CAMIN (void)
{
if(Cam_R[PlayerNumber ()] > CAM_MIN) //If distance is bigger than minimum distance
{
Cam_R[PlayerNumber ()] -= 64;
CamPitch[PlayerNumber ()] += 0.002;
SetFont("BIGFONT");
HudMessage (s:"cCZoom Level: cG", d:(Cam_R[PlayerNumber ()]-128)/64;HUDMSG_FADEINOUT,800,CR_UNTRANSLATED,0.5,0.5,1.0,0.0,0.5);
}
}
//FARTHER
Script S_CAMOUT (void)
{
if(Cam_R[PlayerNumber ()] < CAM_MAX) //If distance is smaller than maximum distance
{
Cam_R[PlayerNumber ()] += 64;
CamPitch[PlayerNumber ()] -= 0;
SetFont("BIGFONT");
HudMessage (s:"cCZoom Level: cG", d:(Cam_R[PlayerNumber ()]-128)/64;HUDMSG_FADEINOUT,800,CR_UNTRANSLATED,0.5,0.5,1.0,0.0,0.5);
}
}
//NEW STRAFING
Script S_STRAFE (void)
{
int angle;
while(TRUE)
{
while(Inwards[PlayerNumber()] == ON)
{
angle = MoveAngle[PlayerNumber()] >> 8;
angle += 64;
ThrustThing(angle, 1, 0, 0);
delay(1);
}
while(Outwards[PlayerNumber()] == ON)
{
angle = MoveAngle[PlayerNumber()] >> 8;
angle -= 64;
ThrustThing(angle, 1, 0, 0);
delay(1);
}
delay(LOOPTIC);
}
}
Script S_GOIN (void)
{Inwards[PlayerNumber()] = ON;}
Script S_GOOUT (void)
{Outwards[PlayerNumber()] = ON;}
Script S_NGOIN (void)
{Inwards[PlayerNumber()] = OFF;}
Script S_NGOOUT (void)
{Outwards[PlayerNumber()] = OFF;}
Script S_SHADOW (void)
{
while(GetActorProperty(ActivatorTID(),APROP_Health) > 0)
{
SpawnProjectile(ActivatorTID(),"PlayerShadow",GetActorAngle(ActivatorTID()),0,-255,0,0);
delay(LOOPTIC);
}
}
//////////////////////////
//// FORCE ANGLE V2 //////
//////////////////////////
Script S_FORCEA ENTER //Force the player angle
{
int a = GetActorAngle(0);
MoveAngle[PlayerNumber ()] = a;
PCamAngle[PlayerNumber ()] = a + 0.25;
CamAngle[PlayerNumber ()] = a + 0.25;
while(TRUE)//Loop forever
{
if(forward[PlayerNumber()] == ON)
{
SetActorAngle(ActivatorTID(), MoveAngle[PlayerNumber ()]); //face forward(right)
}
if(forward[PlayerNumber()] == OFF)
{
SetActorAngle(ActivatorTID(), MoveAngle[PlayerNumber ()] + 0.5); //face backward(left)
}
delay(LOOPTIC);
}
}
Script S_FACER (void) //puke this script to face forward(right)
{
acs_terminate(307,0);
forward[PlayerNumber()] = ON;
}
Script S_FACEL (void) //puke this script to face backward(left)
{
acs_terminate(306,0);
forward[PlayerNumber()] = OFF;
}
////////////////////////////
//// TELEPORT STANDARD /////
////////////////////////////
Script S_TELE (int destination)
{
Fadeto(1.0,1.0,1.0,1.0,0.1);
Delay(35/10);
TeleportOther(ActivatorTID(),destination, 1);
FadeTo(1.0,1.0,1.0,0.0,0.4);
}
////////////////////////////
//// LEVEL EXIT STANDARD ///
////////////////////////////
Script S_EXIT (void)
{
FadeTo(0.0,0.0,0.0,1.0,1.0);
SetActorProperty(0,APROP_Invulnerable,ON);
SetMusic("D_NONE");
AmbientSound("S_EXILEV", 128);
SetHudSize (640, 480, 1);
SetFont("BIGFONT");
HudMessageBold (s:"cCMap cGFinished!";HUDMSG_FADEINOUT,4,CR_UNTRANSLATED,320.0,240.0,6.0, 1.0, 1.0);
Delay(105);
If(bonus_map == 1)
{
Exit_Secret(0);
}
Else
{
Exit_Normal(0);
}
}