Hi, I recently asked for help on these forums to ask for a way to call for variables in a randomized checklist format. I've since made 2 changes and am faced with a trigger that is, for reasons that I cannot identify; inconsistent.
The changes are turning "Take the Questionnaire" (the thing being bought from the shop) from an Item to a Unit. This was to allow the shop to work flawlessly when adding and removing items to it through triggers, rather than having it stocked from the units page in the object editor.
The second change was adding the system that stops showing dialog boxes after the 7th question - "RQMaxQuestions[a]". Well, that's what it was supposed to do.
These are the triggers that I'm using:
Now, let me explain...
If I press the "Test Map" button in the world editor and launch the map, go to the shop, and buy the "take the questionnaire" unit from the shop (initializing the first trigger sequence) it will do nothing. If I purchase it again, it will do nothing. But on the THIRD purchase of that unit it will launch the trigger sequence. Now, that's a problem on it's own and I can't seem to understand why. But...
The way I've set it up it's meant to take 7 questions from any given player and on the 7th question it will run the calculations. However, it typically takes 6 answers before closing and therefore not running the calculations.
Now, if I launch WC3 and host a custom game with my map selected, go in as the only player and buy "Take the Questionnaire" it will provide inconsistent results. As in....
If I do the same thing here, run up to the shop and buy the same unit from the shop as before it works on the first purchase... However this time it only shows 3 questions before disappearing and not running the calculations trigger.
Mind you, the option "Use fixed random seed" is unchecked in the world editor preferences, so I really do not understand why it would make a difference how the map was launched.
I've bitten off more than I can chew here and it's starting to give me a headache. I would appreciate any help/suggestions.
The changes are turning "Take the Questionnaire" (the thing being bought from the shop) from an Item to a Unit. This was to allow the shop to work flawlessly when adding and removing items to it through triggers, rather than having it stocked from the units page in the object editor.
The second change was adding the system that stops showing dialog boxes after the 7th question - "RQMaxQuestions[a]". Well, that's what it was supposed to do.
These are the triggers that I'm using:
-
ShopQuestionnaireStart
-
Events
-
Unit - A unit Sells a unit
-
-
Conditions
-
(Unit-type of (Sold unit)) Equal to Take the Questionnaire
-
-
Actions
-
Set VariableSet RQThingPlayer = (Owner of (Buying unit))
-
Set VariableSet RQThingPlayerInteger = (Player number of RQThingPlayer)
-
Set VariableSet RQNotGivenCount = 0
-
Set VariableSet RQMaxQuestions[RQThingPlayerInteger] = 0
-
For each (Integer A) from 1 to RQMAX_THINGS, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(RQThingPlayer is in RQHasBeenGivenThing[(Integer A)].) Equal to False
-
-
Then - Actions
-
Set VariableSet RQNotGivenCount = (RQNotGivenCount + 1)
-
Set VariableSet RQRandomThing[RQNotGivenCount] = (Integer A)
-
-
Else - Actions
-
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
RQNotGivenCount Greater than 0
-
-
Then - Actions
-
Set VariableSet RQThingToGive = RQRandomThing[(Random integer number between 1 and RQNotGivenCount)]
-
Player Group - Add RQThingPlayer to RQHasBeenGivenThing[RQThingToGive]
-
Dialog - Show Race_Dialog[RQThingToGive] for RQThingPlayer
-
Set VariableSet RQMaxQuestions[RQThingPlayerInteger] = (RQMaxQuestions[RQThingPlayerInteger] + 1)
-
-
Else - Actions
-
-
Unit - Remove (Sold unit) from the game
-
-
-
RandomQuestions
-
Events
-
Dialog - A dialog button is clicked for Race_Dialog[1]
-
Dialog - A dialog button is clicked for Race_Dialog[2]
-
Dialog - A dialog button is clicked for Race_Dialog[3]
-
Dialog - A dialog button is clicked for Race_Dialog[4]
-
Dialog - A dialog button is clicked for Race_Dialog[5]
-
Dialog - A dialog button is clicked for Race_Dialog[6]
-
Dialog - A dialog button is clicked for Race_Dialog[7]
-
Dialog - A dialog button is clicked for Race_Dialog[8]
-
Dialog - A dialog button is clicked for Race_Dialog[9]
-
Dialog - A dialog button is clicked for Race_Dialog[10]
-
Dialog - A dialog button is clicked for Race_Dialog[11]
-
Dialog - A dialog button is clicked for Race_Dialog[12]
-
Dialog - A dialog button is clicked for Race_Dialog[13]
-
Dialog - A dialog button is clicked for Race_Dialog[14]
-
Dialog - A dialog button is clicked for Race_Dialog[15]
-
Dialog - A dialog button is clicked for Race_Dialog[16]
-
Dialog - A dialog button is clicked for Race_Dialog[17]
-
Dialog - A dialog button is clicked for Race_Dialog[18]
-
Dialog - A dialog button is clicked for Race_Dialog[19]
-
Dialog - A dialog button is clicked for Race_Dialog[20]
-
Dialog - A dialog button is clicked for Race_Dialog[21]
-
-
Conditions
-
Actions
-
Set VariableSet RQThingPlayer = (Triggering player)
-
Set VariableSet RQThingPlayerInteger = (Player number of RQThingPlayer)
-
Set VariableSet RQNotGivenCount = 0
-
For each (Integer A) from 1 to RQMAX_THINGS, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(RQThingPlayer is in RQHasBeenGivenThing[(Integer A)].) Equal to False
-
-
Then - Actions
-
Set VariableSet RQNotGivenCount = (RQNotGivenCount + 1)
-
Set VariableSet RQRandomThing[RQNotGivenCount] = (Integer A)
-
-
Else - Actions
-
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
RQNotGivenCount Greater than 0
-
RQMaxQuestions[RQThingPlayerInteger] Less than or equal to 7
-
-
Then - Actions
-
Set VariableSet RQThingToGive = RQRandomThing[(Random integer number between 1 and RQNotGivenCount)]
-
Player Group - Add RQThingPlayer to RQHasBeenGivenThing[RQThingToGive]
-
Dialog - Show Race_Dialog[RQThingToGive] for RQThingPlayer
-
Set VariableSet RQMaxQuestions[RQThingPlayerInteger] = (RQMaxQuestions[RQThingPlayerInteger] + 1)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
RQMaxQuestions[1] Greater than or equal to 8
-
-
Then - Actions
-
Trigger - Run Calculations P1 <gen> (ignoring conditions)
-
-
Else - Actions
-
-
-
-
-
Now, let me explain...
If I press the "Test Map" button in the world editor and launch the map, go to the shop, and buy the "take the questionnaire" unit from the shop (initializing the first trigger sequence) it will do nothing. If I purchase it again, it will do nothing. But on the THIRD purchase of that unit it will launch the trigger sequence. Now, that's a problem on it's own and I can't seem to understand why. But...
The way I've set it up it's meant to take 7 questions from any given player and on the 7th question it will run the calculations. However, it typically takes 6 answers before closing and therefore not running the calculations.
Now, if I launch WC3 and host a custom game with my map selected, go in as the only player and buy "Take the Questionnaire" it will provide inconsistent results. As in....
If I do the same thing here, run up to the shop and buy the same unit from the shop as before it works on the first purchase... However this time it only shows 3 questions before disappearing and not running the calculations trigger.
Mind you, the option "Use fixed random seed" is unchecked in the world editor preferences, so I really do not understand why it would make a difference how the map was launched.
I've bitten off more than I can chew here and it's starting to give me a headache. I would appreciate any help/suggestions.