Countdown timer?

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

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

Postby Imari » Tue Sep 22, 2009 10:38 pm

Many thanks, mercedes. I did try something like that, but clearly I am an abject failure when it comes to code.... and all it takes is one bit out of place and it errors. :oops: I'll definitely try out your way, because it seems as though it should be possible.

Edit: I placed the first part in the Global Procedures but it errors --- asking for an "expected 'sub' ".
Thanks anyway.
User avatar
Imari
VIP
 
Posts: 872
Joined: Fri Jun 20, 2003 4:49 pm
Location: Virginia, USA

Postby mercedes » Tue Sep 22, 2009 10:56 pm

Did you try moving the lines down...I have no way of testing this...but i think it might give u that..if u keep the "Then" in that place..Put it like this..

Code: Select all
Sub TimeUpReturn
Action.GoToFrame Action.ReadINI(filename+".room",1,1),1,1
If frametosave = Solid01 Then
Found01=0 and Found02=0 and Found03=0 and Found04=0 and Found05=0 and StartTimer_1=0 and FoundAll_Solid01=0
End If
If frametosave = Solid02 then
Found06=0 and Found07=0 and Found08=0 and Found09=0 and Found10=0 and StartTimer_2=0 and FoundAll_Solid03=0
End If
End Sub


This should close the window~
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Imari » Tue Sep 22, 2009 11:39 pm

Global Procedures accepted that change --- so progress. :D
But the TimeUpReturn = True on the advanced tab of the hotspot button is throwing up a "type mismatch" error.
User avatar
Imari
VIP
 
Posts: 872
Joined: Fri Jun 20, 2003 4:49 pm
Location: Virginia, USA

Postby mercedes » Tue Sep 22, 2009 11:50 pm

do u have the other code in the same frame..? wondering if that's what it is..I have no way of testing anything like this on this side..so I can only go with what's in this thread..:P..

Have you tried TimeUpReturn again..without the true..
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Imari » Wed Sep 23, 2009 3:09 pm

Removing =True removed the error. The Try Again? hotspot now returns you to the previous puzzle frame, but it does not reset any of the variables.

The
Code: Select all
Sub TimeUpReturn
Action.GoToFrame Action.ReadINI(filename+".room",1,1),1,1
If frametosave = Solid01 Then
Found01=0 and Found02=0 and Found03=0 and Found04=0 and Found05=0 and StartTimer_1=0
End If
If frametosave = Solid02 then
Found06=0 and Found07=0 and Found08=0 and Found09=0 and Found10=0 and StartTimer_2=0
End If
End Sub


is in the Global Procedures.
User avatar
Imari
VIP
 
Posts: 872
Joined: Fri Jun 20, 2003 4:49 pm
Location: Virginia, USA

Postby reneuend » Wed Sep 23, 2009 6:35 pm

If you bundle up your project, I'll debug it for you. That is if you want too.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby mercedes » Wed Sep 23, 2009 9:04 pm

Yea, that might be the only option..for someone to physically work with it...have u tried..RemoveAllItems then reset it again..using-- ResetRemovedHotspots-- This way when they go back..it's fresh again...?
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Imari » Thu Sep 24, 2009 1:47 am

Thanks for offering your help, guys. I stripped it down to two connecting puzzles and zipped it. Everything works except for the Time-Up frame. When time runs out on a puzzle, the player is moved to the Time_Up frame. The Try Again? button + the sub TimeUpReturn are supposed to take the polayer back to the previous puzzle frame and reset all of the variables on that particular frame (and only those variables) when the player is returned to that frame.

I'm not using Hide and Disable for the hotspots.

Edit: fixed/working version is now here --->
http://rapidshare.com/files/284948195/HiddenObjectsTemplate.zip
Last edited by Imari on Fri Sep 25, 2009 10:14 pm, edited 1 time in total.
User avatar
Imari
VIP
 
Posts: 872
Joined: Fri Jun 20, 2003 4:49 pm
Location: Virginia, USA

Postby reneuend » Thu Sep 24, 2009 5:31 am

OK. I got it. I won't be able to get to it until tomorrow night.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby mercedes » Thu Sep 24, 2009 8:03 am

I'm not using Hide and Disable for the hotspots.


Oh,sorry..I lost track again.....[happens with age.. :lol: ]
I had it in my head u were making a Hidden object game..with a restart button..Sorry about that..Pretty sure u can use those commands though with other options...I've really only used most commands once or twice..being as i do something different for each project..



An added thought..;
You know what bugs me..when u want to add an emoticon to the message and it won't appear where u want it..but at the bottom of the freaken message... :x -- maybe its just me.. lol
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Imari » Thu Sep 24, 2009 2:09 pm

Before launching into making fancy artwork, I'm trying to make a template for a casual game that includes several alternating types of puzzles including hidden object ones. Most puzzles would go to the timer screen if time runs out. If the player wants to retry the puzzle, the return button would reset the variables for that puzzle and return him to the correct frame.

I was able to use the information that you guys posted here and in another couple of posts to get to the point that I'm at, thanks. Once I've gotten a template made, so that I know it can be done to suit me, I'm planning to make some nicer assets and then to incorporate ShadowHunter's Key Guard with those cool animated cursors, etc. into it. (You know how terrible I am at coding, but.... it was a plan. :P)

I didn't use ResetRemovedHotspots because I think it resets all hotspots that have been disabled with Hide and Disable. What I really needed to do was to reset the variables.

[I haven't had the wandering emoticon problem. :P I do, however, have trouble with the input window flipping around when trying to type in a post though. :evil: ]
User avatar
Imari
VIP
 
Posts: 872
Joined: Fri Jun 20, 2003 4:49 pm
Location: Virginia, USA

Postby reneuend » Thu Sep 24, 2009 4:22 pm

Not to take this off subject, but like Mercedes, I have the same problem with the emoticons. So I just memorized the ones I use the most and type it out! :)

The screen jumping problem is with then new Windows Explorer version, so I just use Chrome or an older version of Explorer to get around it. It's way too annoying to put up with. :shock:

Imari, I've seen enough of your work to know your a good scripter. :wink:
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby reneuend » Fri Sep 25, 2009 3:18 am

Imari wrote:Removing =True removed the error. The Try Again? hotspot now returns you to the previous puzzle frame, but it does not reset any of the variables.

The
Code: Select all
Sub TimeUpReturn
Action.GoToFrame Action.ReadINI(filename+".room",1,1),1,1
If frametosave = Solid01 Then
Found01=0 and Found02=0 and Found03=0 and Found04=0 and Found05=0 and StartTimer_1=0
End If
If frametosave = Solid02 then
Found06=0 and Found07=0 and Found08=0 and Found09=0 and Found10=0 and StartTimer_2=0
End If
End Sub


is in the Global Procedures.



I just noticed that you are going to a frame and then reinitializing your variables. You need to reset the vars and then go to the frame:

Note: Using a Select statement is cleaner and more expandable. IMO

Code: Select all
Sub TimeUpReturn

select case frametosave
    case "Solid01":
        Found01=0 and Found02=0 and Found03=0 and Found04=0 and Found05=0 and StartTimer_1=0
    case "Solid02":
        Found06=0 and Found07=0 and Found08=0 and Found09=0 and Found10=0 and StartTimer_2=0
end select

Action.GoToFrame Action.ReadINI(filename+".room",1,1),1,1

End Sub
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby Imari » Fri Sep 25, 2009 1:58 pm

Thanks for helping, but for some reason, this doesn't work either. I don't know why, but none of the variables are being reset when you're returned to the frame. I'm out of ideas... maybe it's someting that AM can't do?
User avatar
Imari
VIP
 
Posts: 872
Joined: Fri Jun 20, 2003 4:49 pm
Location: Virginia, USA

Postby mercedes » Fri Sep 25, 2009 3:10 pm

Have you tried to reset the variables on the same frame--[without user knowing it...]--This might be easier..Other than the counter-But that shouldn't be hard..It starts up when u come back to that frame anyways...
Then use the General TAB to go back to that frame..in the Try Again button...Then it would be like a new game...?

Does this make sense to u...Or have I lost track again..lol..

I gather its objects they have to find right..Once they find them..using the Advanced tab...set the variable =1 But, also use the variable tab--reset the variable..must be inverted..and hide the picture only--Once they find the item..

Then in the [ I hope i'm not yammering on here and this makes no sense to u..] Try Again button...use go to the frame--and use the General TAB..

In the frames' advanced...Load the invisible hotspots again..

At this point though..I can't see a reason for the variables....Are the variables being used strictly for the sub..?

I may be embarrassed after posting this....cause i've yet to sleep and this makes sense to me.. :lol:

What do u think...?

Or u can simply ignore this..and carry on like I never posted..[ignore the crazy lady..we let her play once in awhile..:lol:]..
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Imari » Fri Sep 25, 2009 3:35 pm

Actually, the counter does not start when the frame loads. I have it set to start when the player clicks the start button/hotspot.

I did try resetting the variables in the Frame Properties for each puzzle frame, but then the variables seemed to reset immediately once the hotspots were clicked... so the start button flickered

I also tried adding several variations of the code in the Sub to the Frame Properties for each puzzle frame, but each attempt errored.

Your post does give me an idea to try, though. I'm thinking that if I made the start button go to a separate puzzle frame and have it reset all the variables for that frame, then it might work. I'll try it tonight or tommorrow and let you know. Thanks again!
User avatar
Imari
VIP
 
Posts: 872
Joined: Fri Jun 20, 2003 4:49 pm
Location: Virginia, USA

Postby mercedes » Fri Sep 25, 2009 3:41 pm

Actually, the counter does not start when the frame loads. I have it set to start when the player clicks the start button/hotspot.


lol...well of course,...that would make alot more sense..I was testing it this way..and assumed u had it that way too...which would be silly..:D

Ok, i'm going to go to sleep now...and dream of variables and finding stuff..and when i get up...i'm going to mess with this..:shock:
It's bugging me now...That's if someone else hasn't found the solution..

Peace~~~
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Imari » Fri Sep 25, 2009 9:16 pm

Okay, with a lot of help from my friends, I figured out how to do it! :D

I put the sample project up on Rapid Share --->
http://rapidshare.com/files/284948195/HiddenObjectsTemplate.zip.html

For those without the full version of AM, I comiled the project --->
http://rapidshare.com/files/286066177/HiddenObjectDemo_AM.zip

Using mercedes ideas, I duplicated each of the puzzle frames and called the duplicate of each *a (with * = the frame name). I then stripped all of the hotspots from the intial puzzle frames except for the "start" button. (I'll probably make the graphic for this into a doorway to each puzzle room or something.... so the player does not seem to be pressing the same start button twice.) I set the "start" button to go to the corresponding puzzle frame and to reset all of the variables on that destination frame to zero. I did this part without scripting.

On the "Time's Up" frame, I took out everything but TimeUpReturn in the the advanced tab of the Try Again ? button.

Then using reneuend's code, I changed the sub to read -
Code: Select all
Sub TimeUpReturn
frametosave = Action.ReadINI(filename+".room",1,1)
Select Case frametosave
    case "Solid01a":
        Action.GoToFrame "Solid01"
    case "Solid03a":
        Action.GoToFrame "Solid03"
End Select
End Sub


For the Time's Up frame, I'll probably need to make another button and sub for the "no" button that will move the player to the next puzzle frame and possibly deduct points or something, but that should be easy :roll: to do following what's already been coded.

You guys are the best! Thanks.
Last edited by Imari on Mon Sep 28, 2009 3:04 pm, edited 1 time in total.
User avatar
Imari
VIP
 
Posts: 872
Joined: Fri Jun 20, 2003 4:49 pm
Location: Virginia, USA

Postby reneuend » Sat Sep 26, 2009 12:39 am

I'm glad you got it working.

It's been a hectic week and I had very little opportunity to work on it. When I did look at it, I wasn't quite sure what you were trying to accomplish.

There is a way to reset variables and it's important to know how to do because most games will need a restart feature.

Enough talking. I'm going to download your game and try it out now! :)

(update): It works nicely. Very intuitive. :)

If you're interested, all the puzzles could be done from one frame. It's very similar to how I did the journal with unlimited pages. In some ways, it's actually easier this way.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby Imari » Sat Sep 26, 2009 1:46 pm

I'm glad that it worked for you, reneuend. Thanks again for your help. It did occur to me that I might be able to do most of the puzzles from one frame, but I wasn't sure how to do it and the thought of shuffling 100 stacked hotspots :shock: on a single page was too daunting.

Now to see what other puzzles I can accomplish to bring the whole together. In the mean time, if anyone is working on a hidden object game and wants to see how this was managed they can. I think if this is mixed with ShadowHunter's animated cursors and FX effects one should be able to make a pretty decent game.
User avatar
Imari
VIP
 
Posts: 872
Joined: Fri Jun 20, 2003 4:49 pm
Location: Virginia, USA

Postby reneuend » Sat Sep 26, 2009 3:31 pm

It sounds like it will be a lot of fun when you finish it! :)


---
Using just one frame, you would only need to the maximum number of hotspots for a single frame. You would just reuse them. But you've already got it working, so who in their right mind would start over? :shock:
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Previous

Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests

cron