Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: bx83 on Wed 27/06/2018 08:48:21

Title: How to do .IsInteractionAvailable for a Character ???
Post by: bx83 on Wed 27/06/2018 08:48:21
As usual, a tiny point which baffles me.

When I use the mouse, the cursor changes it's icon (eg. notalk to talk, no interact to interact etc) if it's above something with an InteractionMode of eTalk, eInteract etc. - eg:


...
    else if (mouse.Mode==eModeInteract) { //INTERACTION
newGraphic = 2;  //interact off
        Hotspot *hs = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
if (hs != hotspot[0]) {
    if (hs.IsInteractionAvailable(eModeInteract)) {
newGraphic=286;    //interact on
    }
}
...


But for characters, there's no cCharacter.IsInteractionAvailable function.
Could you give me an alternative? Is there one?

There *is* a cCharacter.RunInteraction(eModeWhatever), but this just... runs a charater mode :/  --It doesn't return true/false if there *is* a character mode.
Title: Re: How to do .IsInteractionAvailable for a Character ???
Post by: Crimson Wizard on Wed 27/06/2018 08:54:35
Quote from: bx83 on Wed 27/06/2018 08:48:21
But for characters, there's no cCharacter.IsInteractionAvailable function.

There should be Character.IsInteractionAvailable.
Did you try using one? Or maybe it is not appearing in autocomplete? What version of AGS are you using?
Here's an article from the manual: http://www.adventuregamestudio.co.uk/manual/ags47.htm#Character.IsInteractionAvailable
Title: Re: How to do .IsInteractionAvailable for a Character ???
Post by: Khris on Wed 27/06/2018 10:18:39
Just to confirm this: it exists. It pops up in auto-complete just fine. It compiles fine. (since AGS 3.4.0)
Title: Re: How to do .IsInteractionAvailable for a Character ???
Post by: bx83 on Wed 27/06/2018 11:17:29
Why is it not part of the manual 'functions and properties' wiki page?
Character functions and properties (http://www.adventuregamestudio.co.uk/wiki/Character_functions_and_properties)

Anyway, yes it was an editor bug where it didn't come up autolmatically :P All works.
Title: Re: How to do .IsInteractionAvailable for a Character ???
Post by: Crimson Wizard on Wed 27/06/2018 11:20:51
Quote from: bx83 on Wed 27/06/2018 11:17:29
Why is it not part of the manual 'functions and properties' wiki page?
Character functions and properties (http://www.adventuregamestudio.co.uk/wiki/Character_functions_and_properties)

Wiki pages are 10 years old, no one is maintaining it. There is even a warning on the top of the page, telling that it's outdated (perhaps it is not made distinct enough).

The manual that comes with AGS Editor is the one that is guaranteed to be up to date.
The actual online manual is this: http://www.adventuregamestudio.co.uk/manual/
Title: Re: How to do .IsInteractionAvailable for a Character ???
Post by: Khris on Wed 27/06/2018 11:55:25
Quote from: bx83 on Wed 27/06/2018 11:17:29Anyway, yes it was an editor bug where it didn't come up autolmatically :P
The script editor doesn't always 100% recognize new pointers/variables while typing, so occasionally you have to blur and refocus the script window for autocomplete to work. But in that case the window doesn't show up at all. Are you saying you got an autocomplete window with all the properties and functions except for IsInteractionAvailable()...?