Skip to content

Scripting randomnized results in weidu

Wizer13Wizer13 Member Posts: 65
Hi all, been a while since I asked something but need to figure this out. Ive read in a previous tutorial that we can randomnize the results of an event, let's say a roll of dice. The script was basically like this:

IF
Global("dice","global",1)
THEN
RESPONSE #100
Result #1
THEN
RESPONSE #100
Result#2
THEN
RESPONSE #100
Result #3

Etc.

It said that by scripting a serie of "THEN RESPONSE#100" before putting END, it would split the chances of happening. In the case of a roll of dice, it would happen 16,67% of the time for each.

Problem is, when i verify with Weidu, it tells there's an error since there's this serie of "THEN RESPONSE #100" before the END. I surely did an error somewhere or the tutorial wasn't good.

If so, how would you script a random result in Weidu? Thanks for your time!

Comments

  • jasteyjastey Member Posts: 2,673
    edited July 2019
    This should compile without errors:
    IF
    Global("dice","global",1)
    THEN
    RESPONSE #100
    Result #1
    RESPONSE #100
    Result#2
    RESPONSE #100
    Result #3
    ...
    END
    
    Siege of Dragonspear uses this a lot to randomize character reactions.
  • Wizer13Wizer13 Member Posts: 65
    Thank you! Ill try! ?
Sign In or Register to comment.