How to do .IsInteractionAvailable for a Character ???

Started by bx83, Wed 27/06/2018 08:48:21

Previous topic - Next topic

bx83

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:

Code: ags

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

Crimson Wizard

#1
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

Khris

Just to confirm this: it exists. It pops up in auto-complete just fine. It compiles fine. (since AGS 3.4.0)

bx83

Why is it not part of the manual 'functions and properties' wiki page?
Character functions and properties

Anyway, yes it was an editor bug where it didn't come up autolmatically :P All works.

Crimson Wizard

#4
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

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/

Khris

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()...?

SMF spam blocked by CleanTalk