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

#341
I've seen this before, but haven't played around with it yet. Looks awesome.
#342
Hacks aka workarounds  ;)
#343
One last question:

Currently when switching palette, all the sprites are switch from palette over the whole game, while only the current room background is switched.
It would be nice if I don't need to switch the palette for the background each time the player enters another room...

So:
Is it - outside the 'workaround' option of using an object and sprite as background - somehow possible to let the backgrounds act as being set 'gamewise' instead of 'background'?
I do need to keep the first 4 slots being set as background and the second set of 4 slots as being gamewide to avoid the sprites black color not switching correctly.


#344
Finally I got it working!

When the sprites and the backgrounds all use the same 4-color palette one would think to setup the ags colour panel palette to be used for both the sprites and backgrounds, having only 4 slots needed for the 4 game colors.
But ags colour slot #0 (which must be black) seems to be problematic for sprites but works fine for backgrounds when switching its color codewise.
So you'll end up having 2 sets of identical slots color-wise, the first set is set to background, the 2nd one is set to gamewide.
(i had these 2 sets set up the other way around. which works fine except for slot #0 not changing for the sprites)
So slots #0-3 set to background and (for example) slots #16-19 set to gamewide in combination with importing the sprites using RemapToGamePalette = yes was the solution.
(of course code-wise you'll need to switch the background and the sprites separated since they are 2 sets now instead of 1)

So, to sum it all up:

  • File - Preferences: Remap palette of room backgrounds into allocated background palette slots (8-bit games only) = unchecked
  • colour-panel: slot #16-#19 are set to gamewide,
  • colour-panel: slot #0-3 are set to background,
  • colour-panel: both slot sets use the exact same colors (black, cyan, magenta, white)
  • sprite import - RemapToGamePalette = yes
  • sprite import - RemapToRoomPalette = no
  • sprite import - the tranparent color can be anything, it has obviously no influence for the colour panel layout
  • code: run UpdatePalette for bot slot sets

Result:
(switched from cga palette to game boy palette)
#345
I tried this the other way around, starting with the gameboy palette, sprites and bg. Switching to cga works fine but switching back to gb fails showing pure black instead of dark green. So yes, it seems black or slot#0 is the problem. I just don't understand how to tackle this. I read Gilbert's tutorial but  I still can't find the solution... It looks so simple, just four colors, but i have no clue that the true problem is...
#346
I'm utterly confused now, nothing seem to work.  8-0

I'm still not able to switch the black sprite color for the objects to dark green (using UpdatePalette), and importing sprites using "remap palette" set to "no" messes up some sprites...
It seems I have to give up on it, i just can't seem to get it to work correctly.

Some info
slot 0-4 are set as 'gamewide' colourtype, using the following colours:
slot 0: 0, 0, 0
slot 1: 84, 252, 252
slot 2: 252, 84, 252
slot 3: 252, 252, 252

slot 16-19 are set as 'background' colourtype, using the following colours (the same as the 4 gamewide colors):
slot 32: 0, 0, 0
slot 33: 84, 252, 252
slot 34: 252, 84, 252
slot 35: 252, 252, 252

all other slots are unused, I've set them to black (0,0,0) and to background.

when importing the sprite (the one shown in the upper righthand corner of the screenshot in my previous post) using these settings:
import options:
-import alpha channel: no
-remap palette: no
-use room background: no
Transparant colour:
-bottom-right pixel (which is 84, 84, 252)

it got its colours messed up.

importing and imported the object#1 sprite (messed up):


importing and imported the object#2 sprite (imports correctly):


colours are setup like this:


room in editor with object#1 sprite having messed up colors and object#2 showing correctly):


running the UpdatePalette, still black background instead of GB 'darkgreen' (should be 4,14,4 as in values from 0 to 63 or 15,56,15 values from 0 to 255):
#347
Well, I tried but I'm still failing to update the black colour of the object-sprites...

1. in file>preferences, option 'remap palette of room bg into allocated background palette slots': no
2. in colours panel :

slot 0-4 are set as 'background' colourtype, using the following colours:
slot 0: 0, 0, 0
slot 1: 84, 252, 252
slot 2: 252, 84, 252
slot 3: 252, 252, 252

slot 32-35 are set as 'gamewide' colourtype, using the (same) following colours:
slot 32: 0, 0, 0
slot 33: 84, 252, 252
slot 34: 252, 84, 252
slot 35: 252, 252, 252

3. object sprite has been imported using the following options:
import options:
-import alpha channel: no
-remap palette: yes
-use room background: no
Transparant colour:
-bottom-right pixel (which is 84, 84, 252)

(the room's object sprite and background both contain the same 4 cga colors as shown in the 4 color slots of ags' colours panel, see link to both files in bottom of post)

4. running the palette update, the 4 colours of the background do change correctly, but the object sprite's black color is not changing:
Spoiler

Code: ags

//room background:
  //black
  palette[0].r = 4;
  palette[0].g = 14;
  palette[0].b = 4;
  
  //cyan:
  palette[1].r = 12;
  palette[1].g = 24;
  palette[1].b = 12;
  
  //magenta:
  palette[2].r = 34;
  palette[2].g = 42;
  palette[2].b = 4;
  
  //white
  palette[3].r = 38;
  palette[3].g = 46;
  palette[3].b = 4;
  
  //objects:
  //black:
  palette[32].r = 4;
  palette[32].g = 14;
  palette[32].b = 4;
  
  //cyan:
  palette[33].r = 12;
  palette[33].g = 24;
  palette[33].b = 12;
  
  //magenta:
  palette[34].r = 34;
  palette[34].g = 42;
  palette[34].b = 4;
  
  //white
  palette[35].r = 38;
  palette[35].g = 46;
  palette[35].b = 4;

  UpdatePalette();

[close]

Result:


Here's the original (cga-colors) background and the object sprites:
https://dam1976.home.xs4all.nl/AGS/curse/BG.png
https://dam1976.home.xs4all.nl/AGS/curse/object1.png
https://dam1976.home.xs4all.nl/AGS/curse/object2.png
#348
Thanx for responding, will try that!
I've seen some more quirks indeed, all seem to be related to entry #0...
#349
So I have a 4-colour game with 8-bit colour depth in 320x420 resolution and in the game setup the software driver is set as graphics driver.
But for some (unknow to me) reason the object sprite's black color isn't updating after updating the palette codewise.
The same black in the room's background is correctly updating though...
I hope someone can explain this tpo me, I can't figure out why it works correctly for the room bg but not for object sprite...

This is the colours setting panel:
Spoiler
[close]

Here's an object's sprite seting:
Spoiler
[close]

Here's the room background and the object with said sprite:
Spoiler
[close]

when running this to update the palette to game boy colors:
Spoiler

Code: ags

  //black
  palette[0].r = 4;
  palette[0].g = 14;
  palette[0].b = 4;
  
  //cyan:
  palette[1].r = 12;
  palette[1].g = 24;
  palette[1].b = 12;
  
  //magenta:
  palette[2].r = 34;
  palette[2].g = 42;
  palette[2].b = 4;
  
 //white
  palette[3].r = 38;
  palette[3].g = 46;
  palette[3].b = 4;

  UpdatePalette();

[close]

This is how it looks, for some reason the object's black color is not changing...
It has the same black (sprite-wise) as the background... (the black color of the gate is also not changing correctly, which is another object)
Spoiler
[close]
#350
Ok, that does make sense, thanx.
#351
On top of my local script I have the following struct:
Spoiler

Code: ags

struct PaletteCycle
{
  String system;
  String game;
  String Year;
  int palette0r;
  int palette0g;
  int palette0b;
  int palette1r;
  int palette1g;
  int palette1b;
  int palette2r;
  int palette2g;
  int palette2b;
  int palette3r;
  int palette3g;
  int palette3b;
  bool UsedForCycle;
};

PaletteCycle palettecycles[60];

[close]

The room_AfterFadeIn first calls a function declaring the arrays (from 0 to 59), followed by calling the select_random_palette function (which randomly selects one of the 60 not yet selected palette, updates this palette, waits x time, and rerun the function until all 60 palettes has been chosen.
if a palette has been selected, the bool UsedForCycle is set to true and the function is called again.

Here's the looping select_random_palette function:

Spoiler

Code: ags

function select_random_palette()
{
  if (ranPaletteTotal < 60)
  {
    ranPalette=Random(59);
    
    if (palettecycles[ranPalette].UsedForCycle == true)
    {
      select_random_palette();
    }
    else if (palettecycles[ranPalette].UsedForCycle == false)
    {
      ranPaletteTotal++;
      palettecycles[ranPalette].UsedForCycle = true;
      
      Lamountpalettes.Text = String.Format("palettes shown: %d", ranPaletteTotal);
      
      palette[0].r = palettecycles[ranPalette].palette0r;
      palette[0].g = palettecycles[ranPalette].palette0g;
      palette[0].b = palettecycles[ranPalette].palette0b;
      
      palette[1].r = palettecycles[ranPalette].palette1r;
      palette[1].g = palettecycles[ranPalette].palette1g;
      palette[1].b = palettecycles[ranPalette].palette1b;
      
      palette[2].r = palettecycles[ranPalette].palette2r;
      palette[2].g = palettecycles[ranPalette].palette2g;
      palette[2].b = palettecycles[ranPalette].palette2b;
      
      palette[3].r = palettecycles[ranPalette].palette3r;
      palette[3].g = palettecycles[ranPalette].palette3g;
      palette[3].b = palettecycles[ranPalette].palette3b;
      
      UpdatePalette();
      Wait (10);//waittimecycle
      
      select_random_palette();
    }
  }
  else if (ranPaletteTotal == 60)
  {
    SetTimer (1, 300);
    SetTimer (2, 60);
    return;
  }
}

[close]

The select_random_palette function works fine until for some reason it gets a 'call stack overflow' error, usually somewhere between the 30th and 40th palette update (out of the 60 palettes)...
When it happens, the line highlighted in the editor is one of the two "select_random_palette();" lines in the select_random_palette function

The full error msg:
Error running function 'room_AfterFadeIn':
Error: call stack overflow, recursive call problem?


I can't seem to figure out why this is happening, any idea anyone?
#352
This man weighs 100 pounds, plus half his weight.
Means he weight half his weight, plus half his weight.
Means 100, plus 100.
#353
Fuck Quest 1 WT:

Spoiler

enter your home
open desk drawer
get Brad Pitt Mask
Exit your home
go 1x east
enter mart
get guitar.
Exit the mart
go 5x east
get flower
Go 1x west
give flower to girl
play guitar
wear mask
fuck girl
follow girl to her home
fuck girl (select a position and use arrow keys to fuck)
<end>
[close]
#354
Impressive intro scene, love the four masks (assuming these are masks)
#355
Congratulations on the release, gonna play this one soon.
And welcome to the forums  :)
#356
Quote from: Crimson Wizard on Thu 25/06/2020 11:43:30
I wonder if "X direction" mean coordinates, actual mathematical direction (vector), words like LEFT, RIGHT,etc or just hotspot name, like "Walk to Table"?
mmhh... could be indeed. I assumed it was about coordinates. if it isn't about them, my example is also misunderstood  ;)
#357
Quote from: santitassara on Thu 25/06/2020 01:22:04
i want my label to show "walk to X direction" when the walk to button is clicked .

Slashers example shows the player coordinates constantly while walking, I think he misunderstood your question.
I think your looking for something like this:

in this example, the gui has a textlabel called L_WTD.

Now, in your Global script edit the existing eMouseLeft part of the function on_mouse_click(MouseButton button) function.
Make it like this:

Code: ags

function on_mouse_click(MouseButton button) {
  // called when a mouse button is clicked. button is either LEFT or RIGHT
  if (IsGamePaused()) 
  {
    // Game is paused, so do nothing (ie. don't allow mouse click)
  }
  else if (button == eMouseLeft) 
  {
    if (mouse.Mode==eModeWalkTo)
    {
      String wtt = String.Format ("walk to %d, %d direction", mouse.x, mouse.y);
      WTx = mouse.x;
      WTy = mouse.y;
      L_WTD.Text = wtt;
    }
  }
  ...
}


Optionally, to clear the label text once the player has reached the clicked coordinates, add this line in the rep. execute in your global script
Code: ags

function repeatedly_execute() {
  if ((player.x == WTx) && (player.y == WTy)) L_WTDo.Text = "";
  ...
}
:

Finally, on top of your global script add:
Code: ags

// main global script file
int WTx;
int WTy;


#358
Quote from: Dannymac247 on Thu 25/06/2020 00:09:32
As to the issue of the game autoclicking through dialogue, I've never seen anything like it. May be an AGS issue, rather than a game issue, but I'll keep an eye out for it.

Quote from: Shadow1000 on Thu 25/06/2020 01:05:15
is it possible that you ALT + TABBED while playing, then came back to the game to trigger this?
Confirmed it is alt-tab that triggers this isue.

---
@Dannymac247:
Use sandwitch on string: missing response
#359
Quote from: Crimson Wizard on Wed 24/06/2020 14:42:13
COLOR_63 = COLOR_255 * 63 / 255
Yep, that does the trick. Thank you!
#360
Nice list!
SMF spam blocked by CleanTalk