Here's the relevant part of the script, with my addition starting at the "&&" on line 8:
Here's the complete code from the global script, if anyone would like to test it on their end:
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
Quote from: timid_dolphin on 22 Nov 2021, 19:26Hey, timid_dolphin. I like the sound of this approach for the organization and streamlined scripting, but I'm a little unclear on how to set up the custom properties (i.e., what to set as the type and value, etc.). Are you simply setting the type to "number" and the value to the number of the appropriate view?
Ok, so here's how it works:
first you need to go into the character editor and add a custom property to the schema for your alternate views, eg angryView. For each character you can initialise this in the character editor with the view you want to use.
Quote from: timid_dolphin on 17 Nov 2021, 04:45Yeah, something like that is what I had in mind for the mood views. Did you just put all of the called functions in your global script or did you create a new script for all of them?
I've got a bunch of general mood functions in a script file with all of my little character animations.
So all of the logic around changing character views is encapsulated in these, and they can be easily called from anywhere in the script, or within dialogue scripts.
PAUL: Hey, wait a second...
PAUL: That guy didn't pay for those bananas!
PAUL: Oh well...
Quote from: Khris on 12 Nov 2021, 08:22Thanks, Khris! And if I wanted to have the foot-tapping happen less frequently than the blinking (say, between every four blinking animations)? Maybe just set a counter within the randomized blinking code that would trigger the foot-tapping instead? Seems fairly straightforward.
For a second idle view you can use
in that case, this will play either view randomly.
Quote from: Cassiebsg on 12 Nov 2021, 16:05Thank you for the suggestion, Cassiebsg, but I was sure to double and triple-check and re-assign the sprites again, but the error still occurred. I'm thinking it's either something else in my scripts throwing it off, the idle view not honoring diagonal directions, or indeed a bug, as Khris said.
Make sure that all the sprites are in the correct loop.
On my latest game I had a "bug" that was driving me nuts, as my character was facing the wrong way on a single view/loop, and I couldn't figure out why. After several days trying to fix it, I looked at the sprites and noticed that I had a single wrong sprite in that exact loop.
Not saying it's your case, but just make sure.
Quote from: Khris on 11 Nov 2021, 23:27The animations don't have to occur independently. The foot tapping (or whatever else) can happen between blinking animations by itself, either at specific intervals or randomly too. Thoughts on how best to approach that? Another timer within the function we already created, perhaps?
You mean like the character is both tapping their foot and blinking, independently? That's much harder because AGS doesn't really support animating the head and body separately the way the Lucasfilm games did. It's possible somehow but can't be achieved with just a few lines of code unfortunately.
Quote from: Crimson Wizard on 24 Oct 2021, 22:09To be fair, that part of the function was a direct copy-paste from the manual section about region functions, although I understood it on a basic level.
... but you seem to already had experience with that as you have "region" in your code.
Quote from: Crimson Wizard on 24 Oct 2021, 07:22Yeah, that didn't seem right. Initially, I had it under "repeatedly_execute", but through my trial and error it eventually ended up under "room_Load" and just stayed there until I came to ask for help.
Your first code snippet (one with room_Load) does not make much sense, you only test a region under the mouse cursor once at the room load, what if the mouse is not over the region at that time? Then the variable is never set.
Quote from: Khris on 08 Oct 2021, 08:14I have a function that calls it when the save GUI is opened from my main options GUI:
How and when are you (re-)populating the list of save games?
Quote from: Gilbert on 08 Oct 2021, 10:44The function starting at line 3 of the script in my OP sets the bool to true when the player makes a selection in the list box, confirmed by a "1" display-check of the bool.
1. I guess that slot_selected somehow is never set to true, so the false path is always chosen in the if-else if group. (So apart from just checking only the selected index in a Display() you may also check this bool variable.)
Quote from: Gilbert on 08 Oct 2021, 10:44I had actually tried it both ways, to the same result, but I've set it back to "+1" in light of Crimson Wizard's note, which I had not gleaned from the part in the scripting tutorial about the "++" shortcut.
2. The ItemCount property of a listbos is readonly so you should not write something like "lstSaveList.ItemCount ++". Instead that related line should be SaveGameSlot(lstSaveList.ItemCount +1, tbSaveName.Text); in order to save to a new slot.
When you repopulate the listbox the next time the ItemCount will be updated correspondingly.
Quote from: Gilbert on 08 Oct 2021, 10:44With nothing in the list selected, the save gets saved to a new slot, as expected. It's only when an existing slot (any slot) is selected that the top slot (and only the top slot) gets overwritten.
If this is the case, though, it would also overwrite the same existing slot if you do not choose any slot in the list. Have you checked that too?