• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Anyone can tell me why this random number keeps generating max number

Status
Not open for further replies.
Can someone tell me why this random number always generate the max number when I put it in this order. When I put QR_PackTargetPlaceRandomizer under condition 'QG_QuestDialogButtonClicked' or
'QG_Person[2] has buff Quest Indicator' it always generate the max number (3).

This problem doesn't make sense for me.

upload_2020-3-6_10-12-58.png

  • Quest Repeatable Deliveryman
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Interact - Both (Chain Lightning - Neutral Hostile)
          • (Unit-type of (Target unit of ability being cast)) Equal to Knight
    • Actions
      • Set QG_Person[1] = Global_MainHero
      • Set QG_Person[2] = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (QG_Person[2] has buff Quest Indicator ) Equal to True
        • Then - Actions
          • Cinematic - Turn cinematic mode On for (All players)
          • Cinematic - Enable user control for (All players)
          • Unit - Make QG_Person[1] face QG_Person[2] over 0.00 seconds
          • Unit - Make QG_Person[2] face QG_Person[1] over 0.00 seconds
          • Unit - Pause QG_Person[2]
          • -------- --------
          • -------- Conversation --------
          • Cinematic - Flash a speech indicator for QG_Person[1] of color (100.00%, 100.00%, 0.00%) with 0.00% transparency
          • Cinematic - Send transmission to (All players) from QG_Person[1] named (Name of QG_Person[1]): Play No sound and display I hear that you hav.... Modify duration: Set to 1.00 seconds and Wait
          • -------- --------
          • -------- Conversation --------
          • Cinematic - Flash a speech indicator for QG_Person[1] of color (100.00%, 100.00%, 0.00%) with 0.00% transparency
          • Cinematic - Send transmission to (Player group(Player 1 (Red))) from QG_Person[2] named (Name of QG_Person[2]): Play No sound and display Yes. Can you delive.... Modify duration: Set to 1.00 seconds and Wait
          • -------- --------
          • -------- Create dialog --------
          • Dialog - Clear QG_QuestAcceptDialog
          • Dialog - Change the title of QG_QuestAcceptDialog to Delivery Sidequest
          • Dialog - Create a dialog button for QG_QuestAcceptDialog labelled Accept
          • Set QG_QuestAcceptDialogButton[1] = (Last created dialog Button)
          • Dialog - Create a dialog button for QG_QuestAcceptDialog labelled Ignore
          • Set QG_QuestAcceptDialogButton[9] = (Last created dialog Button)
          • Dialog - Show QG_QuestAcceptDialog for Player 1 (Red)
          • Set QG_QuestDialogButtonClicked = 0
          • Wait until (QG_QuestDialogButtonClicked Not equal to 0), checking every 0.10 seconds
          • -------- --------
          • -------- Here's where player picks whether he approves or disapproves the quest --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • QG_QuestDialogButtonClicked Equal to 1
            • Then - Actions
              • Set QR_PackTargetPlaceRandomizer = (Random integer number between 1 and QR_PackTargetPlaceMax)
              • Game - Display to (All players) the text: (String(QR_PackTargetPlaceRandomizer))
              • Unit - Create 1 Siege Engine for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing 270.00 degrees
              • Set QR_PackUnit = (Last created unit)
              • Unit - Create 1 Beacon for Player 1 (Red) at (Center of QR_PackTargetRegions[QR_PackTargetPlaceRandomizer]) facing Default building facing degrees
              • Set QR_PackBeaconUnit = (Last created unit)
              • -------- --------
              • Unit - Remove Quest Indicator from QG_Person[2]
              • Unit Group - Add QG_Person[2] to QG_DoneUnitGroup
              • -------- --------
              • Cinematic - Flash a speech indicator for QG_Person[1] of color (100.00%, 100.00%, 100.00%) with 0.00% transparency
              • Cinematic - Send transmission to (All players) from QG_Person[1] named (Name of QG_Person[1]): Play No sound and display Got it.. Modify duration: Set to 1.00 seconds and Wait
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • QG_QuestDialogButtonClicked Equal to 9
                • Then - Actions
                  • Cinematic - Flash a speech indicator for QG_Person[1] of color (100.00%, 100.00%, 100.00%) with 0.00% transparency
                  • Cinematic - Send transmission to (All players) from QG_Person[1] named (Name of QG_Person[1]): Play No sound and display Pass.. Modify duration: Set to 2.00 seconds and Wait
                • Else - Actions
          • Unit - Unpause QG_Person[2]
          • Cinematic - Turn cinematic mode Off for (All players)
        • Else - Actions
But when I put QR_PackTargetPlaceRandomizer below action 'QG_Person[2]' it generates random number properly (1 ~ 3)

  • Quest Repeatable Deliveryman
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Interact - Both (Chain Lightning - Neutral Hostile)
          • (Unit-type of (Target unit of ability being cast)) Equal to Knight
    • Actions
      • Set QG_Person[1] = Global_MainHero
      • Set QG_Person[2] = (Target unit of ability being cast)
      • Set QR_PackTargetPlaceRandomizer = (Random integer number between 1 and QR_PackTargetPlaceMax)
      • Game - Display to (All players) the text: (String(QR_PackTargetPlaceRandomizer))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (QG_Person[2] has buff Quest Indicator ) Equal to True
        • Then - Actions
          • Cinematic - Turn cinematic mode On for (All players)
          • Cinematic - Enable user control for (All players)
          • Unit - Make QG_Person[1] face QG_Person[2] over 0.00 seconds
          • Unit - Make QG_Person[2] face QG_Person[1] over 0.00 seconds
          • Unit - Pause QG_Person[2]
          • -------- --------
          • -------- Conversation --------
          • Cinematic - Flash a speech indicator for QG_Person[1] of color (100.00%, 100.00%, 0.00%) with 0.00% transparency
          • Cinematic - Send transmission to (All players) from QG_Person[1] named (Name of QG_Person[1]): Play No sound and display I hear that you hav.... Modify duration: Set to 1.00 seconds and Wait
          • -------- --------
          • -------- Conversation --------
          • Cinematic - Flash a speech indicator for QG_Person[1] of color (100.00%, 100.00%, 0.00%) with 0.00% transparency
          • Cinematic - Send transmission to (Player group(Player 1 (Red))) from QG_Person[2] named (Name of QG_Person[2]): Play No sound and display Yes. Can you delive.... Modify duration: Set to 1.00 seconds and Wait
          • -------- --------
          • -------- Create dialog --------
          • Dialog - Clear QG_QuestAcceptDialog
          • Dialog - Change the title of QG_QuestAcceptDialog to Delivery Sidequest
          • Dialog - Create a dialog button for QG_QuestAcceptDialog labelled Accept
          • Set QG_QuestAcceptDialogButton[1] = (Last created dialog Button)
          • Dialog - Create a dialog button for QG_QuestAcceptDialog labelled Ignore
          • Set QG_QuestAcceptDialogButton[9] = (Last created dialog Button)
          • Dialog - Show QG_QuestAcceptDialog for Player 1 (Red)
          • Set QG_QuestDialogButtonClicked = 0
          • Wait until (QG_QuestDialogButtonClicked Not equal to 0), checking every 0.10 seconds
          • -------- --------
          • -------- Here's where player picks whether he approves or disapproves the quest --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • QG_QuestDialogButtonClicked Equal to 1
            • Then - Actions
              • Unit - Create 1 Siege Engine for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing 270.00 degrees
              • Set QR_PackUnit = (Last created unit)
              • Unit - Create 1 Beacon for Player 1 (Red) at (Center of QR_PackTargetRegions[QR_PackTargetPlaceRandomizer]) facing Default building facing degrees
              • Set QR_PackBeaconUnit = (Last created unit)
              • -------- --------
              • Unit - Remove Quest Indicator from QG_Person[2]
              • Unit Group - Add QG_Person[2] to QG_DoneUnitGroup
              • -------- --------
              • Cinematic - Flash a speech indicator for QG_Person[1] of color (100.00%, 100.00%, 100.00%) with 0.00% transparency
              • Cinematic - Send transmission to (All players) from QG_Person[1] named (Name of QG_Person[1]): Play No sound and display Got it.. Modify duration: Set to 1.00 seconds and Wait
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • QG_QuestDialogButtonClicked Equal to 9
                • Then - Actions
                  • Cinematic - Flash a speech indicator for QG_Person[1] of color (100.00%, 100.00%, 100.00%) with 0.00% transparency
                  • Cinematic - Send transmission to (All players) from QG_Person[1] named (Name of QG_Person[1]): Play No sound and display Pass.. Modify duration: Set to 2.00 seconds and Wait
                • Else - Actions
          • Unit - Unpause QG_Person[2]
          • Cinematic - Turn cinematic mode Off for (All players)
        • Else - Actions
(Extra trigger - unrelated to the problem but is used in this trigger)

  • Side Quest Dialog Button Click
    • Events
      • Dialog - A dialog button is clicked for QG_QuestAcceptDialog
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to QG_QuestAcceptDialogButton[1]
        • Then - Actions
          • Set QG_QuestDialogButtonClicked = 1
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to QG_QuestAcceptDialogButton[9]
        • Then - Actions
          • Set QG_QuestDialogButtonClicked = 9
        • Else - Actions

Note: Don't mind the point leaks this is just a trigger from a test map I can fix it later.
 
Last edited:
World Editor defaults to fixed seed (same RNG output sequence) when testing maps.

I have Preference > Test Map > Use Fixed Random Seed disabled.

Additionally enabling cinematic mode will also set RNG seed to a consistent value until disabled.

Sooo maybe this is the reason why. I've been testing this for 4 hours just to realize this is a thing.

Thanks DSG. :)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,285
Sooo maybe this is the reason why. I've been testing this for 4 hours just to realize this is a thing.
This is needed so that cinematics are reliable as the results of every action are consistent. It would have been silly if the campaign cinematics could be messed up by bad RNG rolls causing key heroes and units to appear to die during them.
 
Status
Not open for further replies.
Top