Hiding Hotspots with Scripting[solved]

This forum is meant for requesting technical support or reporting bugs.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

Hiding Hotspots with Scripting[solved]

Postby Skye » Fri Dec 30, 2005 5:32 am

Hi,

I know this has been touched on a few times in other posts but I am having some difficulty getting it to work.

If I understand the process properly, to affect the visibility of a hotspot I use the code:

Hotspot(x).visible = true -- to make it visible and
Hotspot(x).visible = false -- to make it invisible.

I attempted a quicky test before dashing off to work this evening but no matter what I tried, the hotspot(x) remained visible.

This is the code I used:

Code: Select all
 If HSvalue = 1 then
   Hotspot(2).visible = true
 Else Hotspot(2).visible = false
 end if


I put the script in the advanced tab of the frame properties and tested by running a 'test frame' and manually changing the value of HSvalue with the debug option.

I'm darned if I can figure out what is going wrong, the code seems so simple. BTW, I know it is easier to use the variables tab but I am in desparate need of ways to reduce the variable load of my game so that a saved game will reload in a reasonable amount of time.

Skye
Skye
Expert Member
 
Posts: 325
Joined: Sat Sep 13, 2003 4:19 pm
Location: British Columbia, Canada

Postby ShadowHunter » Fri Dec 30, 2005 9:51 am

Hi Skye,

This should work !

Code: Select all
Sub ChangeHotSpotState(HSvalue, HotSpotNumber)
     Hotspot(HotSpotNumber).visible = HSvalue
End Sub


Now you can call this subroutine from anywere:

Code: Select all
ChangeHotSpotState TRUE, 2


Where TRUE means Visible and 2 the hotspotnumber you want to adjust. No variables needed :wink:

Good luck,

ShAdOwHuNtEr
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby Skye » Fri Dec 30, 2005 11:33 am

Thanks ShadowHunter!

I need all the help I can get it downsizing my variable file.

Skye
Skye
Expert Member
 
Posts: 325
Joined: Sat Sep 13, 2003 4:19 pm
Location: British Columbia, Canada

Postby GM-Support » Sat Dec 31, 2005 11:07 pm

Hi,

Please be aware that changing the .visible property does not always work fine, because AM automatically updates the visibility of the hotspots so that the conditions set under the "variables" tab of the Hotspot Properties are always met.

To solve the problem, a workaround consists in moving the hotspot outside of the game area, by using the following command:

Code: Select all
Hotspot(1).move LEFT*15, TOP*15, WIDTH*15, HEIGHT*15


Best regards,
GM-Support
GM-Support
Forum Admin and Games Page admin
 
Posts: 2221
Joined: Thu Jun 05, 2003 7:52 pm


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 2 guests

cron