Timing in frames

This forum is meant for posting anything related to Adventure Maker that doesn't fit in the other forums.Please post technical questions in the Technical Support Forum!

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

Timing in frames

Postby chickens1127 » Fri Aug 22, 2008 2:22 pm

Is there a code that would say...

After the frame comes up, if a hotspot is clicked within a second it goes to this frame, and if they click it between 1.1 and 1.9 seconds it goes to another frame, and have 4 or 5 of these.
Hi... It's Chickens1127...
CHINCHILLAS ROCK!

RIP Crazygamemaker
User avatar
chickens1127
AM Magazine Moderator
 
Posts: 898
Joined: Thu Nov 22, 2007 12:49 am
Location: Awsomeville, USA

Postby Chromegloss55 » Fri Aug 22, 2008 5:05 pm

Yes, but this complicated enough...

Create a VARIANT VARIABLE called Time1.

In the FRAME PROPERTIES of the frame, type this code:

Code: Select all
Time1 = Time


Now in the HOTSPOT PROPERTIES of the hotspot being clicked, type this code:

Code: Select all
Time2 = Time

Q = DateDiff("s",Time1,Time2)

If Q < 1 then Action.GoToFrame"Frame1" : Inv = 1
If Inv = 0 Then If Q < 2 then Action.GoToFrame"Frame2" : Inv = 1
If Inv = 0 Then If Q < 3 then Action.GoToFrame"Frame3" : Inv = 1
If Inv = 0 Then If Q < 4 then Action.GoToFrame"Frame4" : Inv = 1
If Inv = 0 Then If Q < 5 then Action.GoToFrame"Frame5" : Inv = 1


This code measures how the time between the FRAME APPEARING and the HOTSPOT BEING CLICKED and uses it to decide which action to trigger.

Hope that helps,

Chromegloss
_________________
what is a recession
Last edited by Chromegloss55 on Tue Feb 24, 2009 3:25 pm, edited 1 time in total.
Chromegloss55
Forum Master
 
Posts: 630
Joined: Sat Nov 03, 2007 2:49 pm
Location: God Knows!

Postby Lyberodoggy » Sat Aug 23, 2008 10:52 am

I would say...

Create integer variable Time

In frame properties type:

Code: Select all
ACtion.CreateTimedEvent 0.1 Time=Time+1


In hotspot properties type:

Code: Select all
If (Time/10)<1.1 Then
Action.GotoFrame "firstframe"
else if (Time/10)<1.9 Then
Action.GotoFrame "Secondframe"
etc...
End IF
End If
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby chickens1127 » Sat Aug 23, 2008 1:31 pm

Thanks, becuase I need it as a timing system in a game.
Hi... It's Chickens1127...
CHINCHILLAS ROCK!

RIP Crazygamemaker
User avatar
chickens1127
AM Magazine Moderator
 
Posts: 898
Joined: Thu Nov 22, 2007 12:49 am
Location: Awsomeville, USA

Postby Chromegloss55 » Sat Aug 23, 2008 9:48 pm

Did you manage to get it work?
_________________
Futurama Forum
Chromegloss55
Forum Master
 
Posts: 630
Joined: Sat Nov 03, 2007 2:49 pm
Location: God Knows!


Return to Adventure Maker General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests