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

#441
AGS processes both events. For instance when you click something with the interact cursor, it calls the function linked to the interact event, then the one linked to the any click event.

If the function gets called twice, my guess is it's linked twice?
#442
You can open the broken .agf file with an editor like VS Code and check the XML structure. My guess is that you somehow ended up with two character folders of the same name.

The relevant section starts like this:

Code: xml
  <Characters>
    <CharacterFolder Name="Main">
#443
Add
Code: ags
  Display(playerSequence);
as the first line in your CheckPassword function.
What does it show?

Also note that you can do this:
Code: ags
function keypad_Click() {
  Object* o = Object.GetAtScreenXY(mouse.x, mouse.y);
  if (o == null) return;
  playerSequence = playerSequence.AppendChar('0' + o.ID); // make sure each object ID matches its digit
  aAkeypad.Play();
}

Now paste keypad_Click into each digit button object's event table.
#444
You don't to need use the lookat event. You can call Character.GetAtScreenXY(mouse.x, mouse.y) to find the clicked character and simply set your pointer variable directly.

#445
If an announcement GUI can get turned on while another one is still on screen, you'll need a separate timer for each one, yes.
However you do not need to use the built-in timers, you can simply count frames in repeatedly_execute instead (i.e. use variables).

I also doubt you need 20 GUIs for this; to show a graphic (or text) on screen you have various other methods available (like GUI buttons, or graphic overlays).

What is on these GUIs? Just text?

Anyway, I'd create a queue mechanism where each announcement is added when it happens and displayed at the top, pushing previous announcements down the screen. Inside rep_exe, the frame counters of visible announcements are advanced and the buttons / overlays removed when they expire.
#446
Are you properly locking the view before manually animating the character?
Can you show the code that causes the error?

Also, I'd place the front-facing idle sprites into the other three loops of your idle view for now; a good rule of thumb to avoid frame related errors is to put at least two frames in each of the first four loops for all views that are used as normal, speech or idle view.
#447
Is it possible that the laptop is running the 32bit-Version of Windows 10?
#448
Importing the function in the header is only necessary if you want to be able to call it from a room script. Which suggests you're putting this function call into every single interaction.

My approach will call the function whenever you click somewhere with an active inventory item, then run the actual interaction, if one exists, which means you don't have to put the same line a dozen times into each room script.

Also note that the (largely unrelated) code from your first post can be shortened considerably by simply doing
Code: ags
  if (type == 3) {
    // ...
  }
There's no need to test the value of what, and even if there were, you could do what >= 1 && what <= 5 instead.
#449
@lapsking
I wrote a small module: https://drive.google.com/file/d/1AEWB7w4JCiFGLTAKxtfDrrKqaW34KINM/view?usp=sharing

Add tracks in game_start:
Code: ags
  MusicPlayer.AddTrack(aEddie_Vedder___No_Ceiling);
  MusicPlayer.AddTrack(aRodriguez___Forget_It);

Then add this function to your global script (or add the relevant code if it already exists):
Code: ags
function on_event(EventType event, int data) {
  if (event == eEventEnterRoomBeforeFadein) {
    if (player.Room >= 12 && player.Room <= 20) MusicPlayer.Play();
    else MusicPlayer.Pause();
  }
}
#450
Generic behavior can be added to the global on_mouse_click:

Code: ags
  // inside on_mouse_click
  if (mouse.Mode == eModeUseinv) {
    int x = Mouse.x, y = Mouse.y;
    PlayInteractAnimation(player.ActiveInventory); // call custom function
    Room.ProcessClick(x, y, eModeUseinv);
  }

This code will not work as-is, it requires a function to actually animate the character further up in the script, like this:

Code: ags
function PlayInteractAnimation(InventoryItem* item) {
  player.FaceDirection(eDirectionDown);
  player.ChangeView(...);
  // etc..
}
#451
Yeah, I was afraid of that. This should definitely work:
Code: ags
  if (anyGUIControl != null && anyGUIControl.AsButton != null)
#452
Code: ags
  if (anyGUIControl && anyGUIControl.AsButton)
#453
@Custerly Well, properly unlocking the view means after the animation is done, so if you do it right after running a non-blocking animate command then it will indeed produce what you described (i.e. nix the animation).

Animating characters non-blocking during a dialog should work fine in principle; locking the view means that AGS will no longer switch to the appropriate view itself based on what's happening with the character (walking, talking, etc), so as long as it's the same view for all character frames, it's probably safe to call UnlockView() only after the dialog ends.
#454
Resetting a button to displaying text should work by setting its .NormalGraphic to 0, but I haven't tested this.

That is weird, people use non-blocking animations all the time without issue. You do have a frame delay of 1 in your code, but that should still not run the entire animation in a single frame.

One reason would be your game graphics, which I don't think require 4k at all. You have a fairly lowres background, a portrait with visible pixels and even for the font, Full HD should easily suffice.
There is no reason to go for the max resolution unless you actually require that level of detail, especially on a "legacy" engine like AGS.
#455
I see, but the default Sierra UI uses a right-click to switch to the next cursor mode, which seems also fine.

The question really is: what is the goal here?
Is it to allow the user to switch back to interact mode without having to move the cursor to a button (or right-click three times)?
You could implement a hotkey, since the other hand typically doesn't really do anything in a mouse-driven interface anyway.

This seems a bit like an xy problem.
#456
Sorry, can't help it. GC/TERF losers speedrunning the patriarchy is my favorite tweet genre

#457
You should turn the buttons invisible instead of assigning transparent sprites to them.

As for the animation, you should be able to put all these frames into a single loop, that way you can have a single non-blocking animation.
It's also possible to run non-blocking commands in sequence but it requires a bunch of additional code (basically implementing a custom queue).

(Also, your game resolution is 4k? Seems excessive.)
#458
I don't think this is a good solution from an UX perspective. Games usually give a more or less generic reply instead, like "That doesn't work." Also, if you're stuck and just want to try clicking various items on interactive areas it's really annoying if you have to keep having to select an item over and over again.
It sounds like your UI is similar to the BASS one, why not use a right-click to deselect an inventory item? That's also much easier to implement.
#459
Wordle 939 4/6

⬜⬜⬜🟩⬜
🟨⬜🟨⬜⬜
🟩🟨⬜🟩⬜
🟩🟩🟩🟩🟩
#460
It should work out of the box. I tried to run my 3.6.0 Sierra test game and it worked fine.

If you haven't already, compile the Game in AGS by pressing F7. Do not save the game after this because it will delete the .exe again!

Now add a game to ScummVM and pick [game folder]/Compiled/Windows as the folder to add. You might get a compatibility message, just click "Add anyway".
SMF spam blocked by CleanTalk