Timed Event

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

Moderators: Vengeance66, Harvester, GM-Support, reneuend, Lyberodoggy, Candle, Mystery, ShadowHunter

Timed Event

Postby GORDON » Sat Dec 17, 2011 4:19 am

In my frame I have a "hotspot 7" where an animated gif plays once. I then want it permanently removed when it's done after 2 or 3 seconds. Do I use the advanced VBS code in the hotspot properties or the frame properties & is the following code correct?
Action.CreateTimedEvent 2 , "Action.Hotspot(7).enabled = False"
It doesn't work! I'm not very good at scripting.
Thanks!
GORDON
Advanced Member
 
Posts: 154
Joined: Mon Apr 30, 2007 1:36 am
Location: Canada

Postby reneuend » Sat Dec 17, 2011 6:31 am

You have an error in your code line, but even if you fix it, it will probably not do what you intended!

The correct code is:
Code: Select all
Action.CreateTimedEvent 2, "Hotspot(7).enabled = False", False


As a test, try this!
Code: Select all
Action.CreateTimedEvent 2, "Hotspot(7).enabled = False:msgbox ""Disabled!""", False


I put a message behind the hotspot and tested it with the code above. You are right, it does NOT disable after you click on it. AM doesn't disable a hotspot if its an animated gif! Interesting find!

How I would fix this!
If you want the animation to stop, then that's easy...just use the "action.loadapicture() command and replace the gif with a still image.

If you want the animation to continue but the hotspot to be disabled, then I would put a condition around the action that you want to be disabled. when the user clicks on the hotspot, toggle a variable from 0 to 1 and the condition will only run the action if the variable is equal to 0.

example:
create an integer variable called, "nsDisableHS"

Code: Select all
if nDisableHS = 0 then
   action.message  "hotspot enabled"
   nDisableHS = 1
end if




If there is something else you intend to happen when the user clicks on the hotspot, please post!

Do you want it to be invisible?
or
Do you want the animation to stop?
or
Do you want the animation to continue, but the hotspot no longer do any action after the user clicks on it?
---


Image
Image








See my work at http://www.hickchickgames.com (site under construction)
User avatar
reneuend
Administrator
 
Posts: 2387
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby GORDON » Sat Dec 17, 2011 3:31 pm

I just want the animation to play once in "hotspot 7" which it does, but not come back to that frame later in my game and have it play once again. I just thought that getting rid of "hotspot 7" after the short gif animation solved my problem.
GORDON
Advanced Member
 
Posts: 154
Joined: Mon Apr 30, 2007 1:36 am
Location: Canada

Postby reneuend » Sat Dec 17, 2011 4:59 pm

So, I'm guessing that it's NOT based on the user clicking on the hotspot???

disabling a hotspot doesn't make it invisible, it just makes it so whatever action is supposed to occur when the player clicks on it, doesn't happen anymore.

What you want to do is set a variable in the "FRAME" properties. This way you know the player has visited this particular frame.


Code: Select all
If visitedFrameX = 1 Then
    Hotspot(1).enabled = false
    action.loadapicture hotspot(1), ""
End If

Option 1: hide and disable the hotspot

Code: Select all
If visitedFrameX = 1 Then
    Hotspot(1).enabled= false
    hotspot(1).picture = nothing
End If

Option 2: hide and disable the hotspot

Code: Select all
If visitedFrameX = 1 Then
    Hotspot(1).enabled = false
    hotspot(1).visible = false
End If

Option 3: hide and disable the hotspot


Code: Select all
If visitedFrameX = 1 Then
    Hotspot(1).move 10000*15,10000*15
End If

Option 4: move the hotspot off the screen


Interestingly, none of these have an effect on a animated gif. (at least not in Windows 7)This tells me that AM is adding another control behind the scenes for the gif. So, in this case, I see two alternatives:

1. go to a matching frame that doesn't have the gif image if the player has already visited the frame with the gif image.

You will set a variable in the gif frame properties so you know they have visited that frame. In any other frame that allows them to return, check the variable and see if they have visited it.

2. don't use an animated gif, but use a video in a hotspot instead. There are tools that will convert animated gifs to video formats. This is my choice. I don't like using a lot of replicated frames. I think its messy and confusing to maintain.
---


Image
Image








See my work at http://www.hickchickgames.com (site under construction)
User avatar
reneuend
Administrator
 
Posts: 2387
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby GORDON » Sat Dec 17, 2011 5:16 pm

Thanks for all your ideas! Appreciated!
GORDON
Advanced Member
 
Posts: 154
Joined: Mon Apr 30, 2007 1:36 am
Location: Canada

Postby GORDON » Sat Dec 17, 2011 6:04 pm

I just set variables on my "exit frame hotspots" to disable "gif hotspot 7". I guess I was just trying to make it too complicated.
GORDON
Advanced Member
 
Posts: 154
Joined: Mon Apr 30, 2007 1:36 am
Location: Canada

Postby reneuend » Sat Dec 17, 2011 6:34 pm

If you have any problems getting it to work, please let me know.
---


Image
Image








See my work at http://www.hickchickgames.com (site under construction)
User avatar
reneuend
Administrator
 
Posts: 2387
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests

cron