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

#1
Yes you're right. My tests are done on inventory item.

Thank you for your answer !

#2
Hello,

In the callback  on_mouse_click(MouseButton button)

I try to detect which button has been pressed:

Code: ags
switch(button) {
  case eMouseLeft:
    Display("left button");
    break;
  default:
    Display("unknown button: %d", button);
    break;

The problem is when i press left button, it's not seen as a eMouseLeft code.

The enum is described like this in the documentation:

Code: ags
enum MouseButton {
  eMouseLeft,
  eMouseRight,
  eMouseMiddle,
  eMouseLeftInv,
  eMouseMiddleInv,
  eMouseRightInv,
  eMouseWheelNorth,
  eMouseWheelSouth
};

So eMouseLeft must be 0 or 1 i think (depending the start index).

When i press the buttons of my mouse, it triggers the default branch in my switch/case.

I get those values from my display box:
left : 5
right : 6
middle : 7
wheel up : 8
wheel down : 9 (note the value greater than the number of values in the enum)

Well... i don't understand what happens.

Thank you.
#3
Thank you ! After a bit of experimentations, i finally manage this with your help.

The « challenge » for me was to returrn to the start room at the end, without cluttering event loop with tests and variables (like it_is_the_last_room_now_return).

Finally, i just added the start room at the end of the list, before the ending number
I'm doing this at game startup:

Code: ags
  int index_room = 0;
  int initial_room = player.Room;
  for (int i = 0; i < MAX_ROOM; i++) {
    if (Room.Exists(i))
    {
      /* Note: si cette boucle trouve des pièces qui n'existent pas ou plus, vérifier que
               le fichier CRM correspondant ne traine pas dans les fichiers du jeu.
               Ce problème ne concerne à priori que l'exécution directe avec F5 (pas l'exec avec le moteur).
               Ex: trouve un index de room 10, qui n'existe plus dans l'éditeur : effacer le fichier room10.crm
      */
      log(String.Format("room: %d exists", i));
      liste_room[index_room]=i;
      index_room = index_room+1;
    }
  } // i < MAX_ROOM ?
  liste_room[index_room] = initial_room; // retourne sur la première pièce
  index_room++;
  liste_room[index_room] = -1; // indique la dernière pièce
  index_parcours_room=index_room; // se place sur la dernière pièce
  log(String.Format("max rooms : %d", index_room));
 
#4
Hello,

In debug build, i'd like to gather objects in all the room to check some relations between them, in their custom properties.

As objects are linked to rooms, i have made a shortcut key which start the check in the AGS game loop. The check changes room, gather objects and repeat until last room is reached.

At game startup, i fill the array (liste_room[]) with all the rooms index (when there are no more rooms, i put -1 as a value to indicate it's over).

Then, the keyboard shortcut initializes ask_for_objects_testing boolean to true.

And in the function repeatedly_execute() , i've put

Code: ags
  if (ask_for_objects_testing == true) {
    int initial_room = player.Room;
    for (int i=0; liste_room[i]>=0; i++) {
      log(String.Format("parsing room: %d", liste_room[i]));
      player.ChangeRoom(liste_room[i]);
    }
    // go back to initial room
    player.ChangeRoom(initial_room);
  }

But it hangs at the second call of player.ChangeRoom

I get this error:

NewRoom : Cannot run this command since there was a NewRoom command already queued to run in "GlobalScript.asc

So i think it's related a re-entrance issue in the internal loop of AGS, but i don't know how to handle this.

Thank you.
#5
Excuse me, i hadn't seen your answer.

Thank you for the change, with scripts disabled on first-level domain (that is, this one) cookie div is hidden.

I've removed my rule for checking, of course.

As i think i will authorize scripts from this site (who knows what could be broken otherwise), i will just use my « cosmetic rule » for hiding cookie banner.
#6
Quote from: AGA on Thu 29/09/2022 00:07:01It works fine in Firefox on various Windows and Mac versions.  No idea what the issue is on Linux, but unless you can give me an idea of the actual issue there isn't much I can do!  Do you see any errors in the developer console or networks tab?

I have looked at debug console, but didn't found any related errors/warning (just a warning about cookies Cookie "ct_prev_referer" does not have a proper "SameSite" attribute value , seems related to youtube css so doesn't concern my issue).

As it's working properly with chrome, i believe some obscure problem on my side with my addons.
I've just made a rule in uBlock for zapping the DIV element, and it's gone.
I was asking just in case someone else had this issue.
#7
As a Firefox user (v102, Linux) : I cannot close the banner for agreeing use of cookies.
(no × item to close it).

It is always here and doesn't disappear when i click on a subject or a sub-forum.

I've tested with Chromium and it's ok : i have the × mark to close the windows.

I have disabled uBlock and uMatrix extensions (thinking may be the closing-cross was coming from the outer-banned-space), with no changes.

I worst case, a rule in uMatrix will hide the banner, but hey. May be there are cleaner solutions.

Thank you.
#8
Nice gfx.

On the right screen, did you managed to make a scrolling map ? Or is it a room ? (may be a big room with scrolling camera :) )
#9
I've tried it, and found it funny to play. It's not bland and generic jokes , but rather ironical dialogs and situations. There is an atmosphere.

The graphics are ok for the moment. I don't have have seen many because i died quickly without saving. I'm too lazy to restart all for now.

So my pro-tip is : save often because it seems you die often (the death was deserved btw, never touch all you see in this kind of old-school game).

Anyway i will restart because it's a good game.
SMF spam blocked by CleanTalk