...How do I request a feature from the developers?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuOverlay* CreateOverlayText(int x, int y, int width, FontType font, int color, int bgColor, String text) {
int border = 2;
textOverlay = DynamicSprite.Create(width + border * 2, GetTextHeight(text, font, width) + border * 2);
DrawingSurface* ds = textOverlay.GetDrawingSurface();
ds.Clear(COLOR_TRANSPARENT); // background color
ds.DrawingColor = bgColor;
ds.DrawStringWrapped(border, border, width, font, eAlignLeft, text);
ds.DrawStringWrapped(-border, border, width, font, eAlignLeft, text);
ds.DrawStringWrapped(border, -border, width, font, eAlignLeft, text);
ds.DrawStringWrapped(-border, -border, width, font, eAlignLeft, text);
ds.DrawingColor = color;
ds.DrawStringWrapped(0, 0, width, font, eAlignLeft, text);
ds.Release();
return Overlay.CreateGraphical(x, y, textOverlay.Graphic, true);
}
Overlay* CreateOverlayText(int x, int y, int width, FontType font, int color, int bgColor, String text) {
int border = 2;
textOverlay = DynamicSprite.Create(width + border * 2, GetTextHeight(text, font, width) + border * 2);
DrawingSurface* ds = textOverlay.GetDrawingSurface();
ds.Clear(COLOR_TRANSPARENT); // background color
ds.DrawingColor = bgColor;
ds.DrawStringWrapped(border, border, width, font, eAlignLeft, text);
ds.DrawingColor = color;
ds.DrawStringWrapped(0, 0, width, font, eAlignLeft, text);
ds.Release();
return Overlay.CreateGraphical(x, y, textOverlay.Graphic, true);
}
Overlay* CreateOverlayText(int x, int y, int width, FontType font, int color, int bgColor, String text) {
int border = 5;
textOverlay = DynamicSprite.Create(width + border * 2, GetTextHeight(text, font, width) + border * 2);
DrawingSurface* ds = textOverlay.GetDrawingSurface();
ds.Clear(bgColor); // background color
ds.DrawingColor = color;
ds.DrawStringWrapped(border, border, width, font, eAlignLeft, text);
ds.Release();
return Overlay.CreateGraphical(x, y, textOverlay.Graphic, true);
}
...
String overlayString = String.Format("room %d mouse x%d,y%d ft %d translation %02d:%02d puppet %02d:%02d smallone %02d:%02d",
player.Room, mouse.x,mouse.y, FutureTime, BMin, BTimerSec, PMin, PTimerSec, SMin, STimerSec);
if (ovCoords != null && ovCoords.Valid) ovCoords.Remove();
ovCoords = CreateOverlayText(50, 720, 1000, eFontNormal, 51520, 17, overlayString);
ovCoords = CreateOverlayText(50, 720, 1356, eFontNormal, 51520, 17,
String.Format("room %d mouse x%d,y%d ft %d translation %02d:%02d puppet %02d:%02d smallone %02d:%02d",
player.Room, mouse.x,mouse.y, FutureTime, BMin, BTimerSec, PMin, PTimerSec, SMin, STimerSec) );
if (ovCoords != null && ovCoords.Valid) ovCoords.Remove();
ovCoords = Overlay.CreateTextual(50, 720, 1366, eFontNormal, 51520, "TEXT"
function repeatedly_execute_always()
{
...
//do sacebar coordinates
if (ovCoordsVisible) {
//BookTranslationTimer - number of game loops it takes to translate homer's book
//PuppetTimer - number of game loops it takes to make current puppet
//timer countdowns
if (BookTranslationTimer>=0) BookTranslationTimer-=1;
if (PuppetTimer>=0) PuppetTimer-=1;
int GameSpeed=GetGameSpeed();
int BSec=BookTranslationTimer/GameSpeed;
int BMin=BSec/60;
int BTimerSec=BSec%60;
int PSec=PuppetTimer/GameSpeed;
int PMin=PSec/60;
int PTimerSec=PSec%60;
if (ovCoords != null && ovCoords.Valid) ovCoords.Remove();
ovCoords = Overlay.CreateTextual(50, 720, 1366, eFontNormal, 51520,
String.Format("room %d mouse x%d,y%d ft %d tr %02d:%02d pt %02d:%02d",
player.Room, mouse.x,mouse.y, FutureTime, BMin, BTimerSec,
PMin, PTimerSec)
);
}
...
}
#define TIMER_BOMB 1
SetTimer(TIMER_BOMB,GetGameSpeed()*10*60); //10 minutes
Display("You have %d:%d till bomb explodes",<get how much time in seconds is left from timer 1>);
//get the X-AXIS COLUMN
int GetColRange(int x)
{
Display("x=%d",x);
if (x>=0 && x<=50) return 0;
if (x>=51 && x<=100) return 1;
if (x>=101 && x<=150) return 2;
if (x>=151 && x<=200) return 3;
if (x>=201 && x<=250) return 4;
if (x>=251 && x<=300) return 5;
if (x>=301 && x<=350) return 6;
if (x>=351 && x<=400) return 7;
if (x>=401 && x<=450) return 8;
if (x>=451 && x<=500) return 9;
}
//get the Y-AXIS ROW
int GetRowRange(int y)
{
Display("y=%d",y);
if (y>=0 && y<=50) return 0;
if (y>=51 && y<=100) return 1;
if (y>=101 && y<=150) return 2;
if (y>=151 && y<=200) return 3;
if (y>=201 && y<=250) return 4;
if (y>=251 && y<=300) return 5;
if (y>=301 && y<=350) return 6;
if (y>=351 && y<=400) return 7;
}
int GetRowRange(int y)
{
Display("provided with %d",y);
switch (y) {
case (y>=0 && y<=50): return 0; break;//return x/row
case (y>=51 && y<=100): return 1; break;
case (y>=101 && y<=200): return 2; break;
case (y>=201 && y<=300): return 3; break;
case (y>=301 && y<=400): return 4; break;
case (y>=401 && y<=500): return 5; break;
case (y>=501 && y<=600): return 6; break;
case (y>=601 && y<=700): return 7; break;
case (y>=701 && y<=800): return 8; break;
case (y>=801 && y<=900): return 9; break;
}
}
...
//fill out theGrid with Tile objects
int size = numRows*numCols;
theGrid=new Tile[size]; //instantiate theGrid
for (int i = 0; i < size; i++) {
theGrid[i] = new Tile;
}
SetupGridValues();
for (int j=0; j<numCrowds;j++) {
rabble[j]=new Crowd;
}
TMan=new TM;
...
import Tile *theGrid[];
import Crowd* rabble[numCrowds]; //4 crowds: red, yellow, green, purple
import TM* TMan;
__Tankman Tankman;
export Tankman;
bool gEnabled = false;
export gEnabled;
function __Tankman::Enable()
{
gEnabled = true;
}
function __Tankman::Disable()
{
gEnabled = false;
}
Tile *theGrid[]; //dynamic array of pointers
Crowd* rabble[4]; //4 crowds: red, yellow, green, purple
TM* TMan;
export theGrid;
export rabble;
export TMan;
...
function room_Load()
{
Tankman.Enable();
gIconbar.Visible=false;
oTM.Baseline=768;
cJulius.x=2000; //the main character of the game; he's here, but off-screen
cJulius.y=2000;
AG_playing=true;
AG_gameover=false;
newdirection=eKeyboardMovement_Up;
//set crowd views
oC0.SetView(330); //red
oC1.SetView(332); //yellow
oC2.SetView(331); //green
oC3.SetView(329); //purple
oTM.SetView(314); //tankman
//fill out theGrid with Tile objects
int size = numRows*numCols;
theGrid=new Tile[size]; //instantiate theGrid
for (int i = 0; i < size; i++) {
theGrid[i] = new Tile;
}
SetupGridValues();
for (int j=0; j<numCrowds;j++) {
rabble[j]=new Crowd;
}
//now, setup crowds:
///////////
// 0 RED //
///////////
rabble[0].mode=Random(1); //chase or scatter
//get random start tile
Tile *rt0 = GetTile();
rabble[0].aX=rt0.x;
....
else if (rt3.left==1) rabble[3].dir=3;
//set nogo based on dir
rabble[3].nogo=SetNogo(rabble[3].dir);
//setup tankman:
/////////////
// Tankman //
/////////////
TMan.tileX=6; <----NULL POINTER REFERENCED
function room_Load()
{
Tankman.Enable();
gIconbar.Visible=false;
oTM.Baseline=768;
cJulius.x=2000; //the main character of the game; he's here, but off-screen
cJulius.y=2000;
AG_playing=true;
AG_gameover=false;
newdirection=eKeyboardMovement_Up;
//set crowd views
oC0.SetView(330); //red
oC1.SetView(332); //yellow
oC2.SetView(331); //green
oC3.SetView(329); //purple
oTM.SetView(314); //tankman
theGrid=new Tile[numRows*numCols]; //define it as a new Tile array of size rows*colums
Display("%p %d %d",theGrid, numRows, numCols); <---------displays "<8 random hex characters> 8 10"
theGrid[0].x=25; <---------------------------------Error: null pointer referenced, PROGRAM STOPS HERE
Display("%p %d %d",theGrid, numRows, numCols);
Display("rgarghath");
SetupGridValues();
GetTargetRed();
// new module header
struct __Tankman
{
import function Enable();
import function Disable();
};
import __Tankman Tankman;
#define numRows 8
#define numCols 10
#define tankLoop 314
managed struct Tile {
int x; //x centre of tile
int y; //y centre of tile
bool up; //has up direction
bool right; //has right direction
bool down; //has down direction
bool left; //has left direction
int content; //is it a free tile or blocked space?
};
#define numCrowds 4
managed struct Crowd {
int aX; //actual x eg. 312
int aY; //actual y eg. 472
int tX; //target x - x centre of target tile
int tY; //target y - y centre of target tile
int mode; //mode, 0=chase, attack=1, scatter=2, scared=3, regen=4
int timer1; //timer to stay in mode
int timer2; //timer to stay aggressive
int waittimer; //timer for wait between attacks/cooldown time
int timercontrol; //a timer is on=1/off=0
int dir; //0=up, 1=right, 2=down, 3=left Never Eat Soggy Wheatbix
int nogo; //opposite direction to where your pointed; dir/nogo 0/2 1/3 2/0 3/1
int moving; //1=moving to next coord, 0=not moving, decision/action time
bool attack; //are they programmed to be aggressive? 0-no 1-yes
int id; //object ID, leads to control of object loop/position
bool dead; //0=alive, 1=dead
import void ResetTimers(Crowd *crowd);
import void FindTargetBasedOnMode(Crowd *crowd, int mode);
import void MoveCrowdToTarget(Crowd *crowd);
import int CleanUpDeadCrowd(Crowd *crowd);
};
managed struct TM {
int tileX; //tm's current tile
int tileY;
int dir; //tm's current dir
int nogo; //diametric opposite to dir
int mode;
int id; //object id
};
import int SetNogo(int dir);
import int DirToLoop(int dir);
import int LoopToDir(int loop);
import Tile* GetTile(int x=-1, int y=-1);
__Tankman Tankman;
export Tankman;
bool gEnabled = false;
export gEnabled;
function __Tankman::Enable()
{
gEnabled = true;
}
function __Tankman::Disable()
{
gEnabled = false;
}
Tile *theGrid[]; //dynamic array of pointers
Crowd* rabble[4]; //4 crowds: red, yellow, green, purple
TM* TMan;
...
...
function room_Load()
{
Tankman.Enable();
gIconbar.Visible=false;
oTM.Baseline=768;
cJulius.x=2000; //the main character of the game; he's here, but off-screen
cJulius.y=2000;
AG_playing=true;
AG_gameover=false;
newdirection=eKeyboardMovement_Up;
//set crowd views
oC0.SetView(330); //red
oC1.SetView(332); //yellow
oC2.SetView(331); //green
oC3.SetView(329); //purple
oTM.SetView(314); //tankman
theGrid=new Tile[numRows*numCols]; <------ Error: Undefined token 'theGrid'
import Tile *theGrid[];
import Crowd* rabble[4]; //4 crowds: red, yellow, green, purple
import TM* TMan;
function room_Load()
{
...
theGrid=new Tile[numRows*numCols]; //define it as a new Tile array of size rows*colums
Display("%d %d",numRows, numCols);
theGrid[0].x=25; theGrid[0].y=25; theGrid[0].up=0; theGrid[0].right=1; theGrid[0].down=1; theGrid[0].left=0; theGrid[0].content=0;
theGrid[1].x=75; theGrid[1].y=25; theGrid[1].up=0; theGrid[1].right=1; theGrid[1].down=0; theGrid[1].left=1; theGrid[1].content=0;
theGrid[2].x=125; theGrid[2].y=25; theGrid[2].up=1; theGrid[2].right=1; theGrid[2].down=0; theGrid[2].left=1; theGrid[2].content=0;
Display("rgarghath");
SetupGridValues();
GetTargetRed();
Tile *theGrid[]; //dynamic array of pointers
function game_start()
{
...
theGrid=new Tile[numRows*numCols]; //define it as a new Tile array of size rows*colums
Display("rgarghath");
SetupGridValues(); <------Display output for testing, sets up grid values now it's been properly instantiated
GetTargetRed(); <----- function than generates Display output
}
vc[0] = Maths.Sqrt( Maths.RaiseToPower(Fcx-Ftmx, 2) + Maths.RaiseToPower(Fcy-Ftmy, 2) );
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.038 seconds with 14 queries.