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

#361
Alright, this was simple after all! I really appreciated all the help you gave me! :)
Best regards once again!


:EDIT:
So now, for the slider listbox I have something like this.
Code: ags

void UpdateSliderListbox()
{
  // calculate how many rows of inv items are going to be hidden
  int hiddenRows = (ListBox1.ItemCount - ListBox1.RowCount);
  if (hiddenRows > 0) 
  {
    SliderListBox1.Max = hiddenRows;
    SliderListBox1.Enabled = true;
  }
  else SliderListBox1.Enabled = false;
}

I am calling this function on game_start!


On slider change I have something like this:
Code: ags

ListBox1.TopItem  = (SliderListBox1.Max - SliderListBox1.Value) * ListBox1.ItemCount; 


But when I try to test it (moving the slider) I get this message.
ListBox1SetTopItem: tried to set top to beyond top or bottom of list
I am not sure how to fix it at all.
#362
Hi Khris, I am sorry because sometimes I am a fool. I was testing your code with the debug command (give all inventory items, which I was sure that your code were calling properly since you have done the code in on_event adding or losing an item) and pretending that to work good. However I have test it properly throught the game and of course, it is working as I wish! You have done an exellent work as usual. Thank you very much! :)

Please, if you don't mind, I would like to ask you a couple of questions more. I have two buttons which (on_click) it is called properly (InventoryWindow.ScrollUp/ScrollDown) When I do that, can I adjust the slider value as we are doing at the moment? So if I move the slider or click the buttons it will be the same thing? Also, can I do exactly all of this for a listbox too? 
#363
Yes of course, I have it in this way.



Your code is working perfectly.
I just wish that when I move the slider his movement should be accorded with how many items there are in the inventory window. I wish that if I reach the min value of the slider I should reach the last items in the inventory window and viceversa (otherwhise the slider shouldn't be able to scroll).

At the moment, when I reach more or less the centre of the slider value I see the latest items and if I continue to move the slider down it keep scrolling. (But in this way it's not working very well because when I reach the latest items more or less at the centre value of the slider then I am able to keep scrolling the items and the inventory window look empty) :(
#364
Hi Khris, I would like to say that this is working perfectly now! :-D
Thank you very much once again.

There is one essential thing that is not working properly yet as I wish.
At the moment, I reach the end of all the items when the slider is more or less at the centre.
I would like to reach the end of the items when the slider is at min value, and viceversa the top item would be at max of the slider (just like it is working right now) It is possible to do something like this?
#365
Hi Khris, thanks a lot for answering.
Well, somehow this is working but in a very strange way.
When I first move a little the slider to the down side all items disappears, if I keep moving the slider to the down side (and I reach the min value of the slider) then it scroll all the items per row but somehow it make the scroll in reverse.
#366
Good Evening to all AGSer.

So I have an inventory window (78x156) that can display 12 items before that a vertical slider is showed. My intention would be to scroll the inventory items by a single row with the vertical slider when changing. But I am having some issues about how to according the slider value (max and min) with how many items the inventory window can display. So to achieve the slider movement to be adjusted with how many items the inventory window can display?
#367
Well, I will try to explain... I was testing this game and try to make a lightlevel for a region, when I notice that doesn't seems to get any effect of the light on the character. Lately I found out that the game was set to be in 16bit colors as their graphics (imported) too. So I thought that was the reason why the lightlevel of the region was not working... So I decide to switch everything to 32 bit color but the lightlevel of the region still doesn't work (so I thought that maybe ags still react as the game was setted to be in 16bit color... supposely, however, the light level of the region should work also in 16bit color right?) Also, who is making the graphics of the game say that the quality it's too low (in 16bit color) from what he did originally. But when I re imported the graphics in 32 bit color now the quality it's look like the same... (as it is still set to be 16bit color?)


EDIT: I SOLVE IT BY OPENING A NEW PROJECT PROPERLY AND SET AT FIRST START IN 32 BITCOLOR!
#368
Hello to all Agser!

One of my friend started a project in 16bit color and imported the graphics as 16bit color. Now, I switch to 32 bit colors and re imported the graphics in 32bit color (and room background depth color too). But now no matter what, it seems like ags react as it is set to 16 bit color? What should I do now?
#369
What about the price?
#370
Jesus, you are right. (facepalm) Thanks once again for the hint ! :-[
#371
Crimson Wizard, first of all, I would like to thank you very much as usual!
Secondly, the way I was making this before was totally wrong and that's the reason why I couldn't get it to work well. However, this is what I have done now (I had to make some minor changes because there was something wrong):

Code: ags

// main global script file

function game_start() 
{
  RoomTransitionLeft = DynamicSprite.Create(System.ViewportWidth / 2, System.ViewportHeight);
  RoomTransitionRight = DynamicSprite.Create(System.ViewportWidth / 2, System.ViewportHeight);
}

void SaveRoomScreen()
{
  if (PreviousRoomScreen)
  PreviousRoomScreen.Delete(); // delete previous one, if there was any
  PreviousRoomScreen = DynamicSprite.CreateFromBackground();
}


void AssignRoomScreen(Object* o_left, Object *o_right)
{
  if (PreviousRoomScreen == null) return; // no screen saved (yet?)
  // First draw parts of previous room screen upon the two transition sprites.
  DrawingSurface *ds = RoomTransitionLeft.GetDrawingSurface();
  ds.DrawImage(0, 0, PreviousRoomScreen.Graphic); //here
  ds.Release();
  DrawingSurface *dss = RoomTransitionRight.GetDrawingSurface();
  dss.DrawImage(-160, 0, PreviousRoomScreen.Graphic); //here (I could not get it to work by doing "-System.ViewportWidth" for some strange reason?
  dss.Release();
 
  // Now assign these sprites to objects:
  o_left.Graphic = RoomTransitionLeft.Graphic;
  o_right.Graphic = RoomTransitionRight.Graphic;
}


function ScreenTransition()
{
  if (object[0].X > -Room.LeftEdge) return;
  object[0].X-=7;
  if (object[1].X < -Room.RightEdge) return;
  object[1].X+=7;
  
  if (object[1].X >= Room.RightEdge &&
      object[0].X <= Room.LeftEdge) trans = false;
}

function repeatedly_execute() 
{
  if (trans)
  {
    ScreenTransition();
  }
}



// room script 1
Code: ags

function room_Load()
{
  SaveRoomScreen();
}

function hHotspot1_Interact()
{
  player.ChangeRoom(2);
}



// room script 2
Code: ags

function room_Load()
{
  AssignRoomScreen(oLeftSide, oRightSide);
  trans = true;
}


And, HOLY HELL!!! :-D
This is working perfectly now as I wished, thank you very much! :)

Regarding your suggestion to use GUI or GUI BUTTONS is totally fine, Although I could create a template of the room with those objects set in place. I am truly happy now that this is working very well and of course I don't need to edit the background with some program and to import them as sprites.

Still best regards as usual Crimson Wizard!
#372
Okay, somehow I managed to make it work but not as I wish (by using Dynamic Sprite and Create from Screenshot).
When I do that my objects (oLeftSide and oRightSide) take the graphic from the screenshot just done, but then suddenly their graphics become all black? It is something that I am doing wrong of course.
Later I have edit the background graphic to Gimp so to save as image the left and the right side of the background.
I have imported the graphics and place them into my objects properly and then I have done something like this on script:

// main global script file
Code: ags

function ScreenTransition()
{
  if (object[0].X > -Room.LeftEdge) return;
  object[0].X-=7;
  if (object[1].X < -Room.RightEdge) return;
  object[1].X+=7;
  
  if (object[1].X >= Room.RightEdge && object[0].X <= Room.LeftEdge) trans = false;
}

function repeatedly_execute() 
{
  if (trans)
  {
    ScreenTransition();
  }
}



// room 1 script file
Code: ags

function hHotspot1_Interact()
{
  player.ChangeRoom(2);
}



// room 2 script file (the objects graphics here are already set to be the left and right side from the room background 1, so when the player change room to here it is showed the two objects with the graphics of the previous background)
Code: ags

function room_Load()
{
  trans = true;
}


It is working very well but I really would like to avoid this method because I don't want to edit each background anytime as left and right side separately and then to import them as I have done here.
I would like to do that directly in AGS, but somehow I am having hard times.
#373
Hello Crimson Wizard, thanks for the quick response.
What you say make sense. I am going to try out this workaround, hopefully to make it work well.

#374
Good evening to all AGSer!

I'd like to ask to some of you how to make a custom screen transition properly.
More specifically, a screen transition how it's showed in this video.
The example is shown when the video reaches 4 minutes and 37 seconds (more or less).
https://www.youtube.com/watch?v=XksUf7DOHWE

At the top of my head, I image this is like the background was split halfway to separate the center of the image. So to have a left and right sides of the background separated. Then move them to the corresponding edge of the screen, so the left side moves to the left edge and vice versa for the right side. So it is like an "opened window" transition of the screen. But I am not pretty sure how to do this properly? (roll)
Could anyone give me some good advice on how to do this so far?
#375
I think you can try to switch player.Walk(625, 125); to player.Walk(625, 125, eBlock); and see if that works, otherwhise you will have to move the code from function first_load to room_AfterFadeIn after player walk in eBlock style. Or you could simply do something like this.

Code: ags

function room_AfterFadeIn()
{
  player.Walk(625, 125, eBlock);
  if (Game.DoOnceOnly("StartCutscene"))
  {
    player.SayAt(625, 125, 100, "Momento.");
    player.FaceDirection(eDirectionRight);
    player.FaceDirection(eDirectionLeft);
    player.FaceDirection(eDirectionDown);
    player.Say("Si este es el capitulo uno...");
    player.Say("¿Que chucha llevo haciendo todo este rato?");
  }
}
#376
Okay, I think I understand everything and I will try to keep these info in mind!
So... I have downloaded this newest version of the plugin and...
DEAR LORD, THIS IS WORKING LIKE A CHARM NOW!!! :-D
I really can't believe the hardest work you have done here and the time you spent to fix this issue! :)
Still thank you very much, I really much appreciated your help once again!!! :)
#377
Fantastic, I am really much HAPPY to hear this news from you! :)
It's ok about using extra check like the valid function, maybe it should be something like this?
Code: ags

function on_event (EventType event, int data) 
{
  if (event == eEventRestoreGame)
  {
    if (joy == null || (!joy.Valid()))
    {
      // do stuff
    }
  }
}


Most likely however, there will need something else in the code that will have to do with your updates in the plugin I guess. I am not sure about this, but it would be amazing if you could even show me a safe way to use a code in the function on_event? That's just to be to the safe side.

Best regards!
#378
Quote from: Monsieur OUXX on Sat 26/08/2017 15:45:16
Do you still get the error when you restore a saved game while there is no joystick plugged?

Yes, I have just done to test this, what do you think I've tried until now?! :)

Quote from: Monsieur OUXX on Sat 26/08/2017 15:45:16
If yes, then, while Wyz might be working on it (you're a lucky AGSer having a plugin author look specifically into your issue! ;) ), you can extremely easily do what was suggested earlier, both by the plugin's manual (even though not explained in detail) and by Crimson Wizard: just before calling the RestoreSavedGame, check if there is a joystick plugged. If not, then display a message and do not call RestoreSavedGame

Yes, you are right, I feel much lucky about this indeed!
I can not thank enough Wyz that he's giving me an help on this issue, really.
About what CW and Snarky suggest before it's just fine but I really would like to avoid this (if possible).
I mean if a joystick it's not plugged anymore (in a previous savestate that it was plugged in) then the plugin should turn off or something alike to prevent this issue and the game will keep running normally (not sure if this is possible at the moment, it sound like a twisted logic of mine).
#379
I was confident that everything would go well but unfortunately I get the same error (or almost).
I notice that this time the error it's slightly different from the first one that I got a couple of days ago.

This is how the newest error looks like:
An exception 0xC0000005 occured in ACWIN.EXE at EIP = 0x70441082 ; program pointer is +2051, ACI version 3.21.1115, gtags (123,2)

And the old one was like this:
An exception 0xC0000005 occured in ACWIN.EXE at EIP = 0x62151082 ; program pointer is +2051, ACI version 3.21.1115, gtags (123,2)


:EDIT:
I have done this process once again and I get another different error!? (not sure if it is important or not?!)
An exception 0xC0000005 occured in ACWIN.EXE at EIP = 0x6F8B18B0 ; program pointer is +2051, ACI version 3.21.1115, gtags (123,2)
#380
First of all I would like to say thank you very much for the time you spent to do this fix.
I really much appreciated! I just hope it will work fine. :)
I am going to download this newest version and let you know as soon as possible, still thank you very much!
SMF spam blocked by CleanTalk