Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: birenbergg on Fri 16/03/2018 16:17:29

Title: Features question
Post by: birenbergg on Fri 16/03/2018 16:17:29
Hi, all. I have a few questions.

Is there a way to:


EDIT: 1 & 2 is about dynamically/programmatically changing, of course :)

Thanks a lot for your answers! :)
Title: Re: Features question
Post by: Cassiebsg on Fri 16/03/2018 16:54:16
To answer your questions:

1. Yes
2. Yes
3. Yes
4. Yes (I think)
5. Not from the get go (as in 1 button solution, but there's a thread on the forum on how to build to iOS)
Title: Re: Features question
Post by: Crimson Wizard on Fri 16/03/2018 17:50:33
Cassiebsg answers like a real programmer: if the question was "is there", the answer is either yes or no (laugh)
Title: Re: Features question
Post by: birenbergg on Fri 16/03/2018 17:58:01
That looks promising! :)
Can you please direct me to the appropriate threads? I searched the forums before asking that question, but didn't find solutions.
Title: Re: Features question
Post by: Cassiebsg on Sat 17/03/2018 08:35:55
Sure, open the Manual (it's provided with every single copy of AGS under Help).

Search for:
1. Hotspot
2. Inventory Item
3. StartCutscene / StopCutscene
4. See point 3 + timers
5. http://www.adventuregamestudio.co.uk/forums/index.php?topic=52219

And last but not least: https://www.youtube.com/view_play_list?p=21DB402CB4DAEAEF <-- higly recomended to see it right NOW!
Title: Re: Features question
Post by: birenbergg on Sat 17/03/2018 08:41:19
Quote from: Cassiebsg on Sat 17/03/2018 08:35:55
Sure, open the Manual (it's provided with every single copy of AGS under Help).

Search for:
1. Hotspot
2. Inventory Item
3. StartCutscene / StopCutscene
4. See point 3 + timers

I'll check this out, thanks!

Quote from: Cassiebsg on Sat 17/03/2018 08:35:55
5. http://www.adventuregamestudio.co.uk/forums/index.php?topic=52219

Hmm, my question about Mac, not iOS. ???

Quote from: Cassiebsg on Sat 17/03/2018 08:35:55
And last but not least: https://www.youtube.com/view_play_list?p=21DB402CB4DAEAEF <-- higly recomended to see it right NOW!

Thanks, but I already watched it. Several times :)
Title: Re: Features question
Post by: Cassiebsg on Sat 17/03/2018 08:46:59
Well, sorry then. I though iOS was Mac's OS... so then I don't know.

If you have watched it, then you need to be more specific with the questions (if you can't find the answer in the Manual).
Title: Re: Features question
Post by: birenbergg on Sat 17/03/2018 08:49:28
Quote from: Cassiebsg on Sat 17/03/2018 08:46:59
Well, sorry then. I though iOS was Mac's OS... so then I don't know.

If you have watched it, then you need to be more specific with the questions (if you can't find the answer in the Manual).

Let me check the manual and let you know.
Title: Re: Features question
Post by: Snarky on Sat 17/03/2018 09:52:20
There might be ways to build AGS games natively for MacOS, but by far the easiest thing is to run them under Wine/Wineskin.
Title: Re: Features question
Post by: birenbergg on Fri 23/03/2018 09:32:47
Quote from: Snarky on Sat 17/03/2018 09:52:20
There might be ways to build AGS games natively for MacOS, but by far the easiest thing is to run them under Wine/Wineskin.

How do games like Blackwell can be played on mac? Is it some Steam's feature?
Title: Re: Features question
Post by: Crimson Wizard on Fri 23/03/2018 10:06:32
Quote from: birenbergg on Fri 23/03/2018 09:32:47
Quote from: Snarky on Sat 17/03/2018 09:52:20
There might be ways to build AGS games natively for MacOS, but by far the easiest thing is to run them under Wine/Wineskin.

How do games like Blackwell can be played on mac? Is it some Steam's feature?

There is a Mac port of the engine, but afaik it requires certain work to be done by a technically skilled person to actually build game for Mac. I am not even sure if there are instructions around anymore. I think best chance is to contact Wadjet Eye and ask them for this information.

Also, regarding iOS, there was a post by Janet Gilbert: http://www.adventuregamestudio.co.uk/forums/index.php?topic=52219.0
Title: Re: Features question
Post by: birenbergg on Fri 23/03/2018 10:06:54
So, my question about Hotspot's description should have gone like this:

In my game I use the LucasArts template.
Right now, when I hover over a hotspot called "box" the text in Action Line changes from "Walk to" to "Walk to box", etc.
I want to handle the following situation: the player looks at the box and says something like "it's a wooden box". Then I want the description of this hotspot to change to "wooden box", so that when we hover over it again the text would be "Walk to wooden box".
Unfortunately, a hotspot's description (it also refers as Name sometimes) is read-only :( (for years, by the way, and many people asked to change it).

----

So, my solution was:

1. I've added a custom property I called AtlName (type is Text, default value is empty string, applies to whatever you want)
2. Now, there's a built-in function called Game.GetLocationName which indicated an entity (hotspot, object, etc.) we hover over and returns its Name. In the LucasArts template this Name is eventually placed inside a text shown in Action Line, when we hover over a hotspot.
3. The above happens in guiscript in function called CheckDefaultAction in this line:

Code (ags) Select
location = GetLocationName(x, y);

4. What wee need to do is expand the GetLocationName function and replace it.

Code (ags) Select

    //location = Game.GetLocationName(x, y);
    location = CUSTOM_GetLocationName(x, y);


5. The custom function I wrote goes like this (I placed it in the same script file):

Code (ags) Select
String CUSTOM_GetLocationName(int x, int y)
{
    if (GetLocationType(x, y) == eLocationHotspot) // Make sure we hover over a hostspot
    {
        Hotspot* h = Hotspot.GetAtScreenXY(x, y); // Get the hotspot itself
       
        if (h.GetTextProperty("AltName") == "") // If the hotspot has an empty alternative name
        {
            return Game.GetLocationName(x, y); // Just use the default name
        }
        else
        {
            return h.GetTextProperty("AltName"); // Otherwise use the alt name
        }
    }
    else
    {
        return Game.GetLocationName(x, y);
    }
}


6. And of course to remind you how we set the atlname property:


function hBox_AnyClick()
{   
    if(UsedAction(eGA_LookAt)) {
        player.Say("It's a wooden box.");
        hBox.SetTextProperty("AltName", "wooden box");
    }
    else {
        Unhandled();
    }
}
Title: Re: Features question
Post by: Snarky on Fri 23/03/2018 10:24:07
Quote from: birenbergg on Fri 23/03/2018 09:32:47
Quote from: Snarky on Sat 17/03/2018 09:52:20
There might be ways to build AGS games natively for MacOS, but by far the easiest thing is to run them under Wine/Wineskin.

How do games like Blackwell can be played on mac? Is it some Steam's feature?

Wine is an application that allows you to play Windows games on Mac systems (and other platforms). You can get it here (https://dl.winehq.org/wine-builds/macosx/download.html). You might need to install XQuartz first; you get that here (https://www.xquartz.org/). Wine works well with AGS games and Wadjet Eye games in particular â€" I recently played Technobabylon using Wine.

Simply install XQuartz (if necessary), install Wine, and then you can run Windows EXE files on your Mac.

Now, I don't know about Steam. If you can't download the game onto your Mac, or can't access the EXE files, it's gonna be a bit trickier. There are probably ways around that. Or just get the game from somewhere other than Steam.
Title: Re: Features question
Post by: birenbergg on Fri 23/03/2018 10:27:01
Quote from: Snarky on Fri 23/03/2018 10:24:07
Quote from: birenbergg on Fri 23/03/2018 09:32:47
Quote from: Snarky on Sat 17/03/2018 09:52:20
There might be ways to build AGS games natively for MacOS, but by far the easiest thing is to run them under Wine/Wineskin.

How do games like Blackwell can be played on mac? Is it some Steam's feature?

Wine is an application that allows you to play Windows games on Mac systems (and other platforms). You can get it here (https://dl.winehq.org/wine-builds/macosx/download.html). You might need to install XQuartz first; you get that here (https://www.xquartz.org/). Wine works well with AGS games and Wadjet Eye games in particular â€" I recently played Technobabylon using Wine.

Simply install XQuartz (if necessary), install Wine, and then you can run Windows EXE files on your Mac.

Now, I don't know about Steam. If you can't download the game onto your Mac, or can't access the EXE files, it's gonna be a bit trickier. There are probably ways around that. Or just get the game from somewhere other than Steam.

Nah, the Steam is actually fine, runs WE's AGS games on Mac without a problem.
Sorry if I wasn't clear, this is not my native language :)

By "How do games like Blackwell can be played on mac?" I meant "they can be played, but how was it possible to do?" :)
Title: Re: Features question
Post by: Crimson Wizard on Fri 23/03/2018 10:57:24
I answered about Mac few posts above, but in case my reply was not noticed because it got in between two consecutive posts: http://www.adventuregamestudio.co.uk/forums/index.php?topic=55886.msg636583248#msg636583248
Title: Re: Features question
Post by: birenbergg on Fri 23/03/2018 11:01:22
Quote from: Crimson Wizard on Fri 23/03/2018 10:57:24
I answered about Mac few posts above, but in case my reply was not noticed because it got in between two consecutive posts: http://www.adventuregamestudio.co.uk/forums/index.php?topic=55886.msg636583248#msg636583248

Yeah, I saw it. Thank you :)
Title: Re: Features question
Post by: Cassiebsg on Fri 23/03/2018 14:49:12
Your solution for the hotspot name looks fine to me. You could have shorten it if your custom property already included the Description...
As in you wrote "Box" on the property instead of "". Then you could avoid the if/else condition. But then again, might be faster that way to code in the editor since you don't need to open the property box to add the text to it (for every hotspot). ;)