Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Thu 13/10/2005 13:51:54

Title: 3 Scripting-Related Questions
Post by: on Thu 13/10/2005 13:51:54

Hello,

I am pretty new to AGS and I have a couple of queries, partly related to what I would like to do and partly just to help me understand the way in which AGS writing works and the constraints.

I was wondering if there is a way in the interactions script for an object  to influence the GUI - e.g. could 'Any Click on Object' have a script which would, say - change the Sprite for a button to the 'pressed' one or display a message in the GUI?

Secondly, I was wondering if there is a way, through scripting, or otherwise to have an interaction for an Object, which works in the same way as the 'Mouse Moves Over Hotspot' interaction, for a hotspot.

Finally I was wondering - Is it possible to run another, different script from within a script and pass - receive values between them?

Any enlightenment would be muchly appreciated!
Title: Re: 3 Scripting-Related Questions
Post by: Elliott Hird on Thu 13/10/2005 14:50:56
1: Yes, (checks manual) use btnName.NormalGraphic = sprite_number; and then of course switch it back afterwards.
2: in repeateadly_execute[sic?]:if (Character.GetAtScreenXY(mouse.x, mouse.y) == cScriptName)
{
do stuff;
}

3: I'm not quite sure what you mean. Could you please clarify that?
Title: Re: 3 Scripting-Related Questions
Post by: Ishmael on Thu 13/10/2005 15:46:44
For the third one, you can make your own functions - read the scripting tutorial in the manual - and make them take and return values.
Title: Re: 3 Scripting-Related Questions
Post by: Elliott Hird on Thu 13/10/2005 16:41:32
Quote from: Ishmael on Thu 13/10/2005 15:46:44
For the third one, you can make your own functions - read the scripting tutorial in the manual - and make them take and return values.
I thought so too, but I just wanted to check.
Title: Re: 3 Scripting-Related Questions
Post by: on Fri 14/10/2005 09:58:10

Many Thanks All, I wasn't sure if you could influence buttons in this way from outside the GUI scripts and how you could pass information between scripts...
Gradually getting to understand it though..
Will have to read the manual a couple more times I think...
Title: Re: 3 Scripting-Related Questions
Post by: Elliott Hird on Fri 14/10/2005 10:33:07
Glad you're getting there.

Edited by Ashen: No need to quote whole post directly above yours.