Home / Topic / Virtual dice for board game rules/story book

Virtual dice for board game rules/story book

Home Kwiksher Forums General Discussion Virtual dice for board game rules/story book

Viewing 5 posts - 1 through 5 (of 5 total)
  • Matt
    Participant
    #81331

    I have a board game that I am in the process of self publishing. I want to use Kwiksher to create an interactive rules book app. That way I can tell the story/theme of the game along with the rules & faqs via the app.

    Is there a way to create dice in Kwiksher? My game requires special dice and an app that would allow users to “roll” virtual dice would save me a ton on printing/production costs.

    Administrator
    Keymaster
    #81341

    Natively Kwik does not offer any feature like the one you need. You will need to use external code to create your dice. Not a big deal but you will need to learn about random selection.

    If you want to create something without ANY code, you should try something like this (never tested but I believe it will work):
    – for example, if your dice has 2 numbers (just to facilitate the example), you create the image for number 1 and image for number 2 (in different layers);
    – Hide both layers;
    – create an action and call it dice1 (for the number 1). Set it like this:
    1) Hide layer 2 (the one with image of dice 2)
    2) Show layer 1 (the one with image of dice 1)
    – do the same for the dice2
    – create another action and name it dice
    – use the option Play Random (then enter the actions dice 1 and dice 2)

    in order to “play with the dice” you can create a button (or shake interaction) that calls the action dice (which will pick action dice1 or dice2)

    hope it helps

    DELIVERANCE98
    Participant
    #82613

    Hi, im intrested in a similar way to do it.
    I want to make a dice / card whatever of 8 or 10 posible outcomes, is it posible?
    should i follow some specific tutorial for that?
    Thank you.

    Administrator
    Keymaster
    #82620

    there is no tutorial for that. you will need to use external code for that. For example, externally to Kwik, create a .txt or .lua file with the following code:

    
    local dice = math.random(8)
    

    the math.random above will find a number between 1 and 8 and will keep it in the variable called dice.

    Then, create an action in Kwik and name it rollDice. Add the follwoing:

      CODE add external code above
      CONDITION if dice EQUAL 1
      do whatever you want to do if the dice is 1
      CONDITION ELSE if dice EQUAL 2
      do whatever you want to do if the dice is 2
      repeat it until dice equals 8
      CONDITION END IF
    DELIVERANCE98
    Participant
    #82808

    Thank you Alex!

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.