That's a great tip chopkinsca and one I'll be bound to use in the near future.
I'll go ahead and post up the utility I was working on:
DOWNLOAD PLAY TESTER UTILITY HERE
Its a self-contained ACS library wad meant to be paired with any wad that can run under zdoom. Just press T or configure your controls under utility section to activate the script. Like I mentioned before, its only current function is to output x and y coordinates to the user. Not very useful, BUT, the codes structure lends itself well for troubleshooting situations and what not. I'm hoping somebody somewhere could use it. Functions at the bottom could have some use to someone also.
...and here's some code...
Code: Select all
#library "show_coordinates"
#include "zcommon.acs"
#define PLAYER_START_TID 1000
bool COORD_ACTIVE = false;
int x,y; //map coordinates
int sector; //current sector player is in
int line = 0; //line that player is looking at
script 900 ENTER
{
SetFont("SMALLFONT");
While (COORD_ACTIVE)
{
x = GetActorX(0); y = GetActorY (0);
sector = GetPlayerSectorNumber();
//print map coordinates
HudMessage(s:"x:",f:x, s:" ", s:"y:", f:y;
HUDMSG_PLAIN, 1, CR_GREEN,
0.0, 0.0, 5.0 );
//print current sector
if( sector == -1 ) //if player outside of map (clipping)
HudMessage(s:"Sector: Out of Map";
HUDMSG_PLAIN, 2, CR_GREEN,
0.0, 0.1, 5.0 );
else HudMessage(s:"Sector:",d:sector;
HUDMSG_PLAIN, 2, CR_GREEN,
0.0, 0.1, 5.0 );
//print line you are staring at
HudMessage(s:"Line:",d:line;
HUDMSG_PLAIN, 3, CR_GREEN,
0.0, 0.2, 5.0 );
Delay (1);
}
//clear screen of all stats
HudMessage(s:""; HUDMSG_PLAIN, 1, CR_GREEN, 0.0, 0.0, 5.0 );
HudMessage(s:""; HUDMSG_PLAIN, 2, CR_GREEN, 0.0, 0.0, 5.0 );
HudMessage(s:""; HUDMSG_PLAIN, 3, CR_GREEN, 0.0, 0.0, 5.0 );
suspend;
restart;
}
script 901 (void)
{
if( !COORD_ACTIVE )
{
COORD_ACTIVE = true;
ACS_Execute(900,0,0,0,0);
}
else COORD_ACTIVE = false;
}
script 5 ENTER
{
Thing_ChangeTID(0, 1000 + PlayerNumber());
}
//modified from Cjk10000
#define MAX_SECTOR_NUM 1000 //The maximum number of sector ids to check. Bigger numbers may cause runaway terminations in some conditions.
function int GetActorSectorNumber(int tid)
{
for (int s = 0; s <= MAX_SECTOR_NUM; s++)
if (ThingCountSector(T_NONE,PLAYER_START_TID, s) > 0) return s;
return -1; //Returns -1 if no sector tid found.
}
function int GetPlayerSectorNumber(void)
{
for (int s = 0; s <= MAX_SECTOR_NUM; s++)
if (ThingCountSector(T_NONE, PLAYER_START_TID, s) > 0) return s;
return -1; //Returns -1 if no sector tid found.
}