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

#41
Well, if you typed or pasted
Code: ags
function room_AfterFadeIn() {
}

into the room script, the function won't run until you also put room_AfterFadeIn into the room events table.

What you usually do, like with all other events, is click the [...] button so AGS links and creates the function for you.
#42
Wait, are you sure the function runs at all? Because the objects' baselines seem to be correct, but if you forgot to link the after_fadein function, it would explain why the NPC is behind the sprite.
#43
You have a highres game, I'd try moving the baselines further apart. It's possible that AGS uses a lower resolution internally, and that for instance 807 and 808 end up being the same coordinate.
#44


I'm not seeing the individual sprites, the upper cage's bottom is part of which sprite? If you look at my post you can see that my first sprite is upper back wall, upper floor and lower bars, all of which are "in-between" the characters in a layers sense.

You can also use a different setup: the upper cage's top and the front and right bars of both cages will always cover both characters, so you can put them in a sprite and give that the lowest baseline. Then put just the upper cage's bottom in-between the characters.

(You should also use the before fadein event / room_Load function, or the baseline change will be visible in-game.)
#45
You cannot do that (linking a wb to a specific wa). Also, wbs cannot overlap.

A screenshot would help massively to solve this, but for now you can maybe solve this by using non-clickable objects instead?

You can also change the order in which characters/objects are drawn by AGS by setting baselines to specific values. Both characters and objects have a baseline property, and by manually setting them to suitable y-coordinates, you can specify exactly how the four things cover each other.
Simply setting the NPC's baseline and their bars' baseline to a value high enough should move them in front of the bottom cage.

Edit:


The sprites I used:


I picked a coordinate a few pixels below the bottom cage (205) and used that for the baseline of the left sprite's object, then set the hologram's baseline to 206 and the right sprite's object's to 207.
#46
Wordle 846 3/6

🟨⬜⬜🟨🟩
🟨⬜🟩⬜🟩
🟩🟩🟩🟩🟩
#47
The messages are set up in TemplateSettings.asc, starting at line 102. Did you change these, too?
#48
Once you override the default baseline, you need to pick the proper value. In this case somewhere around 800 or something.
AGS draws stuff back to front, but it has to know what's further back. So what actually determines the drawing order is the baseline of each object, or the 2D y coordinate where the 3D object meets the 3D ground (where its shadow would be at high noon).

So again, you put BaselineOverridden on "true", then enter a number like 800 as the Baseline. Also, if that part of the room will always appear behind everything else, then yes, just enter 1 as the baseline.
#49
Leaving BaselineOverridden at false means that AGS will use the y coordinate of the object, which is further down than the player's feet.
You need to set BaselineOverridden to true, then type the y coordinate into the Baseline field that appears.
#50
Here's a later version and example code that works fine with 3.6.0:
https://www.adventuregamestudio.co.uk/forums/beginners-technical-questions/graphicalfunctional-questions-for-cmi-style-guiinventorymenus/msg636639852/#msg636639852

Code: ags
int GotThere;
is not required (and wrong, it's a function).
You just import the module, then call the WalkFace() function.
#51
Alright, fixed the issues.

1. The main mouse cursor didn't have its hotspot at the center of the sprite
2. I changed the VerbCoin's main script according to your pre-made GUI requirements
3. you have VerbCoin.ButtonAutoDisable = true; in your setup in game_start, this disables buttons that don't have interactions; the plane's hotspots don't have any interactions set up, so the visible buttons were disabled
4. the GUI was cut off because it was still using the default radius and drawing a circle instead of using the background image and its dimensions; I fixed this in the code
5. the gVerbcoin buttons were missing their On_Click event handler, I had to put VerbCoinButton_OnClick in each button's event field so the click is forwarded to the module
6. I also added an unhandled_event function to the start of the module to handle the three custom cursor modes and put example code in there that distinguishes between mode and location type.

I'm going to send a PM with the fixed source.
#53
At this point it's probably easiest if you upload your game source somewhere and PM me the link so I can take a look.
#54
General Discussion / Re: Transparency in gimp
Thu 05/10/2023 08:04:50
Start with a new image, right-click the layer palette and create a new layer (it should be transparent by default).
Now right-click the background layer and delete it.
The background of your image should now show the checkered pattern representing transparency.

Note that unless you're using anti-aliasing, i.e. smooth brushes, you can leave the background a uniform color and make it transparent during importing the sprite into AGS.
#55
So have you changed the place_button function accordingly / removed the call from the RegisterButton function?

Plus it looks like the GUI is set to block the game? Can you check its visibility setting?
#56
You can debug your game by adding this to the room script (or just the eKeyB line to the existing global script function):

Code: ags
function on_key_press(eKeyCode k) {
  if (k == eKeyB) Display("Blink view is: %d", player.BlinkView);
}

Now you can press the B key to check the blink view any time the game is idle.
#57
Not sure if AGS can detect which type of controller is connected. Maybe you can determine it by axis/button count?
Anyway, you can also simply let the player select their controller type.

As for the GUI knowing which controller is connected: you simply pass along any required information when you call the function that displays the message. Like I said in my previous post, you can add arbitrary information to the ShowNotification call.
Maybe I don't really understand what you're asking?

Quote from: AndreasBlack on Wed 04/10/2023 12:17:03Should the gui function be called inside of the various controller code blocks?
Yes, you call the function whenever you want to show the notification GUI. If you want to show a notification that confirms a controller was detected, you have to call the notification function inside the code that detects the controller.
Just to clarify: the GUI function is essentially just a more sophisticated Display() command. But instead of Display("Controller detected"); you're calling your own function. It wouldn't be necessary for the Display function to "know" your game state, so why would this be an issue with your own notification function?
#58
You can add parameters to the function to pass along arbitrary additional info, like the GUI background.

Code: ags
  ShowNotification("PS4 controller detected!", 123); // 123 is slot of the PS4 background sprite 

Your function now looks like this:

Code: ags
function ShowNotification(String message, int bg_slot) {
  // setup
  gMessage.BackgroundGraphic = bg_slot;
  lblMessage.Text = message;
  // etc.
  // start tween and timer
}

You can also use an enum instead:
Code: ags
enum NotificationBG {
  eNotificationPS4 = 123,
  eNotificationXBox = 135,
};

If you add this to the header, you can replace int bg_slot with NotificationBG bg_slot and call the function like this:
Code: ags
  ShowNotification("PS4 controller detected!", eNotificationPS4);
#59
Sorry, the indentation is a mess. And if (inputName == "PS4 Controller") is not followed by a {} block, which works fine but is confusing to read.

First of all you need to decouple the controller code from your notice GUI.

1. write a function that will display a message, then add rep_exe code that removes it after some time has passed (use a timer that starts when the GUI is shown and remove it when it expires)

2. call the function and pass along your gamepad message, whatever it may be
#60
If anybody wants a BlueSky invite code, I have some. Just send me a PM :)
SMF spam blocked by CleanTalk