How to Decrement to 0?

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

How to Decrement to 0?

Postby windebieste » Thu Jan 30, 2014 6:16 am

I'm trying to understand how to select any 5 random hotspots (click on them in any sequence) out of a potential total of 7 hotspots available and spread across multiple frames.

Those 5 selected hotspots are to unhide another hotspot, 'A', that is present in yet another different frame altogether. Once hotspot 'A' becomes selectable, the 2 remaining unselected hotspots from the original 7 are to be removed/disabled. The newly revealed 'A' hotspot is to be selectable multiple once it is unhidden.

I am guessing I will have to have all 7 hotspots be able to decrement a value somewhere in 'A's properties to 0 with a starting value of 5..?

What's the right way to do this? Can someone explain how to set this situation up or direct me to a tutorial that can help?

Thanks!
windebieste
New Member
 
Posts: 2
Joined: Sat Apr 24, 2010 8:52 am

Re: How to Decrement to 0?

Postby reneuend » Fri Jan 31, 2014 1:11 am

Hello windebieste,

Thanks for posting.

I would do this with vb script and call a subroutine from the 7 hotspots. The subroutine would increment until it reached 5. At this point, the subroutine would set a flag (variable) that would be checked on the frame properties where the "A" hotspot is located. To disable the 2 "unused" hotspots, you will have to have track which hotspots were used. In the same manner as with the "A" hotspot, you will have to check (if statement), on the frame properties where any of the 7 hotspots are used and the hotspots that were not used, disable them.

I can write an example if you need it. But first, do you have an AM version where you can write VB Script?

UPDATE: I wrote a sample AM Game to build this.
Assumption: A user can select the same hotspot more than once, but it will NOT be counted as the 5 selected. This would have to be this way in order to have 2 remaining unselected hotspots.
example:
User selects the following Tiles before they are disabled: "2,3,2,4,7"
The remaining tiles: "1,5,6" are disabled after the 5 tiles have been selected

UPDATE: Here is a tutorial: http://www.adventuremaker.com/forums/viewtopic.php?f=10&t=6722

Please post back if you have any questions.

~ Good luck and congrats on your first AM Post!!! :mrgreen:

OHHH! To answer your question about decrementing!!!!

Code: Select all
For x = 10 to 0 step -1
  Text(2).caption = Text(2).caption & " : " & x
Next
---


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

Re: How to Decrement to 0?

Postby windebieste » Fri Jan 31, 2014 1:24 pm

Ah! Thank you. This answers just about all of my questions - including some that now no longer require asking. :D

Thank you for the tutorial as well. This helps a lot. I'm not a programmer, but I will manage.

I'm not yet at the point where I need to integrate this feature into my project just yet - I'm still assembling my design document, performing a feasibility study and prototyping - basically, making sure the 'Adventure Maker' software can make the game I want to make. So far, it's all very promising. :wink:
windebieste
New Member
 
Posts: 2
Joined: Sat Apr 24, 2010 8:52 am


Return to Adventure Maker General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests