HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Dialogue Box Help

03-30-2010, 04:58 AM#1
BuRnInSpartan
Ok so I have this trigger and its working fine except for the replacement of the unit after a selection in the dialogue box has been made. When I select swordsman it does not replace my current unit with the uther (swordsman unit) at all.
Trigger:
Profession
Collapse Events
Unit - A unit enters Profession <gen>
Collapse Conditions
(Owner of (Entering unit)) Not equal to Player 12 (Brown)
Collapse Actions
Game - Pause the game
Cinematic - Turn cinematic mode On for (All players)
Camera - Pan camera for (Picked player) to (Position of Captain Gene 0037 <gen>) over 0.00 seconds
Cinematic - Send transmission to (All players) from Captain Gene 0037 <gen> named Captain Gene: Play No sound and display Greetings soldiers!.... Modify duration: Add 10.00 seconds and Wait
Cinematic - Turn cinematic mode Off for (All players)
Game - Unpause the game
Collapse Player Group - Pick every player in Soldiers and do (Actions)
Collapse Loop - Actions
Dialog - Create a dialog button for Profession labelled Swordsman
Set Swordsman = (Last created dialog Button)
Dialog - Show Profession for (Picked player)
Trigger - Destroy (This trigger)
Trigger:
Profession Picks
Collapse Events
Dialog - A dialog button is clicked for Profession
Collapse Conditions
(Clicked dialog button) Equal to Swordsman
Collapse Actions
Unit - Replace Player_1 with a Uther using The new unit's max life and mana
Game - Display to (All players) the text: ((Name of (Owner of Player_1)) + has selected a Swordsman!)
Dialog - Hide Profession for Player 1 (Red)
03-30-2010, 05:23 AM#2
TheKid
Does "Game - Display to (All players)..." display the correct output?
03-30-2010, 05:26 AM#3
BuRnInSpartan
ah ok i did it in the beginning

Trigger:
Identify
Collapse Events
Player - Player 1 (Red) types a chat message containing (Name of Player 1 (Red)) as An exact match
Conditions
Collapse Actions
Unit - Create 1 Soldier for Player 1 (Red) at (Center of Start <gen>) facing Default building facing (270.0) degrees
Set Player_1 = (Last created unit)
Unit Group - Add Player_1 to SoldiersGroup
Game - Display to (All players) the text: ((Name of (Owner of Player_1)) + reporting for duty!)
Special Effect - Create a special effect at (Position of Player_1) using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
Wait 2.00 seconds
Special Effect - Destroy (Last created special effect)
03-30-2010, 05:31 AM#4
BuRnInSpartan
no it doesn't say anything either. anyone else have any ideas?
04-01-2010, 01:32 AM#5
BuRnInSpartan
anyone?
04-01-2010, 05:05 AM#6
TheKid
Does it say anything if you put the message at the very beginning of the trigger? If not then your trigger is disabled or not running for some reason. If so then the thread is being stopped at a point between where the game message will display and where it won't.

Put game messages after every line, and take note of the ones that are displayed and which ones aren't. If one of them doesn't run, then the rest won't (because the thread is killed) in which case there is a problem is something you are doing.

Put those messages and share your results on where the game message stops working.
04-04-2010, 10:05 PM#7
BuRnInSpartan
yea it doesn't say anything. it closes the dialogue box but doesn't say game message or replace the hero.
04-05-2010, 04:57 AM#8
TheKid
Where do you set up your dialog box?
04-07-2010, 08:46 PM#9
BuRnInSpartan
my box is set up in my first post. in that trigger.
04-09-2010, 05:19 AM#10
[VDM]Amn
man, wait a sec. i've never tried to trigger-replace a unit before but
arent you trying to replace a simple unit with a Hero ?

that may be the problem
if not, just remove the unit and create your Uther guy there and that's it
just try not to get stuck in small things like this

later
04-09-2010, 05:35 AM#11
Ammorth
Your problem is the "Player Group - Pick every player in Soldiers and do (Actions) " part. Change it to this:

Trigger:
Profession
Collapse Events
Unit - A unit enters Profession <gen>
Collapse Conditions
(Owner of (Entering unit)) Not equal to Player 12 (Brown)
Collapse Actions
Game - Pause the game
Cinematic - Turn cinematic mode On for (All players)
Camera - Pan camera for (Picked player) to (Position of Captain Gene 0037 <gen>) over 0.00 seconds
Cinematic - Send transmission to (All players) from Captain Gene 0037 <gen> named Captain Gene: Play No sound and display Greetings soldiers!.... Modify duration: Add 10.00 seconds and Wait
Cinematic - Turn cinematic mode Off for (All players)
Game - Unpause the game
Dialog - Create a dialog button for Profession labelled Swordsman
Set Swordsman = (Last created dialog Button)
Collapse Player Group - Pick every player in Soldiers and do (Actions)
Collapse Loop - Actions
Dialog - Show Profession for (Picked player)
Trigger - Destroy (This trigger)

what you were doing was creating as many buttons as soldiers, and changing your Swordsman variable. Therefor when your button trigger fired, the variable was not equal to the button.

Replace unit in GUI removes the old unit and creates a new unit based on the position and health/mana of the old unit. There is nothing stopping it from replacing heros with units or units with heros.
04-09-2010, 06:14 AM#12
[VDM]Amn
Quote:
Originally Posted by Ammorth
Therefor when your button trigger fired, the variable was not equal to the button
it cant be, he says the Dialog hides, and the Hide Action is in the trigger
04-09-2010, 10:49 AM#13
Won-Qu
Trigger:
Set Soldiers =...
You've got this somewhere? Or maybe:
Trigger:
Player Group - Add Player X to Soldiers
04-09-2010, 03:00 PM#14
Ammorth
Quote:
Originally Posted by [VDM]Amn
it cant be, he says the Dialog hides, and the Hide Action is in the trigger

Dialogs hide when they are clicked. This is a native feature.