But what if I am developing a module that use this property and don't want to rely on module's user setting it.
How can I protect my module from crashing the game?
How can I protect my module from crashing the game?
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 MenuQuotePS. Then again, the biggest problem of AGS is very limited UNDO command.+1 Caused me some wasted work
function Bubble::Render(int x, int y)
{
int radius = 10;
DynamicSprite* sprite = DynamicSprite.Create(radius, radius, true);
DrawingSurface* surface = sprite.GetDrawingSurface();
surface.DrawingColor = 100;
surface.DrawCircle(radius, radius, radius);
surface.Release();
Overlay* myOverlay = Overlay.CreateGraphical(x, y, sprite.Graphic, false);
// what now?
sprite.Delete();
}
DrawingSurface *roomSurface = Room.GetDrawingSurfaceForBackground();
roomSurface.DrawImage(x, y, sprite.Graphic);
roomSurface.Release();
static function VerbCoin::GetModeByControl(GUIControl* control) {
if (control.OwningGUI == interface && control.Visible) {
return modemap[control.ID];
} else {
return eModePointer
}
}
cEgo.Walk(14, 22);
int ladderX = 14;
int ladderY = 22;
cEgo.Walk(ladderX, ladderY);
cEgo.Walk(coordLadder.x, coordLadder.y);
cEgo.Walk(coordLadder);
Quote
function ApproachCharacter(this Character*,
Character* npc,
int offsetX,
int offsetY
/*BlockingStyle blockingStyle,
WalkWhere walkWhere*/)
{
int trueOffsetX = 0;
int trueOffsetY = 0;
// Facing npc allows calculating direction of approach
this.FaceCharacter(npc);
switch (this.Loop) {
case eDirectionUp:
trueOffsetY = offsetY;
break;
case eDirectionDown:
trueOffsetY = (-1) * offsetY;
break;
case eDirectionRight:
trueOffsetX = (-1) * offsetX;
break;
default:
// fall through to eDirectionLeft
case eDirectionLeft:
trueOffsetX = offsetX;
break;
}
this.Walk(npc.x + trueOffsetX, npc.y + trueOffsetY, eBlock, eWalkableAreas);
this.FaceCharacter(npc);
npc.FaceCharacter(this);
}
QuoteDoes the "magic number" depend on the character (e.g. with cAlice you should always be 10 pixels away), on where they are on the screen (e.g. if you're talking to a character who's behind the desk, you should always stand in a certain position), or both? Does it need to change depending on the character scaling? Do your characters stand in one of a number of pre-defined locations, or do they wander about anywhere on the walkable area?
Quote
If characters can be anywhere on the screen, with different WalkTo behavior in different parts of the screen, you might need to define regions, and a lookup table from each region to its WalkTo point/offset.
Quote
If a WalkTo point falls outside a walkable area, the character should walk to the closest point it can reach. If that's not acceptable, what is it that you want to happen?
function cNPC_Look()
{
// Walking and orientation boilerplate
cPlayer.Walk(cNPC.x, cNPC.y + 15, eBlock, eWalkableAreas);
cPlayer.FaceCharacter(cNPC);
cNPC.FaceCharacter(cPlayer);
// What I actually want to happen
cPlayer.Say("I have no idea who is this");
}
cChar.Say(Room.Messages[1]);
cChar.Say("Hi!");
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.031 seconds with 14 queries.