Random fact/question

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

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

Random fact/question

Postby pennsteve » Wed Dec 31, 2008 8:04 pm

Is there any way to make it so if a user clicks a hotspot they will get a random fact or question that I have added to the game? Like if they click it and get the question and move on, but then go back to that frame and click it again, they will get a totally different question.

Thanks. :D
pennsteve
Expert Member
 
Posts: 329
Joined: Wed Aug 06, 2008 3:55 pm

Postby Lyberodoggy » Wed Dec 31, 2008 10:04 pm

This should help
Code: Select all
randomize
question=int(rnd*4)
Select case question
case 0
Message "first question"
case 1
....
case 3
...
end select
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby pennsteve » Thu Jan 01, 2009 2:55 am

I dont understand. Where do I put the questions? Make a frame for each question? And how do I know it wont bring up a frame I dont want it to bring up, like a later part of the game? lol
pennsteve
Expert Member
 
Posts: 329
Joined: Wed Aug 06, 2008 3:55 pm

Postby mercedes » Thu Jan 01, 2009 3:05 am

Thats why the Select Case,...

If they click it the first time...they'll get your first question...if they click it the second time..they'll get the second question..

But with the random set...even though u have a select case..it will still randomize the questions...If you took out the random function..u would get the questions in a row...first click would be question one...and so on..

With the random...it will randomize the questions..You can add to the Select..first select..if theyclick it...it can go to a frame of your choosing..You would simply add it...in the select..Action.gotoframe, "Nameofframe"

Case 0
Question 1
action go to frame

Case 1
Question 2
Action go to frame or load a hotspot...whatever u want..:)

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

Postby pennsteve » Thu Jan 01, 2009 4:18 am

I still dont understand. Where would I keep the questions? One question on One frame? Would it be opening a random frame? I guess you dont understand what I am trying to say.

If you wanted to make say......A magic 8 ball.......clicking a hotspot is like shaking it........and a random statement appears......how would you make this? Say you had 20 random statements/questions.......would you have 1 on each frame? 20 questions = 20 frames?
pennsteve
Expert Member
 
Posts: 329
Joined: Wed Aug 06, 2008 3:55 pm

Postby mercedes » Thu Jan 01, 2009 4:50 am

This select case goes into a hotspot...

Thats up to u..what u want the user to do after they get their question..:?

The questions go into the select case...which is then put in a hotspot that the user clicks..however many times u want them too...

When the user clicks the hotspot..it says a question...then does whatever u want it too..

I"m not sure why u are asking about frames..and random frames...I thought u wanted random questions...

This select case gives u that..:) and if you want the user to go to a frame per question..then u would add it to the select case..

Case 0
First Question
ACtions go h ere

Case 1
Second question
Actions go here..

Case 2
Third Question
Actions go here

Each time the user clicks the hotspot..they get a question..and u can choose the actions..Thats why ppl use select cases..if u want the user to click the same place..and get different actions and or in your case..questions...

He has added a random function to it..so they get the questions randomly...
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Lyberodoggy » Thu Jan 01, 2009 10:43 am

You didn't try the code I gave you first, that's why you still don't get it :(

All it does is make a pop-up message appear in the bottom (if you replace the rest of the cases with actual code). No frame changing involved

Action.Message just displays a message.

On the other hand you can use the random events plugin which will do this job without any scripting. Just go to Plugins page and see the link. Download the latest attachment on the post
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby pennsteve » Thu Jan 01, 2009 6:01 pm

I havent tried it. I am not even working on a game. When I think of something I might want to use later I'll ask about it and then save the link to the answers I am given so I wont have to come back again later and ask the same thing. lol
pennsteve
Expert Member
 
Posts: 329
Joined: Wed Aug 06, 2008 3:55 pm

Postby Lyberodoggy » Thu Jan 01, 2009 8:37 pm

lol indeed
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests

cron