Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support
Action.CreateTimedEvent 4.5 , "VAR1=8 : Action.CreateTimedEvent 4.5 , ""Action.Quit"""
timer_set=10
Action.CreateTimedEvent timer_set, "Actions"
Action.CreateTimedEvent timer_set, "timer_count=timer_count+_1"
if timer_count>0 then
Action.CreateTimedEvent (timer_set-timer_count), "Actions"
end if
Sub DecreaseCounter
If Counter > 0 Then
Counter = Counter - 1
ElseIf Counter <> -999 Then
Msgbox "The time is up!"
Counter = -999
End If
ShowCounter
End Sub
Sub ShowCounter
text_index = Action.GetMergedTextIndex
If Counter > 0 Then
Text(text_index) = Counter
Else
Text(text_index) = "Time Is Up"
End If
End Sub
If Counter = 0 Then Counter = 20
If Counter > 0 then
Action.CreateTimedEvent 1,"DecreaseCounter",True
End If
ShowCounter
Create a new global Integer variable named "Counter" (without the quotes). <---where do i create this? In the first frame?
Copy/paste the following code into the "VBScript Global Procedures" window: <----where do i do this? In the first frame also? It seems the project properties doesnt have a vbsglobal procedures box. Do I have to put this in every frame?.
Sub DecreaseCounter
If Counter > 0 Then
Counter = Counter - 1
Else If Counter <> -999 Then
Msgbox "The time is up!"
Counter = -999
End If
ShowCounter
End Sub
Sub ShowCounter
text_index = Action.GetMergedTextIndex
If Counter > 0 Then
Text(text_index).caption = cstr(Counter)
Else
Text(text_index).caption = "Time Is Up"
End If
End Sub
Return to Adventure Maker Technical Support and Bug Reports
Users browsing this forum: No registered users and 0 guests