Menu

Show posts

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

Messages - Junkface

#1
Thanks, I played around with your code a bit but that doesn't actually seem to be the source of the problem - though led to me figuring it out. It seems that my deleting the dynamic sprite is the issue - this leads to the new dynamic sprite being created in the same slot as the old one (i.e. with the same graphic int), which seems to be result in the engine not realising that the new sprite is different. Easy enough to work around - I just created another DynamicSprite pointing to the old sprite and wait to delete it after the new one has been created. Thanks for the help, regardless.
#2
I've been having some issues where if I attempt to resize a character's current frame as a dynamic sprite it doesn't actually update onscreen. Here's the code I'm using:

Code: ags
void  CorrectSize(this  Character*)
{
  ViewFrame *CharacterFrame=Game.GetViewFrame(this.View, this.Loop, this.Frame);
  if(CloudsNew[this.ID].Sprite!=null)
  {
    CloudsNew[this.ID].Sprite.Delete();
  }
  CloudsNew[this.ID].Sprite=DynamicSprite.CreateFromExistingSprite(CloudsNew[this.ID].FromGraphic, true);
  CloudsNew[this.ID].Sprite.Resize(CloudsNew[this.ID].Width, CloudsNew[this.ID].Height);
  CharacterFrame.Graphic=CloudsNew[this.ID].Sprite.Graphic;
}

Hopefully, that's not too confusing - cloudsnew is just a struct where I'm storing all the extra variables relating to my character extender functions. If I add a line setting an object's graphic to CharacterFrame.Graphic the object graphic does change as I'd expect (so the frame itself is being resized correctly), but the character remains unchanged. Strangely, if I use a drawing surface on the dynamic sprite, then the character will update, but not otherwise. Is there some command I should be running in order for the character to update its graphic? I'm using CustomRes build 3.3.0, if that's relevant.

Thanks, and apologies if I'm missing something silly.
#3
I'm using the 3.3.0 CustomRes version. In the help file under Alpha blended sprites it states
QuoteNOTE: Currently, alpha blended sprites cannot be antialiased, so if you have the Anti Alias Sprites option turned on in Setup, it will not be applied to alpha-blended characters.

After some more experimentation I think this is actually correct; when using a sprite with an alpha channel it seems to ignore the "Smooth scaled sprites" checkbox and it is scaled in a way that appears identical to how dynamic sprites are scaled. The alpha channel does seem to scale correctly, and I don't get any black outlines. I'm still not sure why the smooth-scaling/anti-aliasing seems to introduce black outlines, but switching to using 32-bit sprites and alpha channels instead is an easy solution.

Thanks for your help, everyone.
#4
Thanks, but, to clarify my question is in regards to the scaling AGS does itself (which if I'm reading the documentation correctly won't work with sprites that have an alpha channel). Is there a way to get this scaling to blend smoothly to the background, or am I stuck with dark edges?
#5
I'm toying with converting my game from 8-bit to 16-bit, largely for the sake of smooth scaled sprites, and am getting black edges around the sprites (as though fading to a black background):


Is this the result of not having an alpha channel and unavoidable, or am I doing something stupid?

Thanks.
#6
Spoiler
The speed is intended to change based on the player, i.e. incomprehensibly fast if the mouse is moved as normal, more contemplative if the player wants.
[close]
The meaning, I was aiming to be somewhat ambiguous and should arise from the imagery and quotes rather than from a coherent narrative - it's possible that if you don't take a clear meaning from the game this is a failing of the imagery and structure I've chosen, or at least that they may be suited to a quite limited audience.

Thanks for the honest and thoughtful response.
#7
That's odd - I have a laptop with a fairly small screen myself and the game should only need 640x400. If you're getting an error message and the game not even launching, perhaps check that "Graphics Driver" is set as "DirectDraw 5" (it's 8-bit so likely won't work in Direct3D) and that "Graphics filter" is either "None" or "Max nearest-neighbour filter". If, instead the game is launching but the graphics are distorted, try selecting "Force alternate letterbox resolution" under "Advanced". I expect one of those options will resolve it, otherwise, worst case scenario, you could try running it in a window.

I hope the game proves worthy of your interest.:)
#8
Haha, I was aiming to have a visceral effect but not quite like that. :smiley:
#9
Completed Game Announcements / Like A Dream
Sun 25/05/2014 13:09:18

I've made a short game about the twentieth century and the broken promises of modernism and the machine age. It's designed to rely more on mood and imagery than puzzles, but I've tried to design it to be fairly responsive to player input, while maintaining the sense of inevitability of a dream.

It can be downloaded from here.

Thanks to all those who've responded to my queries on the technical forums.

Any feedback on the game would be appreciated.
#10
Thanks for the quick reply and suggestion. I'm glad to know it's not caused by my doing something wrong. I'll have to think about how to best work-around it in my game.
#11
I'm getting an instant of blackness when changing rooms. Transition is set to instant. I thought perhaps I had too much going on in the room_Load() functions but am having the same issue in a newly created, almost empty game. Increasing colour depth resolves things, but my game is quite reliant on palette effects. Can anyone suggest a solution or is this a known issue I have to learn to accept?

Thanks.
#12
Ah, for some reason it hadn't occurred to me that I should treat dynamic sprites like the other variables - I feel quite silly  now. Thanks for the help.
#13
Hi,

I'm making a game where I want to use dynamic sprites to change the appearance of objects a lot. I was hoping to do this with one function to create a different dynamic sprite for all the objects and other functions to then manipulate the dynamic sprite associated with whatever individual object is being worked with later, i.e. something like this (with [SceneryCurrent] representing the ID of the object being worked with):

Code: ags

scale[SceneryCurrent] = DynamicSprite.CreateFromExistingSprite(object[SceneryCurrent].Graphic); 
object[SceneryCurrent].Graphic=scale[SceneryCurrent].Graphic;


Code: ags

scale[SceneryCurrent].Resize(FloatToInt(SpriteSizeX[SceneryCurrent]), FloatToInt(SpriteSizeY[SceneryCurrent]));


scale0, scale1, scale2, etc are already defined as dynamic sprites in the global variables section but when I try to compile I get the error "Undefined token 'scale' ". Is there some means of working with dynamic sprites in the way I'm attempting or will I need to resort to something like:

Code: ags

if(SceneryCurrent==1){
  scale1.Resize(FloatToInt(SpriteSizeX[SceneryCurrent]), FloatToInt(SpriteSizeY[SceneryCurrent]));
}

if(SceneryCurrent==2){
  scale2.Resize(FloatToInt(SpriteSizeX[SceneryCurrent]), FloatToInt(SpriteSizeY[SceneryCurrent]));
}


I hope that's at least somewhat clear and would appreciate any advice anyone can give.

Thanks.
SMF spam blocked by CleanTalk