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

#1
Thanks to both of you!

Khris, you saved me again, thank you so much, also for the bonus of providing the string scripting stuff!
Global Variables working just fine :-D
#2
Hi,

I have a few events that give my player special skills. Later in the game, I want to check whether or not the player already acquired this skill. Knowing the very basics about them, I would like to do this via custom properties. In particular, I wonder how to script the following scenario:

  • Player acquires Skill C => add the letter C to my custom TextProperty "Skills" without deleting whatever else may already be written there (because the player may have already acquired skills A, B and D)
  • Player needs Skill C to progress => check if the letter C is part of the custom TextProperty "Skills" even though it might not be the only content of the TextProperty (because the player may have already acquired skills A, B and D)

I have the feeling there might be some solution using the basic scripting operators but I can't quite put my finger on it.

I further hope I made myself clear engough. Any help is greatly appreciated :)
#3
Quote from: Crimson Wizard on Wed 18/10/2023 00:03:01Playing 2 animations at the same time would require to call the first Animate with eNoBlock.

Code: ags
    // replace with your real object names and view names
    oFirstObject.SetView(VANIMATION1);
    oAnotherObject.SetView(VANIMATION2);
    oFirstObject.Animate(0, eOnce, eNoBlock);
    oAnotherObject.Animate(0, eOnce, eBlock);

This will schedule first animation and immediately continue to the next command.

I do recommend using scriptnames for objects and views instead of their indexes, as that's safer and less prone to errors.

Thank you both! The eNoBlock option was the thing i was missing, thank you so much, Crimson! Working as intended now :)
#4
Hey,

I'm wondering if there is a way to animate two objects in one room at the same time. I have two object animations that work fine by themselves and when played one after the other, but I'd like them to play at the same time, is this possible? I realize this probably is a really basic scripting question.

Thanks in advance for any help! :)
#5
Good Lord, I really forgot doing that. Just tried and that did the trick. Thank you so much, I would have never guessed that it was down to that... Thanks a lot!
#6
I'm not sure what you mean by linking the function I'm afraid, I used the code mentioned earlier in the room script. It's not unlikely at all that I'm missing something codewise tho..  :X
#7
Tried it with 50px between the chars and objects, didn't change anything... I'll try the option with the cage top in a separate sprite next.
#8
The upper cage's bottom part is part of the lower sprite, as in your example. The back parts of both cages are part of the background and do not belong to the sprites.

Thanks for the other hints aswell.
#9
Hey Khris,

thanks so much for your help! I somehow didn't now about character baselines before.
Your solution is working fine for the cages themselves and the player character in the lower one, but I seem to be missing something for the NPC in the upper one. It is correctly covered by the upper cage's bars but is also hidden behind the upper cage's floor (which is part of the sprite for the lower cage, as shown in your post).  I can't get it to overlap the cage floor... Here are the settings I used:

My background graphic is 1200 x 800 px.
I set the characters' baselines in the room script:

Code: ags
function room_AfterFadeIn ()
{ cUpperNPC.Baseline = 809;
cLowerPlayer.Baseline = 807; 

The lower cage object's baseline is set at 808, the upper cage's at 810.
#10
Hey,

I am facing the following problem: I have a scene in a prison with one "cage" stacket on top of each other. The player char will be in the lower cage, an NPC in the upper one. I have thus created one walkable area for each cage and one set of walkbehinds (for the iron bars) for each cage. Since the two cages are stacked on each other, the walkbehinds are overlapping which breaks my room :(

I am now wondering if there is a way to link walkbehind no. 1 to walkable area 1, so that only characters on walkable area 1 will be affected by walkbehind 1, and only that.

Thank you in advance, I haven't been able to find an answer since now.
#11
Thank u so much, to the two of you! The "custom say" solution works great for my requirements, Snarky!

I do allow myself to ask another question, for the sake of wrapping my head around it and only if u still feel like explaining :)

With "custom say function" activated, everything the characters say is correctly combined with the relevant audio clip, with one exception: the dialog option that is on the left side of the dialog window and not written directly inside the dialog script. I know that u don't necessarily want that to be spoken by the characters and that I can simply copy it into the script so as to make the custom dialog script apply, but I was wondering if there might be another sleek way of doing it with some code.   

As I said, this is just for my understanding and I'm perfectly happy with the workaround that consists of copying the dialog option into the actual script. Again, thank u guys a lot! 
#12
Just tested ur suggestions, working just fine! Thank u a lot!

I do have one followup question: Is there be a similar way of dealing with this for dialogues? Since they are based on the regular cCharacter.Say command (if I understood things correctly), the solution above does not apply to them. Would it be possible to modify the standard dialogue system so as to use your SayBlip command and work in the same way?
#13
Thank u a lot, that sounds exactly like what I need!
I'll have a look at the other thread as soon as I get to it, thank u so much!
#14
Hey there,

I'm trying to add audio files when my characters are speaking and I have two questions regarding this:

1) I'm trying to get one audio file per character to play every time they're speaking. Is there a way to code that once so that I don't have to put in the same audio file manually every time my characters say something?

2) Is there a way to un-link the display duration of the speech text from the length of the audio file? I'm using a few short audio blips for every time my characters talk (as in Stardew Valley for example), so my audio file is pretty short. I noticed that the displayed text disappears as soon as the audio file finished playing, which is way to fast most of the time. Is there a way to make the display duration of the text indepent from the audio playback duration?

I hope I've been clear enough in my explanations. Thank u so much in advance!
#15
UPDATE:

Recreated my game from the template and it now seems to work. Apparently, I started my first try from a blank file so I was missing some essential code. Sorry for the trouble!
#16
Thanks for ur answer!

The ItemHeight and Width parameters are both set to the size of my sprite.

The only other GUI I have at this point is a text window UI that seems to be working as it should, so that does not seem to be it.

Finally, in "repeatedly execute", I had the following function i found in an effort to solve the problem:

Code: ags
 InventoryItem *item = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
if (item != null)
    item.RunInteraction(mouse.Mode); 


Deleting it didn't seem to change anything, neither to the better nor the worse.
#17
Hey there,

I'm a newbie on AGS and I know this topic has already been discussed quite a few times, but I still haven't been able to find a solution in the forum.

My problem is this: I have an inventory bar in my game and items seem to be added correctly to it. However, I am unable to click on the item in my inventory and consequently, unable to use it on objects or hotspots in my room.

I doublechecked and all the "clickable" and "enabled"-parameters of both the inventory GUI and the inventory window where my items appear are set to "true".

I also enabled "Override built-in inventory window click handling" in general settings, heaving read that this might be a solution. I also made sure that my inventory window is big enough to accomodate my item's sprites.

Still, none of this has worked so far and I can't seem to find the problem. Any help would be greatly appreciated!
SMF spam blocked by CleanTalk