• 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.

DAILOG AND REPLACING UNITs

Status
Not open for further replies.
Level 5
Joined
Jul 31, 2004
Messages
108
Ok i got the dialog thing up but then it wont replace the unit heres wat i got so far


Events
Unit - A unit owned by Player 1 (Red) Gains a level
Conditions
And - All (Conditions) are true
Conditions
((Triggering unit) is A Hero) Equal to True
(Level of (Triggering unit)) Equal to 13
(Unit-type of (Triggering unit)) Equal to Child
Actions
Dialog - Create a dialog button for Dialog[1] labelled Human Evil
Set DialongButton[1] = (Last created dialog Button)
Dialog - Create a dialog button for Dialog[1] labelled Human Good
Set DialongButton[2] = (Last created dialog Button)
Dialog - Show Dialog[1] for Player 1 (Red)
Dialog - Change the title of Dialog[1] to Evil or Good?
If ((Clicked dialog button) Equal to DialongButton[1]) then do (Unit - Replace (Leveling Hero) with a Teen using The new unit's default life and mana) else do (Do nothing)
If ((Clicked dialog button) Equal to DialongButton[2]) then do (Unit - Replace (Leveling Hero) with a Bandit Teen using The new unit's default life and mana) else do (Do nothing)

Big and fun but it wont replace the unit y?
 
Level 9
Joined
Nov 27, 2004
Messages
465
if you want to stay it 1 big trigger , than put after showing a dialog the string such as:

Action:
wait with condition
^^ and as a condition use owner of leveling hero press the button of your dialog.
_________________________________________
Or you may the secondvariant is to make it like 2 different triggers.
1 trigger for showing your dialog after hero leveling up .
2 trigger for buttons
But with this configuration you will need to trigger all your heroes...
_________________________________________
 
Level 5
Joined
Jul 31, 2004
Messages
108
ik wat you said but it didnt work....y..??should i just remove teh unit and create a new1 and then wat about items..

Unit Human
Events
Unit - A unit owned by Player 1 (Red) Gains a level
Conditions
And - All (Conditions) are true
Conditions
((Triggering unit) is A Hero) Equal to True
(Level of (Leveling Hero)) Equal to 13
(Unit-type of (Triggering unit)) Equal to Child
Actions
Set hero[1] = (Leveling Hero)
Dialog - Create a dialog button for Dialog[1] labelled Human Evil
Set DialongButton[1] = (Last created dialog Button)
Dialog - Create a dialog button for Dialog[1] labelled Human Good
Set DialongButton[2] = (Last created dialog Button)
Dialog - Show Dialog[1] for Player 1 (Red)
Dialog - Change the title of Dialog[1] to Evil or Good?
Wait until ((DialongButton[1] Equal to (Clicked dialog button)) or (DialongButton[2] Equal to (Clicked dialog button))), checking every 0.10 seconds
If ((Clicked dialog button) Equal to DialongButton[1]) then do (Unit - Replace hero[1] with a Teen using The new unit's default life and mana) else do (Do nothing)
If ((Clicked dialog button) Equal to DialongButton[2]) then do (Unit - Replace hero[1] with a Bandit Teen using The new unit's default life and mana) else do (Do nothing)
 
Level 8
Joined
Apr 3, 2004
Messages
507
You should swap all (Triggering Unit)s for (Leveling Hero)s.

You need to cut the last two lines from this trigger and paste them into a new one.
Then give the new trigger a "Dialog button is clicked" event.

You'll have to set (Leveling Hero) to a variable in the first trigger in order to be able to reference that hero in the second trigger. Put that unit variable in place of the (Leveling Hero) responses in your second trigger.
 
Level 5
Joined
Jul 31, 2004
Messages
108
ok thanks ill try that ill say later if it works cause i am at school in comp class ty.

YAY but i aint sure if it is really setting unit[/quote]
 
Status
Not open for further replies.
Top