Hallo!
Ich habe mal zum Test eine C64-Palette als BMP in AGS importiert.
Dies hat allerdings wohl nur Auswirkungen auf die Einstellung von Text-Elementen.
Die Raumgrafiken, Sprites, etc. werden in ihrer farblichen Darstellung nicht beeinflusst.
Ein Problem würde dies in der Hinsicht darstellen, dass laut AGS in einem absolut dunklen Raum nicht alles komplett Schwarz ist, sondern die Raumgrafiken, Objekte, Charaktere, Figuren alle in etwa mit einer Helligkeit irgendwo zwischen 5-10% dargestellt werden. Kann man irgendwo einstellen, das der Raum in ganz Schwarz dargestellt wird und in dem Verhältnis die anwesenden Charaktere in einem Grau-View gezeigt werden, so wie das beim C64 der Fall ist?
Ein C64 verfügt über diese Farbabstufungen nicht. Kann also dieses Feeling dadurch ruinieren.
Eine weitere Hürde stellt das Flashlight-PlugIn dar, da es ebenfalls bei der Beleuchtung mit Farbabstufungen arbeitet.
- Ließe sich das nicht unterbinden? So dass das Flashlight-PlugIn den anvisierten Bereich nur in den Original-Farben zeigt?
- Lässt sich auch die Form des Flashlight-Effekts verändern? Ursprünglich ist dieses ja kreisförmig. Auf dem C64 zeigt das Flashlight den anvisierten Bereich in einem Rechteck von 48x32 Pixel. Ließe sich das nicht auch umändern?
Dies ist die ursprüngliche Flashlight.ash:
// Script header for module 'Flashlight'
#ifdef AGS_SUPPORTS_IFVER
#ifver 3.1.2
#define FLASHLIGHT_VERSION 2.0
#define FLASHLIGHT_VERSION_200
#endif
#endif
#ifndef FLASHLIGHT_VERSION_200
#error Flashlight module error: This module now requires AGS version 3.1.2 or higher! Please upgrade to a higher version of AGS to use this module.
#endif
struct FlashlightType {
writeprotected GUI *AGSGUI;
writeprotected Overlay *AGSOverlay;
writeprotected DynamicSprite *BeamSprite;
int DrawingColor;
bool Enabled;
writeprotected Character *FollowingCharacter;
writeprotected bool IsFollowingMouse;
writeprotected bool IsFollowingCharacter;
writeprotected bool IsFollowingPlayer;
writeprotected bool IsGUIMode;
writeprotected bool IsOverlayMode;
writeprotected bool IsStatic;
float Radius;
bool ScaleBeam;
import void SetBeamSprite(DynamicSprite *beamSprite);
import void SetFollowCharacter(Character*, bool followPlayer=true);
import void SetFollowMouse();
import void SetGUIMode(GUI*, DynamicSprite *beamSprite=0);
import void SetOverlayMode(DynamicSprite *beamSprite=0);
import void SetStatic();
writeprotected DynamicSprite *ScreenSprite;
int Transparency;
int X;
int Y;
};
import FlashlightType Flashlight;
Dies ist die ursprüngliche Flashlight.asc:
// Main script for module 'Flashlight'
FlashlightType Flashlight;
export Flashlight;
int get_max(int a, int b) {
if (a > b) return a;
return b;
}
DrawingSurface *Flashlight_SpriteSurface;
bool Flashlight_ValidateSurface() {
if (Flashlight.ScreenSprite == null) return false;
if (Flashlight_SpriteSurface != null) return true;
Flashlight_SpriteSurface = Flashlight.ScreenSprite.GetDrawingSurface();
return true;
}
void Flashlight_SetColor(int colour) {
if (!Flashlight_ValidateSurface()) return;
Flashlight_SpriteSurface.DrawingColor = colour;
}
import void Flashlight_ClearSprite(int colour=COLOR_TRANSPARENT);
void Flashlight_ClearSprite(int colour) {
if (!Flashlight_ValidateSurface()) return;
Flashlight_SpriteSurface.Clear(colour);
}
void Flashlight_DrawRectangle(int x1, int y1, int x2, int y2) {
if (!Flashlight_ValidateSurface()) return;
Flashlight_SpriteSurface.DrawRectangle(x1, y1, x2, y2);
}
void Flashlight_DrawImageResized(int x, int y, int spriteSlot, int width, int height) {
if (!Flashlight_ValidateSurface()) return;
Flashlight_SpriteSurface.DrawImage(x, y, spriteSlot, 0, width, height);
}
void FlashlightType::SetBeamSprite(DynamicSprite *beamSprite) {
if (beamSprite != null) {
this.BeamSprite = beamSprite;
this.BeamSprite.Resize(get_max(this.BeamSprite.Height, this.BeamSprite.Width), get_max(this.BeamSprite.Height, this.BeamSprite.Width));
this.Radius = IntToFloat(this.BeamSprite.Height) / 2.0;
}
}
void FlashlightType::SetOverlayMode(DynamicSprite *beamSprite) {
this.SetBeamSprite(beamSprite);
if (this.AGSGUI != null) this.AGSGUI.Visible = false;
this.AGSGUI = null;
if (this.AGSOverlay != null) this.AGSOverlay.Remove();
this.AGSOverlay = null;
this.IsGUIMode = false;
this.IsOverlayMode = true;
}
void FlashlightType::SetGUIMode(GUI *AGSGUI, DynamicSprite *beamSprite) {
this.SetBeamSprite(beamSprite);
if (AGSGUI == null) {
this.SetOverlayMode();
return;
}
this.AGSGUI = AGSGUI;
if (this.AGSOverlay != null) this.AGSOverlay.Remove();
this.AGSOverlay = null;
this.IsGUIMode = true;
this.IsOverlayMode = false;
}
void Initialize(this FlashlightType*) {
this.AGSOverlay = null;
this.BeamSprite = DynamicSprite.CreateFromFile("flashlight.bmp");
if (this.BeamSprite != null) {
this.BeamSprite.Resize(get_max(this.BeamSprite.Height, this.BeamSprite.Width), get_max(this.BeamSprite.Height, this.BeamSprite.Width));
this.Radius = IntToFloat(this.BeamSprite.Height) / 2.0;
}
else this.Radius = 0.5;
this.Enabled = false;
this.FollowingCharacter = null;
this.IsFollowingCharacter = false;
this.IsFollowingMouse = true;
this.IsFollowingPlayer = false;
this.IsGUIMode = false;
this.IsOverlayMode = true;
this.IsStatic = false;
this.ScreenSprite = null;
this.Transparency = 0;
this.X = mouse.x;
this.Y = mouse.y;
#ifdef FLASHLIGHT_GUI
this.SetGUIMode(FLASHLIGHT_GUI);
#endif
}
function game_start() {
Flashlight.Initialize();
}
void FlashlightType::SetFollowMouse() {
this.FollowingCharacter = null;
this.IsFollowingCharacter = false;
this.IsFollowingMouse = true;
this.IsFollowingPlayer = false;
this.IsStatic = false;
}
void FlashlightType::SetFollowCharacter(Character *characterToFollow, bool followPlayer) {
if ((characterToFollow == null) || (characterToFollow.Room != player.Room)) {
this.SetFollowMouse();
return;
}
this.FollowingCharacter = characterToFollow;
this.IsFollowingCharacter = true;
this.IsFollowingMouse = false;
this.IsFollowingPlayer = ((characterToFollow == player) && (followPlayer));
this.IsStatic = false;
}
void FlashlightType::SetStatic() {
this.FollowingCharacter = null;
this.IsFollowingCharacter = false;
this.IsFollowingMouse = false;
this.IsFollowingPlayer = false;
this.IsStatic = true;
}
void Update(this FlashlightType*) {
if ((this.AGSOverlay != null) && (this.AGSOverlay.Valid)) this.AGSOverlay.Remove();
this.AGSOverlay = null;
if (this.BeamSprite == null) this.Enabled = false;
if ((this.DrawingColor < 0) && (this.DrawingColor != COLOR_TRANSPARENT)) this.DrawingColor = 0;
if (this.IsGUIMode) {
this.AGSGUI.BackgroundGraphic = 0;
this.AGSGUI.Clickable = false;
int i = 0;
while (i < this.AGSGUI.ControlCount) {
this.AGSGUI.Controls[i].Visible = false;
i++;
}
this.AGSGUI.Height = System.ViewportHeight;
if (this.Transparency < 0) this.Transparency = 0;
if (this.Transparency > 100) this.Transparency = 100;
this.AGSGUI.Transparency = this.Transparency;
this.AGSGUI.Visible = this.Enabled;
this.AGSGUI.Width = System.ViewportWidth;
}
else this.Transparency = 0;
if ((this.IsFollowingPlayer) && (this.FollowingCharacter != player)) this.FollowingCharacter = player;
if ((this.FollowingCharacter != null) && (this.FollowingCharacter.Room != player.Room)) this.SetFollowMouse();
if (FloatToInt(this.Radius * 2.0) < 1) this.Radius = 0.5;
float r = this.Radius;
if (this.IsFollowingCharacter) {
if (this.ScaleBeam) r = r * (IntToFloat(this.FollowingCharacter.Scaling) / 100.0);
this.X = (this.FollowingCharacter.x - GetViewportX()) - FloatToInt(r);
ViewFrame *frame = Game.GetViewFrame(this.FollowingCharacter.View, this.FollowingCharacter.Loop, this.FollowingCharacter.Frame);
this.Y = ((this.FollowingCharacter.y - GetViewportY()) - (((Game.SpriteHeight[frame.Graphic] * this.FollowingCharacter.Scaling) / 100) / 2)) - FloatToInt(r);
}
else this.ScaleBeam = false;
if (this.IsFollowingMouse) {
this.X = mouse.x - FloatToInt(r);
this.Y = mouse.y - FloatToInt(r);
}
if (this.ScreenSprite != null) this.ScreenSprite.Delete();
this.ScreenSprite = null;
if (!this.Enabled) return;
this.ScreenSprite = DynamicSprite.CreateFromExistingSprite(this.BeamSprite.Graphic, true);
this.ScreenSprite.Resize(FloatToInt(r * 2.0), FloatToInt(r * 2.0));
this.ScreenSprite.ChangeCanvasSize(System.ViewportWidth, System.ViewportHeight, this.X, this.Y);
Flashlight_SpriteSurface = this.ScreenSprite.GetDrawingSurface();
Flashlight_SetColor(Flashlight.DrawingColor);
if (this.X > 0) Flashlight_DrawRectangle(0, 0, this.X, System.ViewportHeight);
if ((this.X + FloatToInt(r * 2.0)) < System.ViewportWidth) Flashlight_DrawRectangle(this.X + FloatToInt(r * 2.0), 0, System.ViewportWidth, System.ViewportHeight);
if (this.Y > 0) Flashlight_DrawRectangle(0, 0, System.ViewportWidth, this.Y);
if ((this.Y + FloatToInt(r * 2.0)) < System.ViewportHeight) Flashlight_DrawRectangle(0, this.Y + FloatToInt(r * 2.0), System.ViewportWidth, System.ViewportHeight);
Flashlight_SpriteSurface.Release();
Flashlight_SpriteSurface = null;
if (this.IsGUIMode) this.AGSGUI.BackgroundGraphic = this.ScreenSprite.Graphic;
else if (this.IsOverlayMode) this.AGSOverlay = Overlay.CreateGraphical(0, 0, this.ScreenSprite.Graphic, true);
}
function repeatedly_execute() {
Flashlight.Update();
}
function on_event(EventType event, int data) {
if (event == eEventEnterRoomBeforeFadein) Flashlight.Update();
}
Ich weiß, ich bin in dieser Hinsicht ein Erbsenzähler, aber wenn möglich, möchten wir doch wenn schon denn schon 100% erreichen und nicht irgendwo zwischen 85-90% bleiben.
BG
der Volltanker