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 Menu
if (save_scheduled) {
SaveGameSlot(saveSlotId, saveSlotString);
saveSlotId = 0;
saveSlotString = "";
save_scheduled = false;
}
Room_First_Load {
//Set up a doors with ID 20 and set it to unlocked but closed
Doors.Initobject (20, oDoor.ID);
Doors.Setdoorstate (20, 0);
}
Room_Load{
//check if door is closed or open
Doors.Getdoorstate (20);
}
Room_First_Load {
//Set up a doors with ID 20 and set it to open
Doors.Initobject (20, oDoor.ID);
Doors.Setdoorstate (20, 1);
}
Room_Load{
//check if door is closed or open
Doors.Getdoorstate (20);
}
Quote from: Snarky on Mon 19/02/2018 22:31:04
SayBubble() doesn't support inline text-replacement using tokens like %s. This is an AGS limitation. What you'll have to do is to use String.Format() to insert those arguments, like so:Code: ags player.SayBubble(String.Format("Nice %s", locationname));
// unhandled LOOK AT
else if (Verbs.UsedAction(eGA_LookAt)) {
// look at hotspots, objects etc.
if (type!=2) player.Say("Nice %s", locationname);
// look at characters
else player.Say("It's %s",locationname);
}
// unhandled LOOK AT
else if (Verbs.UsedAction(eGA_LookAt)) {
// look at hotspots, objects etc.
if (type!=2) player.SayBubble("Nice %s", locationname);
// look at characters
else player.Say("It's %s",locationname);
}
if (door_script == 1) player.SayBubble("It is already open.");
// THIS WILL WORK
else if (type ==2) player.SayBubble("%s would not like it.",locationname);
// THIS WON'T
if (AGSCursorMode != eModeUsermode2 && type != 0) {
if (type==2 || type==6) player.FaceCharacter(character[location_id], eBlock);
// unhandled USE
if (Verbs.UsedAction(eGA_Use)) {
// use inv on inv
if (type >= 5) player.Say("That won't do any good.");
// use
else player.SayBubble("I can't use that.");
}
void Update(this MagnifierType*) {
if ((this.AGSGUI == null) || (this.Sprite <= 0)) {
this.Enabled = false;
return;
}
if (this.prevenabled != this.Enabled) { // toggle on/off
if ((this.HideMouseCursor) || (this.prevhidemouse)) {
if (this.Enabled) this.HideCursor();
else this.ShowCursor();
}
}
else if ((this.prevhidemouse != this.HideMouseCursor) && (this.Enabled)) {
if (this.HideMouseCursor) this.HideCursor();
else this.ShowCursor();
}
this.prevhidemouse = this.HideMouseCursor;
if (this.ScaleFactor <= 0.0) this.ScaleFactor = 0.1;
this.prevenabled = this.Enabled;
this.AGSGUI.Visible = false;
if (!this.Enabled) return;
this.AGSGUI.BackgroundGraphic = 0;
this.X = mouse.x;
this.Y = mouse.y;
if ((this.X + this.XOffset) < 0) this.AGSGUI.X = 0;
else if ((this.X + this.XOffset) >= System.ViewportWidth) this.AGSGUI.X = (System.ViewportWidth - 1);
else this.AGSGUI.X = (this.X + this.XOffset);
if ((this.Y + this.YOffset) < 0) this.AGSGUI.Y = 0;
else if ((this.Y + this.YOffset) >= System.ViewportHeight) this.AGSGUI.Y = (System.ViewportHeight - 1);
else this.AGSGUI.Y = (this.Y + this.YOffset);
DynamicSprite *sprite = DynamicSprite.CreateFromExistingSprite(this.Sprite, false);
int x = (FloatToInt(IntToFloat(this.X) * this.ScaleFactor) + this.XOffset);
int y = (FloatToInt(IntToFloat(this.Y) * this.ScaleFactor) + this.YOffset);
sprite.ChangeCanvasSize(FloatToInt(IntToFloat(System.ViewportWidth) * this.ScaleFactor), FloatToInt(IntToFloat(System.ViewportHeight) * this.ScaleFactor), x, y);
this.BackgroundSprite = DynamicSprite.CreateFromBackground();
DrawingSurface *surface = this.BackgroundSprite.GetDrawingSurface();
int i = 0;
while ((i < Game.CharacterCount) || (i < Room.ObjectCount)) {
if (i < Game.CharacterCount) {
if (character[i].Room == player.Room) {
ViewFrame *frame = Game.GetViewFrame(player.View, player.Loop, player.Frame);
int w = ((Game.SpriteWidth[frame.Graphic] * character[i].Scaling) / 100);
int h = ((Game.SpriteHeight[frame.Graphic] * character[i].Scaling) / 100);
surface.DrawImage(character[i].x - (w / 2), character[i].y - h, frame.Graphic, 0, w, h);
}
}
if (i < Room.ObjectCount) {
if (object[i].Visible) {
int graphic = object[i].Graphic;
if (object[i].View) {
ViewFrame *frame = Game.GetViewFrame(object[i].View, object[i].Loop, object[i].Frame);
graphic = frame.Graphic;
}
int w = Game.SpriteWidth[graphic];
int h = Game.SpriteHeight[graphic];
if (!object[i].IgnoreScaling) {
int scale = GetScalingAt(object[i].X, object[i].Y);
w = ((w * scale) / 100);
h = ((h * scale) / 100);
}
surface.DrawImage(object[i].X, object[i].Y - Game.SpriteHeight[graphic], graphic);
}
}
i++;
}
surface.Release();
this.BackgroundSprite.Resize(FloatToInt(IntToFloat(this.BackgroundSprite.Width) * this.ScaleFactor), FloatToInt(IntToFloat(this.BackgroundSprite.Height) * this.ScaleFactor));
sprite.ChangeCanvasSize(this.BackgroundSprite.Width, this.BackgroundSprite.Height, 0, 0);
this.BackgroundSprite.CopyTransparencyMask(sprite.Graphic);
int w = Game.SpriteWidth[this.Sprite];
int h = Game.SpriteHeight[this.Sprite];
int ww = this.BackgroundSprite.Width;
int hh = this.BackgroundSprite.Height;
if ((ww > w) && (hh > h)) this.BackgroundSprite.Crop(x, y, w, h);
else if (ww > w) {
this.BackgroundSprite.Crop(x, 0, w, hh);
if (hh < h) this.BackgroundSprite.ChangeCanvasSize(w, h, 0, (h - hh) / 2);
}
else if (hh > h) {
this.BackgroundSprite.Crop(0, y, ww, h);
if (ww < w) this.BackgroundSprite.ChangeCanvasSize(w, h, (w - ww) / 2, 0);
}
else this.BackgroundSprite.ChangeCanvasSize(w, h, (w - ww) / 2, (h - hh) / 2);
if ((ww <= w) || (hh <= h)) {
sprite = this.BackgroundSprite;
this.BackgroundSprite = DynamicSprite.Create(w, h, false);
surface = this.BackgroundSprite.GetDrawingSurface();
surface.Clear(0);
surface.DrawImage(0, 0, sprite.Graphic);
surface.Release();
}
surface = this.BackgroundSprite.GetDrawingSurface();
if (this.ScaleFactor < 1.0) {
surface.DrawingColor = 0;
int xm = FloatToInt(IntToFloat(System.ViewportWidth) * this.ScaleFactor);
int xx = (x + w);
if (x < 0) surface.DrawRectangle(0, 0, -x, surface.Height);
if (xx >= xm) surface.DrawRectangle(xm - x, 0, xx - x, surface.Height);
int ym = FloatToInt(IntToFloat(System.ViewportHeight) * this.ScaleFactor);
int yy = (y + h);
if (y < 0) surface.DrawRectangle(0, 0, surface.Width, -y);
if (yy >= ym) surface.DrawRectangle(0, ym - y, surface.Width, yy - y);
if ((x < 0) || (y < 0) || (xx >= xm) || (yy >= ym)) {
surface.Release();
sprite = DynamicSprite.CreateFromExistingSprite(this.Sprite, false);
this.BackgroundSprite.CopyTransparencyMask(sprite.Graphic);
surface = this.BackgroundSprite.GetDrawingSurface();
}
}
surface.DrawImage(0, 0, this.Sprite);
surface.Release();
x = (this.X + this.XOffset);
y = (this.Y + this.YOffset);
int xx = (x + w);
int yy = (y + h);
if ((xx <= 0) || (yy <= 0) || (x >= System.ViewportWidth) || (y >= System.ViewportHeight)) {
this.BackgroundSprite = null;
this.AGSGUI.BackgroundGraphic = 0;
this.AGSGUI.Width = 1;
this.AGSGUI.Height = 1;
}
else {
if ((x < 0) && (y < 0)) this.BackgroundSprite.Crop(-x, -y, this.BackgroundSprite.Width + x, this.BackgroundSprite.Height + y);
else if (x < 0) this.BackgroundSprite.Crop(-x, 0, this.BackgroundSprite.Width + x, this.BackgroundSprite.Height);
else if (y < 0) this.BackgroundSprite.Crop(0, -y, this.BackgroundSprite.Width, this.BackgroundSprite.Height + y);
this.AGSGUI.BackgroundGraphic = this.BackgroundSprite.Graphic;
this.AGSGUI.Width = this.BackgroundSprite.Width;
this.AGSGUI.Height = this.BackgroundSprite.Height;
}
this.AGSGUI.Visible = true;
}
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.060 seconds with 13 queries.