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 - Crimson Wizard

#461
Quote from: cat on Thu 27/02/2025 09:44:14I'm not familiar with this and a quick google search didn't help me either. What does this do?

I did not express this clearly, it's not a device feature but an AGS feature.
This is how it's configured:
https://adventuregamestudio.github.io/ags-manual/DefaultSetup.html#touch

And in config file:
Quote[touch] - touch input options
 - emul_mouse_mode = [string | integer] - touch-to-mouse emulation (whether touch input should emulate the mouse input and how):
   -- off (0) - disabled;
   -- one_finger (1) - one finger maps directly to left click;
   -- two_fingers (2) - tap 1 finger for left click, hold 1st finger and tap 2nd for right click, double tap 1 finger for drag mode.
 - emul_mouse_relative = [0; 1] - enable or disable relative emulated mouse movement.
#462
Quote from: Baguettator on Thu 27/02/2025 09:26:21The crash occurs after I click or press a key to exit the display function. Until that, the crash doesn't occur (don't know why, maybe because SaveGameSlot works at the end of the script..?).

Indeed, saving is done after the end of the script, because AGS cannot save inside a script function.

I will try the build...
#463
There was this feature suggestion open:
https://github.com/adventuregamestudio/ags/issues/2682

If someone could specify the list of information that is usually required, maybe we could come up with something in the future versions.

Quote from: cat on Thu 27/02/2025 08:58:07However, on touch devices, when moving the mouse in a continuous way, it must always be with mouse down. So as soon as the mouse coordinate changes without mouse down, it must be a non-touch device.

I think mouse coordinate changes without mouse down also happens with touch-to-mouse emulation, which is enabled by default on mobile devices, but also may be enabled on any other platform.

Quote from: cat on Thu 27/02/2025 09:20:25I really don't want to ask the user if they want to show a mouse cursor before they start playing.

Why not? That's not perfect, but seems like an acceptable trade off in the lack of a proper detection functionality.
#465
Quote from: cat on Wed 26/02/2025 20:55:13Digging up an old thread - is it possible to figure out if the web build of the game is running on a PC or a touch device?

Not possible using AGS own script.
#466
Quote from: qinzha on Wed 26/02/2025 16:57:47Ok where am I supposed to paste the code? Because if I paste it into the globals script and try to call it in the first room, it gives me the following error:

How to export global functions to the room scripts:
https://adventuregamestudio.github.io/ags-manual/ImportingFunctionsAndVariables.html

In this case following line has to be added to GlobalScript header:
Code: ags
import function TransferInventoryTo(this Character*, Character* other);
#467
There's no technical reason, this is only to make things logically consistent with the default inventory behavior.
#468
Quote from: Khris on Wed 26/02/2025 13:26:45On that note: why does the check exist in the first place? Why does AGS complain if you set a non-owned item as active?

Because it's illogical if player selects an item that the player character does not have.
#469
Quote from: Snarky on Wed 26/02/2025 12:30:46The easiest solution is to set InvWindow.CharacterToUse to one of the characters, and write the code to always refer to that character's inventory. Then it won't matter which character is currently set as player, you'll be using the same inventory regardless.

You will see same inventory, but you won't be able to select items in that inventory to ActiveInventory, because character cannot set ActiveInventory to something that they do not own.
#470
Quote from: Baguettator on Wed 26/02/2025 11:59:52I just got crashes each time I use the SaveGameSlot. For testing, I just used SaveGameSlot(1, "try"), and it crashes.

Here is the crash log :

https://drive.google.com/file/d/12ITmPlSQgarTUPnB3DvXWBJcD2Bt6fxA/view?usp=drive_link

This does not happen in a dummy game, so there have to be conditions under which this occurs.

The exception message like that means a mistake in the engine. 0xC0000094 specifically means "division by zero".

I cannot read the crash dump without the game exe which crashed, but also I would need to know which exact engine did you use, because I would need to use exact matching debug symbols for this.

Another variant for me is to have the crashing game (compiled game file) so that I could run it under debugger.
#471
I suppose that it's worth double checking following:
1. Which CharacterID is set on InventoryWindow. It should be either -1 for automatic player character selection, or explicit character matching your player character.
2. InventoryWindow's Visible is true.
3. Inventory Items have appropriate Image set for them.

EDIT: looking at screenshots, all 3 points seem to be correct.
Also at least 1 item have "Player starts with this item" set.
#472
Quote from: Rik_Vargard on Tue 25/02/2025 20:50:05Just a stupid question: Did you add
Code: ags
player.AddInventory (iYourItem); 
?

The topic starter said that
Quote(they are already set so the player has them from the start).
#473
Temp build available for download:
https://cirrus-ci.com/task/6353866658152448

Fixes:
- PositionMs not telling real position right after calling PlayFrom().
- Dynamic sprites not appearing on buttons after deleting and creating again.
- Buttons resized when assigning NormalGraphic = 0
(last two were reported for AGS 4, but apply to 3.6.2 too)
#474
Temp build for download:
https://cirrus-ci.com/task/5264924911337472

Fixed:
- Dynamic sprites not appearing on buttons after deleting and creating again.
- Buttons resized when assigning NormalGraphic = 0
- AudioChannel.PositionMs not telling real position right after calling PlayFrom() (this was reported for 3.6.2, but applies here too).
#475
Quote from: Baguettator on Tue 25/02/2025 13:42:37OK, so there is a problem for me. I have, in my sprites, the original bluecup (the one from the game template) as the sprite number 0. I can't delete it (it's unclickable when I right-click on it). Is it normal ?

Are you asking if it's normal that you cannot delete sprite 0? If so, then yes it's normal, because sprite 0 is used as a safety placeholder when the engine is told to draw any non-existing sprite.

Quote from: Baguettator on Tue 25/02/2025 13:42:37Is it possible to change something in the engine to avoid changing the size ?

That is a mistake and must be fixed.
From what I can tell, this is a very old bug which existed for many years.
#476
Quote from: Baguettator on Tue 25/02/2025 13:38:26If in script, I make button.NormalGraphic=0, it will have the sprite 0 as its graphic, and for me, it's the blue cup from AGS.

That is wrong, it should display a regular grey button instead. Also it should not resize.

EDIT: I tested this, and it seems to make them ordinary grey buttons, but resizes to a size of real sprite 0.
This behavior exists for a very long time. I tested down to AGS 3.6.0, but maybe it was there earlier.
#477
Quote from: Baguettator on Tue 25/02/2025 11:57:12Hmm OK, so it's not intended anymore that if I delete the dynamicsprite of a button, its graphic property will be reset to 0 ? It will remain like that for the future versions of AGS ?

Yes, it's intended now to keep exact value that you've assigned.

This is unrelated to the existing problem though, as the engine must still properly redraw an object if a new sprite was created and assigned, regardless of what was assigned earlier.
#478
Quote from: Baguettator on Tue 25/02/2025 08:34:37Yes but in the manual, it says that deleting a dynamicsprite that was given to an object (guicontrol etc...) resets its graphic to 0 to avoid problems. So it should be managed by the engine ?

This is an outdated information, it no longer changes to 0 since v3.6.1. The properties keep their value, and it's up to the user to fix them. Engine only ensures that the game will not crash if told to draw an object with missing sprite.
#479
Okay, I can confirm that this mistake is present since AGS 3.6.1.
Possibly this is because the Buttons are not redrawn if the recreated image number is the same as was on them earlier, because it cannot recognize that it is a different image. Although I cannot explain why the first button gets redrawn, maybe there's some accident.

Normally you are supposed to also set another NormalGraphic when you delete a dynamic sprite that was on a button.
Adding
Code: ags
gGui1.Controls[i+10].AsButton.NormalGraphic=0;
after the dynamic sprite is deleted will solve this problem.
#480
Quote from: greg on Tue 25/02/2025 03:56:57
Quote from: Crimson WizardWhen I test this, whether object has an automatic baseline by its position, or manually set baseline, if baseline is equal to walk-behind's, object appears on top. Please clarify how do you setup this scene?

Sure, here is the setup with screenshots.

No, I still cannot reproduce this. I make a room with objects "lying" on walkbehind, use your literal script where it sets equal baselines, and they show up on top.

Is there a way to test this exact room or the compiled game?
SMF spam blocked by CleanTalk