Jump to content


Photo

How do I make Text Boxes and Questions?


  • Please log in to reply
5 replies to this topic

#1 ZaoMonichi

ZaoMonichi

    GMC Member

  • New Member
  • 6 posts
  • Version:GM8

Posted 13 June 2012 - 03:27 AM

How would I go about making Text Boxes and have questions with answers (I only need 3 possible answers) in my game?

If anyone has played Dungeons of Fayte, I'd like to mimic that kind of textbox. I would also like to be able to use fonts, and have the textbox be fit to the view I have in the game.
  • 0

#2 aary33

aary33

    GMC Member

  • GMC Member
  • 17 posts
  • Version:GM8

Posted 13 June 2012 - 03:32 AM

It can all work out using the draw event, just create objects for the invisible "answer button" to be able to be clicked on
  • 0

#3 ZaoMonichi

ZaoMonichi

    GMC Member

  • New Member
  • 6 posts
  • Version:GM8

Posted 13 June 2012 - 03:38 AM

Well, I'm not terribly familiar with draw events and a lot of things in scripting. Also, I'd like this set up to be activated with the Z key, not clicking.
  • 0

#4 kupo15

kupo15

    GMC Member

  • GMC Member
  • 400 posts

Posted 13 June 2012 - 03:50 AM

You need to have a variable for the answer or maybe an array would be best, 1 for the question and 1 for the answer and if the two match its correct.
Example. The first question's answer is in the 4th slot
question[1] = 0 // 1 is the question number 0 is the first choice, 1 is the second etc
answer[1] = 3 // 1 is the question number 3 is the correct answer

// when you tap left or right select a different possible answer add or sub 1 to question[1]

if question[1] = answer[1] // correct answer selected

There prob is a better way but its hard to suggest it w/o knowing more about your game

You could also use 1 2d array instead where 0,1 is the question portion and 1,1 is the answer portion
([1,1] means question 1 [1,1] means answer 1)

Edited by kupo15, 13 June 2012 - 03:52 AM.

  • 0

#5 PoniesForPeace

PoniesForPeace

    puzzling

  • GMC Member
  • 493 posts
  • Version:GM:Studio

Posted 13 June 2012 - 04:00 AM

gm help file search for messages use built in ones
  • 0

#6 ZaoMonichi

ZaoMonichi

    GMC Member

  • New Member
  • 6 posts
  • Version:GM8

Posted 13 June 2012 - 04:03 AM

You need to have a variable for the answer or maybe an array would be best, 1 for the question and 1 for the answer and if the two match its correct.
Example. The first question's answer is in the 4th slot

question[1] = 0 // 1 is the question number 0 is the first choice, 1 is the second etc
answer[1] = 3 // 1 is the question number 3 is the correct answer

// when you tap left or right select a different possible answer add or sub 1 to question[1]

if question[1] = answer[1] // correct answer selected

There prob is a better way but its hard to suggest it w/o knowing more about your game

You could also use 1 2d array instead where 0,1 is the question portion and 1,1 is the answer portion
([1,1] means question 1 [1,1] means answer 1)


If you'd like to play what my game would be very similar too, check out http://forums.tigsou...p?topic=10372.0 (Dungeons of Fayte)
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users