Multiple Variables.+ Actions

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

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

Multiple Variables.+ Actions

Postby mercedes » Thu Aug 07, 2008 11:56 pm

I'm not sure how to word this..so I'll try my best..

How can I make a hotspot...if one is clicked or another or another is clicked....Actions happen...but the actions change depending on a variable..

In other words..the user can click different hotspots..ok.. if they click the first one..something happens..but if they click another one..the same thing can happen..if they haven't clicked the first one first..yet..

Say there are 10 hotspots...each one can have the same effect...[Load the same Picture lets say] ..only if say they click number 1 hotspot and the action has happened...How can I make it so the other 9 now..have different actions..[load different pictures]

I"m wondering where to put the statement..in all 10 hotspots..? Frame..or where the picture would load..



Hope this makes sense..:? If not please ask and i can clarify it more..~


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

Postby Candle » Fri Aug 08, 2008 3:19 am

See my avatar tut :)
Please don't PM me questions, ask here in the forums!
``````````````
Between grand theft and a legal fee, there only stands a law degree.
User avatar
Candle
Administrator
 
Posts: 3077
Joined: Sat Feb 07, 2004 2:21 am
Location: Rudy's Bar

Postby GM-Support » Fri Aug 08, 2008 7:18 pm

Hi,

This is what the "global procedures" are for: you create a single procedure and you call it from several places in your project. No need to write the same piece of code several times.

Regards,
GM-Support
GM-Support
Forum Admin and Games Page admin
 
Posts: 2221
Joined: Thu Jun 05, 2003 7:52 pm

Postby Chromegloss55 » Fri Aug 08, 2008 9:11 pm

To create a procedure you simply use the syntax:

[url]Sub SubName (Argument 1, Argument 2, Argument 3)

--- Actions ---

End Sub[/url]

To call a procedure you simply use the syntax:

[url]SubName Parameter1, Parameter2, Parameter3[/url]
Hope that helps.
_________________
Confucianism Forum
Last edited by Chromegloss55 on Tue Feb 24, 2009 3:24 pm, edited 1 time in total.
Chromegloss55
Forum Master
 
Posts: 630
Joined: Sat Nov 03, 2007 2:49 pm
Location: God Knows!

Postby mercedes » Fri Aug 08, 2008 10:37 pm

I have never created a subprocedure before...I have an idea of what they mean..[laments terms]but I wouldn't know where to start..

But thanks for answering..I'm just gonna give up on this one..If Lyberodoggy can't do it..takes alot of time....I sure can't..I didn't think it would be that hard..lol..



Peace

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

Postby Chromegloss55 » Sat Aug 09, 2008 1:51 pm

No, subroutines are easy to use...

You just need to get the hang of them...
_________________
Nutrition Forum
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 Mystery » Sat Aug 09, 2008 2:27 pm

Maybe this example can help you, you'll need to change it a bit according to your own needs (in terms of the action that should happen), and continue up to effect = 10.


Create a variable (e.g. effect)

Add to the VB Procedures:
Code: Select all
Sub Effects
If effect = 1 Then Action.Message "first effect"
If effect = 2 Then Action.Message "second effect"
If effect = 3 Then Action.Message "third effect"
If effect = 4 Then Action.Message "fourth effect"
End Sub


(You could probably also do it similarly with "Select Case")

Add to the Advanced Tab of each hotspot:
Code: Select all
effect = effect + 1
Effects


EDIT
If you want to load images, use this in the VB Procedures (just replace the image names):
Code: Select all
Sub Effects
If effect = 1 Then Action.LoadAPicture Hotspot(Action.GetHotspotNumber), "yellow.GIF"
If effect = 2 Then Action.LoadAPicture Hotspot(Action.GetHotspotNumber), "yellow.GIF"
If effect = 3 Then Action.LoadAPicture Hotspot(Action.GetHotspotNumber), "black.GIF"
If effect = 4 Then Action.LoadAPicture Hotspot(Action.GetHotspotNumber), "blue.GIF"
End Sub
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby mercedes » Sun Aug 10, 2008 1:55 am

Hi there..:) I deleted my previous post cause i tried this and thought to ask u something and didn't want to double post..

I have made a Sub called WrongLetters.

Its so if they hit say C D or F..
a "Picture" will load in a different hotspot..not where the letters are..

but it could be the same one..depending on whether or not they hit C D or F....... first..

Did i do this right..? Where do i put Effects=effects+1


Would it be where the pictures would appear or in the advanced of the wrong letters..?




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

Postby Mystery » Sun Aug 10, 2008 10:10 am

If you want to load an image in a certain hotspot, and not the hotspot that the player clicks, just add the hotspot number instead of Action.GetHotspotNumber.

You need to put
Code: Select all
effect = effect + 1
WrongLetters

into the Advanced Tab of each hotspot that the player can hit for this puzzle (C, D, F, etc.).
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby mercedes » Mon Aug 11, 2008 1:53 am

This works perfectly Mystery..!!!! Thanks

The only thing is..

I need something else now...:oops:

I have multiple letters to click from...but only 8 pictures to load..How can I make it so once they have used up the 8 pictures[Guesses]

The game resets..they have to start over now..Clear the board i guess..



Many THanks..~!! whoo hoo..Im so happy this worked..and that was easy..enough..I can remember that one..i hope..:P



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

Postby Mystery » Mon Aug 11, 2008 10:30 am

Sorry, I don't have much time right now to think about it in detail cause I need to go to work, but generally, you could load a blank image in the hotspot with
Code: Select all
Action.LoadAPicture Hotspot(Hotspot_Number), ""

and reset the variable effect to 0 with
Code: Select all
If effect = 8 Then effect = 0

(or maybe only if effect = 9, you need to try out).

Hope this helps you on the track, and you can figure it out :)
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby mercedes » Mon Aug 11, 2008 1:11 pm

HI there..not sure whats going on..but i have this in the Procedures...

Code: Select all
If effect = 9 Then
effect = 0
Action.Message " Please, Restart Game!"
 End If




This in the letters' hotspots that are set to load pictures of letters normally..but once effect = 0 they shouldn't load anything..but they are still loading letters..:(


Code: Select all
If effect = 9 Then
effect =0
Action.LoadAPicture Hotspot(63),""
Action.Message "Please Restart Game!~"
Else
Action.LoadAPicture Hotspot(63),"A.GIF"
End If




Any ideas would be appreciated...:)



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

Postby Lyberodoggy » Mon Aug 11, 2008 8:06 pm

How about reloading the frame with
Action.Gotoframe Action.GetCurrentFrameName
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby mercedes » Tue Aug 12, 2008 4:51 am

That works.. Thanks Guys...!!~


Yay...!! I created a Hangman game..woohoo..


That wasn't easy..lol..nothing ever is for me..so i'm used to that..:P

I went to open it today..and something was missing from it..so it erased the whole thing...UGH i was so upset..lol...There was 92 hotspots on that sucker..with script in the advanced..

Had to restart the whole thing...




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

Postby Lyberodoggy » Wed Aug 13, 2008 6:49 pm

92 Hotspots !?!?!?!?!!?
OMG...
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby mercedes » Wed Aug 13, 2008 6:55 pm

Yup..all the letters I created..and plus the hotspots for them to load in..thats 52 right there...let alone the hangman guy..which was another 8..==60..then
I added lines of course..lol..so the letters could sit on...like areal hangman game...:)







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


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests