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 - GlaDOSik

#1
Of course it is possible. Make an empty room with proper GUI and buttons. Make your views with different sprites. Than use code player.ChangeView(int view); for change the view as you want.
#2
Modules, Plugins & Tools / MODULE: RGB filter
Sat 28/12/2013 20:28:25
This module makes very nice effect of an old computer screen. But it's pretty slow, so it's recommended to use it on smaller pictures. How to use it?

- download RGBfilter.zip
- in project tree, right click on Scripts, choose Import script... and choose RGBfilter.scm
- in RGBfilter.ash is written everything you need to know
- still don't know what to do? Open the tutorial project.
- yes, you can use it and modify it as you want

Updates:
- parameter ColorFilter is added to the function RGBfilterRenderer. It allows you to suppress colors you want. There is an opportunity to design really cool puzzles based on filtering colors. Tutorial is updated.





DOWNLOAD (source and demo)

You can try executable demo:
Download
#3
So that's why it doesn't work. I need to move Tween script up in project tree. Thanks Ghost for clarification.
#4
This Tween module is very useful. But is it possible to use tweens (for ex. on GUI) elsewhere than in room script? Like in my function in my own script and then call that function from room? I'm writing custom GUI and I don't want to copy GUI function in every single room.
#5
Oh. It looks I have a really bad habit.
#6
Ups. Sorry, my mistake. I messed up the name of variable. It should be this way:

if (LibraryMode >= 4)
LibraryMode = 0;
else
LibraryMode ++;

Now it has to work. I recommend not to use SetGlobalInt. If you want to use global variable, just put the declaration in your script header (.ash), like this:

int myGlobalVariable;

Then, you can in your room script change the value in normal way like this:

myGlobalVariable = 5;
#7
Too complitaded. Try this in your button code:

if (LibraryControls >= 4)
LibraryControls  = 0;
else
LibraryControls++;
#8
Advanced Technical Forum / Fonts and FontForge
Wed 11/12/2013 22:51:36
Hi,

I know. Another topic about fonts. This character limit is killing me. My question is simple. How to find out in FontForge, which characters AGS uses? I know it's first 255. But when you open this font: http://www.fontsquirrel.com/fonts/Caviar-Dreams - character with number 165 is this Â¥, but AGS shows unknow character (this one Ã,, has number 272 and it shows correctly) so I guess that numbering doesn't match.
#9
Khris: Well, the idea is to render GUI, mouse cursor and NPS directly into DynamicSprite.

Crimson Wizard: His filters are nice, but aren't they only for DirectDraw? I find, that a lot of people have problems with DD. Also, I'm able to simulate noise and line offset so I can degrade the screen. And I think it would be good part of gameplay. Do you know game called Experience 112? My idea is similar. Player can control different cameras, door locks, lights, alarm systems etc. And NPC would react to that. And differet cameras could have different parameters and quality of signal. I could even design some puzzles, where you have to properly set your camera (turn off colors and have black and white screen, filter red/green/blue). So that's why I working on my own solution. But it started on "am I able to make RGB filter?". The game and gameplay is now secondary.
#10
Well, the game code will render the game graphics into the buffer (dynamic sprite 160x100 px). Then this buffer will go through this RGB filter and result will have lo-fi effect (example is in attachment). I can't pre-render all backgrounds at start, because I want to use the effect on whole screen (GUI, background, animated character).

Code: ags
https://www.dropbox.com/s/nkl0uip6frvoqfs/SDE.zip
#11
Thanks. So the sprite limit applies on dynamic sprites too. I completely forgot about that.

Khris: That's exactly what I made first time. I only pre-calculate rgb values and store them in array. Each cycle I rendered all 16000 pixels. But that was heavy. It has about 12 fps. Then I use this dynamic sprite array but I render and store the pixel only when it wasn't in array. So after one cycle, it just load pixel sprites from this array. I store only colors from few sprites so I didn't exceed sprite limit. That was much better though. About 30 fps. But that solution wasn't good for animations, because new pictures have new colors that wasn't in array. And then I came to this "pre-render all colors" which can't work because of this limit.

I also store pre-rendered sprites on disk (SaveToFile) but that was the worst thing. 0,5 fps. It looks that the best thing would be draw game graphic in limited color palette.
#12
Hi,

I'm working in AGS on RGB filter. It uses GetPixel on small sprite (160x100) and then render images (16000) made of 3 colors like pixel on monitor does. It uses 2 functions. The first one iterates through all AGS colors (0-65535), separets RGB colors, renders dynamic sprites (pixels) and save them into the dynamic sprite array. And here is the problem and I can't find the solution. It looks like my function works to number 29998. All above that (29999-65535) throws null pointer error. Code is here:

Code: ags

function initScreenRen(){                    //initScreenRen() is called once in room_AfterFadeIn()
  
  int pixelCounter;                         //pixel counter
  pixelImg = DynamicSprite.Create(3, 3);    //creates dynamic sprite for pixel 3x3 px
  
 while (pixelCounter <= 65535){                     //iterates through all AGS colours and makes pixels for them
  
  bool highBit = true;                              //AGS color to RGB
  if (pixelCounter > 65535) pixelCounter -= 65536;
  rgb[0] = ((pixelCounter >> 11) & 31) << 3;
  rgb[1] = ((pixelCounter >> 6) & 31) << 3;
  rgb[2] = (pixelCounter & 31) << 3;
  if (highBit)
  {
    rgb[0] = rgb[0] | 7;
    rgb[1] = rgb[1] | 3;
    rgb[2] = rgb[2] | 7;                            //end AGS color to RGB
  }

 DrawingSurface *pixelSurface = pixelImg.GetDrawingSurface();               //draw subpixels into pixelImg      //CO KDYBYCHOM VYKRESLOVALI PŠ˜àMO DO BANKY PIXELŠ®?
    pixelSurface.DrawingColor = Game.GetColorFromRGB(rgb[0], 0, 0);
      pixelSurface.DrawLine(0, 0, 0, 2);
    pixelSurface.DrawingColor = Game.GetColorFromRGB(0, rgb[1], 0);
      pixelSurface.DrawLine(1, 0, 1, 2);
    pixelSurface.DrawingColor = Game.GetColorFromRGB(4, 4, rgb[2]);          //end draw subpixels into pixelmg 
      pixelSurface.DrawLine(2, 0, 2, 2);
  pixelSurface.Release();    
  
  pixelBank[pixelCounter] = DynamicSprite.CreateFromExistingSprite(pixelImg.Graphic);     //move pixelIMG to array of dynamic sprites pixelBank 
  
  pixelCounter++;           //iterates the color to 65535
 }
 
  object[0].Graphic = pixelBank[29999].Graphic;   //null pointer? why? it iterates to 65535
  }


Header is here:

Code: ags

DynamicSprite *pixelBank[65536];
DynamicSprite *pixelImg;
int rgb[3];
import function initScreenRen();


Any help is appreciated. Thanks.
#13
Critics' Lounge / Re: cave / castle background
Sun 16/12/2012 23:54:39
Sometimes, you really want to have right perspective. But on these pictures... I like the wacky stairs. It's part of your style. From these two, I like the first one. If you spend more time on that, it could look really good.
#14
Critics' Lounge / Re: Lunar Landing
Sun 04/11/2012 09:32:46
If the panel won't fit the screen, don't split it. You can set the arrow keys to move the screen. Something like: if (IsKeyPress == eKeyUpArrow) SetViewport(GetViewportX, GetViewportY - 5);
I like the keyboard control, but prefer mouse control a little bit more.
SMF spam blocked by CleanTalk