HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Set unit=variable problem

08-17-2004, 11:33 AM#1
Arkidas
ok Im making a duel system and heres the trigger when player have accepted the duel,the problem is that duel hero 2 isn't moving to the duel arena ok here you go: NOTE: Duel hero 1 is unit owned by player that invited the other one for a duel.

Code:
Duel Accept
    Events
        Dialog - A dialog button is clicked for DuelDialogInvited
    Conditions
        (Clicked dialog button) Equal to DialogButtons[12]
    Actions
        Game - Display to (All players) the text: ((Name of (Triggering player)) +  has accepted the duel invitation)
        Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Set DuelingHeros[2] = (Picked unit))
        Wait 2.00 seconds
        Game - Display to (All players) the text: Feel free to watch ...
        Cinematic - Ping minimap for (All players) at (Center of Duel Arena <gen>) for 5.00 seconds
        Wait 3.00 seconds
        Unit - Move DuelingHeros[1] instantly to (Center of Duel Hero 1 <gen>), facing (Center of (Playable map area))
        Unit - Move DuelingHeros[2] instantly to (Center of Duel Hero 2 <gen>), facing (Center of (Playable map area))
        Unit - Set life of DuelingHeros[1] to 100.00%
        Unit - Set mana of DuelingHeros[1] to 100.00%
        Unit - Set life of DuelingHeros[2] to 100.00%
        Unit - Set mana of DuelingHeros[2] to 100.00%
        Game - Display to (All players) the text: Duel starting in 20...
        Countdown Timer - Create a timer window for DuelTimer with title Duel
        Countdown Timer - Start DuelTimer as a One-shot timer that will expire in 20.00 seconds
        Cinematic - Enable user control for (All players)
        Cinematic - Enable user control for (All players)
        Camera - Pan camera for (Owner of DuelingHeros[1]) to (Center of Duel Hero 1 <gen>) over 2.00 seconds
        Camera - Pan camera for (Owner of DuelingHeros[2]) to (Center of Duel Hero 2 <gen>) over 2.00 seconds
        Wait 20.00 seconds
        Countdown Timer - Destroy (Last created timer window)
        Cinematic - Enable user control for (All players)
        Game - Display to (All players) the text: The duel starts now...
        Trigger - Turn on Duel Hero 1 Dies <gen>
        Trigger - Turn on Duel Hero 2 Dies <gen>
        Player - Make (Owner of DuelingHeros[1]) treat (Owner of DuelingHeros[2]) as an Enemy
        Player - Make (Owner of DuelingHeros[2]) treat (Owner of DuelingHeros[1]) as an Enemy
08-17-2004, 02:17 PM#2
Sneaky-Sebbe
I just need to ask. Triggering player in this case is the player who clicked the dialog button, right???
08-17-2004, 02:48 PM#3
LegolasArcher
I would personally have an array that holds the heros that can duel. Then you get just pull a:

Code:
 set DuelUnit[2] = Heros[PlayerNumber(GetTriggeringPlayer())]