@Aegul
AWESOME work on getting that stuff done. You never cease to impress, Aegul.
Quote: "@ TZK any ideas what this might be?

"
Yep, like he just said above, he means a Mario-styled platformer view.
Oh, and for something like bullet-impact decals on dynamic objects, I think this has been done for Unity, so maybe we could have a look at how it was done in Unity and replicate it in DarkBASIC Pro.
EDIT: I think I might have an idea on how to get the platformer stuff done. There is a mod for Doom called "Pogostick" which is pretty much Mario-Doom. The code is all
ACS (a C-styled scripting language) so it shouldn't be too hard to convert to DBP. It works by using a camera actor (which would just be a camera in DBP) and positions it based on the positions of the player. Here's the source code of the mod for reference:
//////////////////////////////////////////////////////////
//////////// MAIN POGOSTICK SCRIPT ////////
//////////////////////////////////////////////////////////
//////////// DONT MODIFY THIS SCRIPT IN YOUR MAP! ////////
//////////// ONCE THE MAIN SCRIPT IS UPDATED ////////
//////////// ALL YOUR LEET CHANGES WILL BE LOST! ////////
//////////////////////////////////////////////////////////
#include "zcommon.acs"
/************
** DEFINES **
************/
//Scripts | V=Void O=Open E=Enter R=Respawn P=Puked D=Death Q=Disconnect
#define S_INTRO 703 //Map Intro Fading Black O
#define S_ESTART 300 //Main ENTER script E
#define S_RSTART 301 //Main RESPAWN script R
#define S_DIE 303 //Death D
#define S_LEAVE 304 //Disconnect Q
#define S_IHUD 311 //Init HUD E
#define S_HUD 320 //HUD E
#define S_CAMERA 302 //Camera V
#define S_CAMIN 341 //Camera Closer P
#define S_CAMOUT 342 //Camera Farther P
#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_PAINS 701 //Pain Simulation V
#define S_FORCEA 305 //Forced Angle E
#define S_FACER 306 //Face Right P
#define S_FACEL 307 //Face Left P
#define S_SCORE 700 //Score P(Decorate)
#define S_BONUS 704 //Bonus P(Decorate)
#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};
str weaponStr[8] = {"Fist","Pistol","Shotgun","SSG","Chaingun","Launcher","Rifle","BFG"};
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;
}
///////////////////////////////////
//// MAP INTRO FADING BLACK ///////
///////////////////////////////////
script S_INTRO OPEN
{
SetHudSize (640, 480, 1);
SetFont("M_BLACK");
HudMessage (s:"A";HUDMSG_FADEINOUT,10,CR_UNTRANSLATED,320.0,240.0,0.0,0.0,1.0);
}
///////////////////////////////
//// 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_PAINS,0,0,0,0);
ACS_ExecuteAlways(S_STRAFE,0,0,0,0);
ACS_ExecuteAlways(S_SHADOW,0,0,0,0);
}
Script S_RSTART RESPAWN
{
if (!ActivatorTID ()) { Thing_ChangeTID (0, NextTID ()); }
cam_mode[PlayerNumber ()] = ON;
ACS_ExecuteAlways (S_CAMERA, 0, PlayerNumber ());
ACS_ExecuteAlways(S_PAINS,0,0,0,0);
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_DIE DEATH
{
fadeto(0.0,0.0,0.0,1.0,1.0);
delay(35);
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_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.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);
}
}
//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;
}
///////////////////////////////
//// PAIN SIMULATION //////////
///////////////////////////////
Script S_PAINS (void)
{
HealthOld[PlayerNumber()]=GetActorProperty(ActivatorTID(), APROP_Health);
delay(1);
while(TRUE)
{
HealthNew[PlayerNumber()]=GetActorProperty(ActivatorTID(), APROP_Health);
if (HealthOld[PlayerNumber()] > HealthNew[PlayerNumber()])
{
SetHudSize (640, 480, 1);
SetFont("HUDPAIN");
HudMessage (s: "A";HUDMSG_FADEINOUT,500,CR_UNTRANSLATED,320.0,240.0,0.0,0.0,0.5);
}
HealthOld[PlayerNumber()]=GetActorProperty(ActivatorTID(), APROP_Health);
delay(LOOPTIC);
}
}
/////////////////////////////////
/////// SCORE SYSTEM ////////////
///////////////////////////////// Each player has his own score
Script S_SCORE (int scoreAdd)
{
score += scoreAdd;
For(int i = 0;i < 6;i++)
{
While(scoreAdd >= scoreAmount[i])
{
Thing_Projectile(0,scoreFx[i],0,0,12);
scoreAdd -= scoreAmount[i];
Delay(5);
}
}
}
////////////////////////
// BONUS GAME COUNTER //
//////////////////////// All players share one counter
Script S_BONUS (void)
{
if(bonus==99)
{
bonus=0;
bonus_map=(1);
AmbientSound("S_BONMAP", 128);
SetHudSize (640, 480, 1);
SetFont("BIGFONT");
HudMessageBold (s:"\cGBonus Map \cGactivated!";HUDMSG_FADEINOUT,4,CR_UNTRANSLATED,320.0,240.0,2.0, 1.0, 1.0);
}
Else
{
bonus++;
}
}
////////////////////////////////////////////
//////////CUSTOM HUD////////////////////////
////////////////////////////////////////////
Script S_IHUD ENTER
{
SetHudSize (640, 480, 1);
SetFont("HUDLMP");
HudMessage (s: "A";HUDMSG_PLAIN,1000,CR_UNTRANSLATED,320.0,240.0,0.0);
}
Script S_HUD ENTER
{
int WeaponIndex;
//Setting the screen
SetHudSize (640, 480, 1);
SetFont("BIGFONT");
//Health Display
HudMessage (s:"\cCHealth";HUDMSG_PLAIN,899,CR_UNTRANSLATED,70.0,430.0,1.0);
HudMessage (s:"\cG ",i: GetActorProperty(ActivatorTID(),APROP_HEALTH);HUDMSG_PLAIN,999,CR_UNTRANSLATED,135.0,430.0,1.0);
//Armor
HudMessage (s:"\cCArmor";HUDMSG_PLAIN,898,CR_UNTRANSLATED,70.0,460.0,1.0);
HudMessage (s:"\cG ",i: CheckInventory("Armor");HUDMSG_PLAIN,998,CR_UNTRANSLATED,135.0,460.0,1.0);
//WeaponInUSe
if(checkweapon("FistPlat")){WeaponIndex = 0;}
if(checkweapon("PistolPlat")){WeaponIndex = 1;}
if(checkweapon("ShotgunPlat")){WeaponIndex = 2;}
if(checkweapon("SuperShotgunPlat")){WeaponIndex = 3;}
if(checkweapon("ChaingunPlat")){WeaponIndex = 4;}
if(checkweapon("RocketLauncherPlat")){WeaponIndex = 5;}
if(checkweapon("PlasmaRiflePlat")){WeaponIndex = 6;}
if(checkweapon("BFG9000Plat")){WeaponIndex = 7;}
HudMessage (s:"\cCWeapon";HUDMSG_PLAIN,897,CR_UNTRANSLATED,420.0,430.0,1.0);
HudMessage (s:"\cG", s:weaponStr[WeaponIndex];HUDMSG_PLAIN,997,CR_UNTRANSLATED,540.0,430.0,1.0);
//Score
HudMessage (s:"\cCScore";HUDMSG_PLAIN,826,CR_UNTRANSLATED,60.0,28.0,1.0);
HudMessage (s:"\cG", d:score;HUDMSG_PLAIN,926,CR_UNTRANSLATED,153.0,28.0,1.0);
//Blood Diamond
HudMessage (s:"\cCBonus";HUDMSG_PLAIN,896,CR_UNTRANSLATED,490.0,28.0,1.0);
HudMessage (s:"\cG", d:bonus;HUDMSG_PLAIN,996,CR_UNTRANSLATED,568.0,28.0,1.0);
//Ammo
SetFont("SMALLFONT");
HudMessage (s:"\cCClips";HUDMSG_PLAIN,895,CR_UNTRANSLATED,446.0,443.0,1.0);
HudMessage (s:"\cG", d: CheckInventory("Clip"), s:" / ", d: GetAmmoCapacity("Clip");HUDMSG_PLAIN,995,CR_UNTRANSLATED,540.0,443.0,1.0);
HudMessage (s:"\cCShells";HUDMSG_PLAIN,894,CR_UNTRANSLATED,441.0,451.0,1.0);
HudMessage (s:"\cG", d: CheckInventory("Shell"), s:" / ", d: GetAmmoCapacity("Shell");HUDMSG_PLAIN,994,CR_UNTRANSLATED,540.0,451.0,1.0);
HudMessage (s:"\cCRockets";HUDMSG_PLAIN,892,CR_UNTRANSLATED,436.0,459.0,1.0);
HudMessage (s:"\cG", d: CheckInventory("RocketAmmo"), s:" / ", d: GetAmmoCapacity("RocketAmmo");HUDMSG_PLAIN,992,CR_UNTRANSLATED,540.0,459.0,1.0);
HudMessage (s:"\cCCells";HUDMSG_PLAIN,893,CR_UNTRANSLATED,444.0,467.0,1.0);
HudMessage (s:"\cG", d: CheckInventory("Cell"), s:" / ", d: GetAmmoCapacity("Cell");HUDMSG_PLAIN,993,CR_UNTRANSLATED,544.0,467.0,1.0);
if(Checkinventory("PowerIronFeet"))
{SetFont("SUITA0");HudMessage (s: "A";HUDMSG_PLAIN,991,CR_UNTRANSLATED,230.0,495.0,1.0);}
if(Checkinventory("YellowCard"))
{SetFont("YKEYA0");HudMessage (s: "A";HUDMSG_PLAIN,990,CR_UNTRANSLATED,620.0,445.0,1.0);}
if(Checkinventory("YellowSkull"))
{SetFont("YSKUA0");HudMessage (s: "A";HUDMSG_PLAIN,989,CR_UNTRANSLATED,635.0,444.0,1.0);}
if(Checkinventory("RedCard"))
{SetFont("RKEYA0");HudMessage (s: "A";HUDMSG_PLAIN,988,CR_UNTRANSLATED,620.0,465.0,1.0);}
if(Checkinventory("RedSkull"))
{SetFont("RSKUA0");HudMessage (s: "A";HUDMSG_PLAIN,987,CR_UNTRANSLATED,635.0,464.0,1.0);}
if(Checkinventory("BlueCard"))
{SetFont("BKEYA0");HudMessage (s: "A";HUDMSG_PLAIN,986,CR_UNTRANSLATED,620.0,485.0,1.0);}
if(Checkinventory("BlueSkull"))
{SetFont("BSKUA0");HudMessage (s: "A";HUDMSG_PLAIN,985,CR_UNTRANSLATED,635.0,484.0,1.0);}
delay(LOOPTIC);
restart;
}
////////////////////////////
//// 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);
}
}
////////////////////////////
//// LEVEL INTRO TEXT ////// <---- CHANGES ALLOWED (REPLACE AUTHOR & TITLE)
////////////////////////////
script 251 ENTER
{
SetHudSize(640, 400, 0);
Setfont("dbigfont");
HudmessageBold(s:"Title";
HUDMSG_FADEOUT, 0, CR_WHITE, 320.4, 190.0, 3.5, 1.0);
Setfont("smallfont");
HudmessageBold(s:"by Author";
HUDMSG_FADEOUT, 0, CR_RED, 320.4, 205.0, 3.5, 1.0);
}
/////////////////////////////////////////////////////////////////////////
///////////////////// POGOSTICK SCRIPT END ///////////////////////
///////////////////// (copy to here if you want ///////////////////////
///////////////////// to do your own maps) ///////////////////////
/////////////////////////////////////////////////////////////////////////
/* Do NOT use scripts 300-342, 251-255, 700-705 in your map scripts! */
/////////////////////////////////////////////////////////////////////////
-TZK