HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Quest System Set Up

05-02-2005, 05:43 AM#1
Zero
Ok, this is the current system I have set up:

Code:
[b]Warrior Optional Quest 01 Set Up[/b]
    Events
        Unit - A unit Uses an item
    Conditions
        (Item-type of (Item being manipulated)) Equal to |c0015ca2cWarrior|r |cffffcc00Training|r
        Quests_Warrior01 Equal to False
    Actions
        Set Quests_Warrior01 = True
        Special Effect - Create a special effect attached to the overhead of Warrior Master 0004 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
        Set Special_Effects_Warrior_01 = (Last created special effect)
        Trigger - Turn off (This trigger)

Code:
[b]Warrior Optional Quest 01 Acquired[/b]
    Events
        Player - Player 1 (Red) Selects a unit
        Player - Player 2 (Blue) Selects a unit
        Player - Player 3 (Teal) Selects a unit
        Player - Player 4 (Purple) Selects a unit
        Player - Player 5 (Yellow) Selects a unit
        Player - Player 6 (Orange) Selects a unit
    Conditions
        (Triggering unit) Equal to Warrior Master 0004 <gen>
        Quests_Warrior01 Equal to True
        (Number of units in (Units in (Playable map area)(((Unit-type of (Matching unit)) Equal to Mag Bearmaul (Warrior Tier 1 Hero)) and ((Owner of (Matching unit)) Equal to (Triggering player))))) Greater than or equal to 1
    Actions
        Trigger - Turn off (This trigger)
        Set Quests_Wolf_Leaderboarder = 10
        Set Quests_Reset_Warrior = True
        Set Quests_Warrior_Player = (Triggering player)
        Special Effect - Destroy Special_Effects_Warrior_01
        Game - Display to (Triggering player), at offset (0.00, 0.00) for 16.00 seconds the text: |c00f9f900Warrior M...
        Wait 16.00 game-time seconds
        Quest - Create a Optional quest titled Wolf Hunting with the description |c00ff2020WARRIOR O..., using icon path ReplaceableTextures\CommandButtons\BTNTimberWolf.blp
        Set Quests_Log_Warrior_01 = (Last created quest)
        Quest - Enable (Last created quest)
        Sound - Play QuestNew <gen> at 100.00% volume, located at (Position of Warrior Master 0004 <gen>) with Z offset 0.00
        Game - Display to (Triggering player), at offset (0.00, 0.00) for 10.00 seconds the text: |c00f9f900NEW QUEST...
        Quest - Flash the quest dialog button
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Triggering player) Equal to Player 1 (Red)
            Then - Actions
                Leaderboard - Create a leaderboard for Player Group - Player 1 (Red) titled Wolf Hunt:
                Set Leaderboarder_Warrior_01 = (Last created leaderboard)
                Leaderboard - Show (Last created leaderboard)
                Leaderboard - Add (Triggering player) to (Last created leaderboard) with label Wolves Remaining and value Quests_Wolf_Leaderboarder
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Triggering player) Equal to Player 2 (Blue)
            Then - Actions
                Leaderboard - Create a leaderboard for Player Group - Player 2 (Blue) titled Wolf Hunt:
                Set Leaderboarder_Warrior_01 = (Last created leaderboard)
                Leaderboard - Show (Last created leaderboard)
                Leaderboard - Add (Triggering player) to (Last created leaderboard) with label Wolves Remaining and value Quests_Wolf_Leaderboarder
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Triggering player) Equal to Player 3 (Teal)
            Then - Actions
                Leaderboard - Create a leaderboard for Player Group - Player 3 (Teal) titled Wolf Hunt:
                Set Leaderboarder_Warrior_01 = (Last created leaderboard)
                Leaderboard - Show (Last created leaderboard)
                Leaderboard - Add (Triggering player) to (Last created leaderboard) with label Wolves Remaining and value Quests_Wolf_Leaderboarder
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Triggering player) Equal to Player 4 (Purple)
            Then - Actions
                Leaderboard - Create a leaderboard for Player Group - Player 4 (Purple) titled Wolf Hunt:
                Set Leaderboarder_Warrior_01 = (Last created leaderboard)
                Leaderboard - Show (Last created leaderboard)
                Leaderboard - Add (Triggering player) to (Last created leaderboard) with label Wolves Remaining and value Quests_Wolf_Leaderboarder
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Triggering player) Equal to Player 5 (Yellow)
            Then - Actions
                Leaderboard - Create a leaderboard for Player Group - Player 5 (Yellow) titled Wolf Hunt:
                Set Leaderboarder_Warrior_01 = (Last created leaderboard)
                Leaderboard - Show (Last created leaderboard)
                Leaderboard - Add (Triggering player) to (Last created leaderboard) with label Wolves Remaining and value Quests_Wolf_Leaderboarder
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Triggering player) Equal to Player 6 (Orange)
            Then - Actions
                Leaderboard - Create a leaderboard for Player Group - Player 6 (Orange) titled Wolf Hunt:
                Set Leaderboarder_Warrior_01 = (Last created leaderboard)
                Leaderboard - Show (Last created leaderboard)
                Leaderboard - Add (Triggering player) to (Last created leaderboard) with label Wolves Remaining and value Quests_Wolf_Leaderboarder
            Else - Actions
                Do nothing

Code:
[b]Warrior Optional Quest 01 Kills[/b] 
    Events
        Unit - A unit owned by Neutral Hostile Dies
    Conditions
        Quests_Warrior01 Equal to True
        (((Killing unit) is A Hero) Equal to True) or (((Killing unit) is Summoned) Equal to True)
        ((Unit-type of (Dying unit)) Equal to Frost Wolf (Lv 02)) or ((Unit-type of (Dying unit)) Equal to Timber Wolf (Lv 02))
        (Owner of (Killing unit)) Equal to Quests_Warrior_Player
    Actions
        Set Quests_Wolf_Leaderboarder = (Quests_Wolf_Leaderboarder - 1)
        Leaderboard - Change the value for Quests_Warrior_Player in Leaderboarder_Warrior_01 to Quests_Wolf_Leaderboarder

Code:
[b]Warrior Optional Quest 01 Check[/b]
    Events
        Time - Every 0.10 seconds of game time
    Conditions
        Quests_Warrior01 Equal to True
        Quests_Wolf_Leaderboarder Equal to 0
    Actions
        Trigger - Turn off (This trigger)
        Trigger - Turn off Warrior Optional Quest 01 Kills <gen>
        Leaderboard - Destroy Leaderboarder_Warrior_01
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) is A Hero) Equal to True
                        (Owner of (Picked unit)) Equal to Quests_Warrior_Player
                    Then - Actions
                        Sound - Play QuestNew <gen> at 100.00% volume, located at (Position of (Picked unit)) with Z offset 0.00
                        Game - Display to Quests_Warrior_Player, at offset (0.00, 0.00) for 10.00 seconds the text: |c00f9f900QUEST UPD...
                        Quest - Change the description of Quests_Log_Warrior_01 to |c00ff2020WARRIOR O...
                        Quest - Flash the quest dialog button
                        Special Effect - Create a special effect attached to the overhead of Warrior Master 0004 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
                        Set Special_Effects_Warrior_01 = (Last created special effect)
                    Else - Actions
                        Do nothing

Code:
[b]Warrior Optional Quest 01 Complete[/b]
    Events
        Player - Player 1 (Red) Selects a unit
        Player - Player 2 (Blue) Selects a unit
        Player - Player 3 (Teal) Selects a unit
        Player - Player 4 (Purple) Selects a unit
        Player - Player 5 (Yellow) Selects a unit
        Player - Player 6 (Orange) Selects a unit
    Conditions
        (Triggering unit) Equal to Warrior Master 0004 <gen>
        Quests_Warrior01 Equal to True
        Quests_Wolf_Leaderboarder Equal to 0
        (Triggering player) Equal to Quests_Warrior_Player
    Actions
        Trigger - Turn off (This trigger)
        Special Effect - Destroy Special_Effects_Warrior_01
        Game - Display to (Triggering player), at offset (0.00, 0.00) for 15.00 seconds the text: |c00f9f900Warrior M...
        Wait 15.00 game-time seconds
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) is A Hero) Equal to True
                        (Owner of (Picked unit)) Equal to Quests_Warrior_Player
                    Then - Actions
                        Sound - Play QuestCompleted <gen> at 100.00% volume, located at (Position of (Picked unit)) with Z offset 0.00
                        Game - Display to Quests_Warrior_Player, at offset (0.00, 0.00) for 10.00 seconds the text: |c00f9f900QUEST COM...
                        Quest - Mark Quests_Log_Warrior_01 as Completed
                        Quest - Flash the quest dialog button
                        Hero - Add 500 experience to (Picked unit), Show level-up graphics
                        Item - Create |c0000ff40Taser Sword|r at (Position of (Picked unit))
                        Hero - Give (Last created item) to (Picked unit)
                    Else - Actions
                        Do nothing
        Wait 60.00 game-time seconds
        Special Effect - Create a special effect attached to the overhead of Warrior Master 0004 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
        Set Special_Effects_Warrior_01 = (Last created special effect)
        Set Quests_Warrior02 = True
        Set Quests_Reset_Warrior = False

Then for reseting the quests:

Code:
[b]Player Leave P1[/b]
    Events
        Player - Player 1 (Red) leaves the game
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                P1_Left Equal to False
            Then - Actions
                Set P1_Left = True
                Set numplayers = (numplayers - 1)
            Else - Actions
                Do nothing
        Game - Display to (All players) the text: ((Name of Player 1 (Red)) +  couldn't handle the pressure and bailed out! Full Shared Unit Control is now enabled for all remaining players and all uncompleted quests they were in have been reset.)
        Player - For Player 1 (Red), turn Shared units On toward Player 2 (Blue)
        Player - For Player 1 (Red), turn Shared units On toward Player 3 (Teal)
        Player - For Player 1 (Red), turn Shared units On toward Player 4 (Purple)
        Player - For Player 1 (Red), turn Shared units On toward Player 5 (Yellow)
        Player - For Player 1 (Red), turn Shared units On toward Player 6 (Orange)
        -------- -----------------------------Reset Quests----------------------------- --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Quests_Reset_Warrior Equal to True
                Quests_Warrior02 Equal to False
                (Triggering player) Equal to Quests_Warrior_Player
            Then - Actions
                Set Quests_Reset_Warrior = False
                Trigger - Turn on Warrior Optional Quest 01 Set Up <gen>
                Trigger - Turn on Warrior Optional Quest 01 Acquired <gen>
                Trigger - Turn on Warrior Optional Quest 01 Kills <gen>
                Trigger - Turn on Warrior Optional Quest 01 Check <gen>
                Trigger - Turn on Warrior Optional Quest 01 Complete <gen>
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Quests_Reset_Ranger Equal to True
                Quests_Ranger02 Equal to False
                (Triggering player) Equal to Quests_Ranger_Player
            Then - Actions
                Set Quests_Reset_Ranger = False
                Trigger - Turn on Ranger Optional Quest 01 Set Up <gen>
                Trigger - Turn on Ranger Optional Quest 01 Acquired <gen>
                Trigger - Turn on Ranger Optional Quest 01 Burrow Spider <gen>
                Trigger - Turn on Ranger Optional Quest 01 Unburrow Spider <gen>
                Trigger - Turn on Ranger Optional Quest 01 Check <gen>
            Else - Actions
                Do nothing
        Trigger - Destroy (This trigger)

This trigger repeats for the remaining five players.

OK! Now, how this system is set up for those that don't understand it:

I have some class specifc quests and the above triggers are for the warrior. I have it set up so that since the quest only fires once, for lets say the warrior, that if the quest is active for player 1 and he leaves before finishing the quest, the quest resets it self and is now open for anyone else.

Now, what I need help with. This system works fine if I want to leave it like this..
Well, I don't :o

I want to make it so that if you choose warrior to play as, the triggers set up for your quests. Well, I want to make it so that you HAVE to complete let's say five quests for the warrior before you can advance to a tier 2 hero. This is fine and whatnot.. The only problem now is, the quest will only fire once, and will only fire for one player...

What if there is two players that are playing as the warrior... Now only one will be able to advance... Also, what if you play as a theif, and do one quest. THen after the quest is done, you switch classes to a ranger. Well, then let's say another player wants to pick up the theif. He can no longer do the first quest because it was done by the other player and can no longer advance...

I REALLY DO NOT want to make an individual quest trigger for EACH player in the game. Is there a way I can do this, so, it will work with the current triggers I have? Changning a few things here and there if needed?

Someone help me plz before I loose it
05-02-2005, 06:21 PM#2
Linera
please use the command in the forums when posting a trigger in your post. It makes it easier to read.
05-03-2005, 06:13 AM#3
Zero
How?
I don't know what you're talking about.. Where is that option and I will :p
05-03-2005, 06:37 AM#4
Raptor--
Quote:
Originally Posted by Zero
How?
I don't know what you're talking about.. Where is that option and I will :p

[-code][-/code] without the -'s
05-03-2005, 06:50 AM#5
Anitarf
You still don't use variable arrays. They are your friend, learn to use them. With them, you can easily multi-instance many things. In your case, I suppose you could solve things by making all your quest variables arrays so you can store leaderboards/wolfkills to them for every player. Some triggers would need some adjusting to work for all players, and you could even optimize some triggers that are now copied for each player. You can look at a simple example of using variable arrays in the triggered spells in my EoW map, for example, and certainly in many other maps as well.
05-03-2005, 06:08 PM#6
Zero
Thanks for the info on the code thing :)

Anitarf, I will look into this, assuming your era of war is unprotected...

Thx for the info :)
05-04-2005, 04:46 PM#7
Zero
This is so wierd. The only time I use arrays is for monster spawning and item drops. Sigh, allthough, it should be similair.

Givin it a shot :o

EDIT:

Hey Anitarf, could you show me in trigger format how I would set one of these triggers up using arrays.

For example, the "Warrior Optional Quest 01 Acquired" trigger.

It is just to make sure I understand these correctly. Thank you
05-04-2005, 06:17 PM#8
Anitarf
Waahhh, it's not so simple. The trigger structure is such that I can't find a way to easily convert it, it will have to be written from the ground up.

Some thoughts for starters: when you create the special effect (the one above the trainer's head), all players will be able to see it, not just the warrior one. Same goes for the quests you create, all players can see the same quests. You can create special effects for a single player using GetLocalPlayer(), but I don't know if it can be used with any of the quest functions without desyncing the game. OK, let's get down to triggers, we'll worry about all this later.

For starters, any quest related variables should be turned into arrays, so they'll be able to hold quest information for every player. So, for example, Quests_Wolf_Leaderboarder[1] will hold the number of wolves for player 1, Quests_Wolf_Leaderboarder[2] for player 2 etc... In the triggers, you can then use the "player number" integer function to get the right index, for example: in the "Warrior Optional Quest 01 Acquired" trigger, you would use Quests_Wolf_Leaderboarder[(player number of (triggering player))]. That way, no matter who the triggering player would be, the same trigger would write to the right array index.

This is the obvious problem with the trigger architecture I mentioned before. As it is now, you turn triggers on and off depending on what stage the quest is, but if you want to multi-instance the whole system, all triggers must be on all the time, because different players may be at different stages, and you have the same triggers working for all players. So, obviously, you would need a variable array that will store information about which quest each player is doing.

You can use the already existing variables for that, for example, if Quests_Wolf_Leaderboarder[1] is equal to 11, then the player doesn't have the quest yet, once it's set to 10, the player has acquired the quest, and when it becomes 0, the player has completed the quest. Then, you can use if-then-else statements in your quest triggers to determine inf that trigger should do it's actions or not. If, for example, player 4 has already completed the wolf quest, then Quests_Wolf_Leaderboarder[4] would be equal to 0, and because it wouldn't be equal to 11, the "Warrior Optional Quest 01 Acquired" trigger wouldn't set up the quest for that player, however, some other trigger would set up the next quest.

Well, these are the basics. Just one more thing, you can further optimize your variables when you use arrays. For example, I'm sure there will be other quests that require an integer variable. Instead of creating a new variable for each trigger and then having a bunch of variables like Quests_Wolf_Leaderboarder[], you can just make a single Quest_Integer_Variable[] and then use indexes from 1 to 6 to store the number of wolves killed and indexes 7 to 12 for some other quest... To do that, just use Quest_Integer_Variable[(6 + (Player number of (triggering player)))] in the next quest, and Quest_Integer_Variable[(12 + (Player number of (triggering player)))] in the quest after that.
05-04-2005, 08:05 PM#9
Zero
Ok, I changed everything into arrays and am still having some issues. This is what the current triggers look like:

Code:
Warrior Optional Quest 01 Set Up
    Events
        Unit - A unit Uses an item
    Conditions
        (Item-type of (Item being manipulated)) Equal to |c0015ca2cWarrior|r |cffffcc00Training|r
        Quests_Warrior01[(Player number of (Triggering player))] Equal to False
    Actions
        Set Quests_Warrior01[(Player number of (Triggering player))] = True
        Special Effect - Create a special effect attached to the overhead of Naga Sea Witch 0007 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
        Set Special_Effects_Warrior_01[(Player number of (Triggering player))] = (Last created special effect)

Code:
Warrior Optional Quest 01 Acquired
    Events
        Player - Player 1 (Red) Selects a unit
        Player - Player 2 (Blue) Selects a unit
        Player - Player 3 (Teal) Selects a unit
        Player - Player 4 (Purple) Selects a unit
        Player - Player 5 (Yellow) Selects a unit
        Player - Player 6 (Orange) Selects a unit
    Conditions
        (Triggering unit) Equal to Naga Sea Witch 0007 <gen>
        Quests_Warrior01[(Player number of (Triggering player))] Equal to True
        Quests_Warrior01_Active[(Player number of (Triggering player))] Equal to False
        (Number of units in (Units in (Playable map area)(((Unit-type of (Matching unit)) Equal to Mag Bearmaul (Warrior Tier 1 Hero)) and ((Owner of (Matching unit)) Equal to (Triggering player))))) Greater than or equal to 1
    Actions
        Set Quests_Warrior01_Active[(Player number of (Triggering player))] = True
        Set Quests_Wolf_Leaderboarder[(Player number of (Triggering player))] = 10
        Set Quests_Warrior_Player[(Player number of (Triggering player))] = (Triggering player)
        Special Effect - Destroy Special_Effects_Warrior_01[(Player number of (Triggering player))]
        Game - Display to (Triggering player), at offset (0.00, 0.00) for 16.00 seconds the text: |c00f9f900Warrior M...
        Wait 16.00 game-time seconds
        Quest - Create a Optional quest titled Wolf Hunting with the description |c00ff2020WARRIOR O..., using icon path ReplaceableTextures\CommandButtons\BTNTimberWolf.blp
        Set Quests_Log_Warrior_01[(Player number of (Triggering player))] = (Last created quest)
        Quest - Enable (Last created quest)
        Sound - Play No sound at 100.00% volume, located at (Position of Naga Sea Witch 0007 <gen>) with Z offset 0.00
        Game - Display to (Triggering player), at offset (0.00, 0.00) for 10.00 seconds the text: |c00f9f900NEW QUEST...
        Quest - Flash the quest dialog button
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Triggering player) Equal to Player 1 (Red)
            Then - Actions
                Leaderboard - Create a leaderboard for Player Group - Player 1 (Red) titled Wolf Hunt:
                Set Leaderboarder_Warrior_01[(Player number of (Triggering player))] = (Last created leaderboard)
                Leaderboard - Show (Last created leaderboard)
                Leaderboard - Add (Triggering player) to (Last created leaderboard) with label Wolves Remaining and value Quests_Wolf_Leaderboarder[(Player number of (Triggering player))]
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Triggering player) Equal to Player 2 (Blue)
            Then - Actions
                Leaderboard - Create a leaderboard for Player Group - Player 2 (Blue) titled Wolf Hunt:
                Set Leaderboarder_Warrior_01[(Player number of (Triggering player))] = (Last created leaderboard)
                Leaderboard - Show (Last created leaderboard)
                Leaderboard - Add (Triggering player) to (Last created leaderboard) with label Wolves Remaining and value Quests_Wolf_Leaderboarder[(Player number of (Triggering player))]
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Triggering player) Equal to Player 3 (Teal)
            Then - Actions
                Leaderboard - Create a leaderboard for Player Group - Player 3 (Teal) titled Wolf Hunt:
                Set Leaderboarder_Warrior_01[(Player number of (Triggering player))] = (Last created leaderboard)
                Leaderboard - Show (Last created leaderboard)
                Leaderboard - Add (Triggering player) to (Last created leaderboard) with label Wolves Remaining and value (Player number of (Triggering player))
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Triggering player) Equal to Player 4 (Purple)
            Then - Actions
                Leaderboard - Create a leaderboard for Player Group - Player 4 (Purple) titled Wolf Hunt:
                Set Leaderboarder_Warrior_01[(Player number of (Triggering player))] = (Last created leaderboard)
                Leaderboard - Show (Last created leaderboard)
                Leaderboard - Add (Triggering player) to (Last created leaderboard) with label Wolves Remaining and value (Player number of (Triggering player))
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Triggering player) Equal to Player 5 (Yellow)
            Then - Actions
                Leaderboard - Create a leaderboard for Player Group - Player 5 (Yellow) titled Wolf Hunt:
                Set Leaderboarder_Warrior_01[(Player number of (Triggering player))] = (Last created leaderboard)
                Leaderboard - Show (Last created leaderboard)
                Leaderboard - Add (Triggering player) to (Last created leaderboard) with label Wolves Remaining and value (Player number of (Triggering player))
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Triggering player) Equal to Player 6 (Orange)
            Then - Actions
                Leaderboard - Create a leaderboard for Player Group - Player 6 (Orange) titled Wolf Hunt:
                Set Leaderboarder_Warrior_01[(Player number of (Triggering player))] = (Last created leaderboard)
                Leaderboard - Show (Last created leaderboard)
                Leaderboard - Add (Triggering player) to (Last created leaderboard) with label Wolves Remaining and value (Player number of (Triggering player))
            Else - Actions
                Do nothing

Code:
Warrior Optional Quest 01 Kills
    Events
        Unit - A unit owned by Neutral Hostile Dies
    Conditions
        Quests_Warrior01[(Player number of (Triggering player))] Equal to True
        Quests_Warrior01_Active[(Player number of (Triggering player))] Equal to True
        (((Killing unit) is A Hero) Equal to True) or (((Killing unit) is Summoned) Equal to True)
        ((Unit-type of (Dying unit)) Equal to Frost Wolf) or ((Unit-type of (Dying unit)) Equal to Timber Wolf)
        (Owner of (Killing unit)) Equal to Quests_Warrior_Player[(Player number of (Triggering player))]
    Actions
        Set Quests_Wolf_Leaderboarder[(Player number of (Triggering player))] = (Quests_Wolf_Leaderboarder[(Player number of (Triggering player))] - 1)
        Leaderboard - Change the value for Quests_Warrior_Player[(Player number of (Triggering player))] in Leaderboarder_Warrior_01[(Player number of (Triggering player))] to Quests_Wolf_Leaderboarder[(Player number of (Triggering player))]

Code:
Warrior Optional Quest 01 Check
    Events
        Time - Every 0.10 seconds of game time
    Conditions
        Quests_Warrior01[(Player number of (Triggering player))] Equal to True
        Quests_Warrior01_Active[(Player number of (Triggering player))] Equal to True
        Quests_Wolf_Leaderboarder[(Player number of (Triggering player))] Equal to 0
    Actions
        Leaderboard - Destroy Leaderboarder_Warrior_01[(Player number of (Triggering player))]
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) is A Hero) Equal to True
                        (Owner of (Picked unit)) Equal to Quests_Warrior_Player[(Player number of (Triggering player))]
                    Then - Actions
                        Sound - Play No sound at 100.00% volume, located at (Position of (Picked unit)) with Z offset 0.00
                        Game - Display to Quests_Warrior_Player[(Player number of (Triggering player))], at offset (0.00, 0.00) for 10.00 seconds the text: |c00f9f900QUEST UPD...
                        Quest - Change the description of Quests_Log_Warrior_01[(Player number of (Triggering player))] to |c00ff2020WARRIOR O...
                        Quest - Flash the quest dialog button
                        Special Effect - Create a special effect attached to the overhead of Naga Sea Witch 0007 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
                        Set Special_Effects_Warrior_01[(Player number of (Triggering player))] = (Last created special effect)
                    Else - Actions
                        Do nothing

Code:
Warrior Optional Quest 01 Complete
    Events
        Player - Player 1 (Red) Selects a unit
        Player - Player 2 (Blue) Selects a unit
        Player - Player 3 (Teal) Selects a unit
        Player - Player 4 (Purple) Selects a unit
        Player - Player 5 (Yellow) Selects a unit
        Player - Player 6 (Orange) Selects a unit
    Conditions
        (Triggering unit) Equal to Naga Sea Witch 0007 <gen>
        Quests_Warrior01[(Player number of (Triggering player))] Equal to True
        Quests_Warrior01_Active[(Player number of (Triggering player))] Equal to True
        Quests_Wolf_Leaderboarder[(Player number of (Triggering player))] Equal to 0
        (Triggering player) Equal to Quests_Warrior_Player[(Player number of (Triggering player))]
    Actions
        Special Effect - Destroy Special_Effects_Warrior_01[(Player number of (Triggering player))]
        Game - Display to (Triggering player), at offset (0.00, 0.00) for 15.00 seconds the text: |c00f9f900Warrior M...
        Wait 15.00 game-time seconds
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) is A Hero) Equal to True
                        (Owner of (Picked unit)) Equal to Quests_Warrior_Player[(Player number of (Triggering player))]
                    Then - Actions
                        Sound - Play No sound at 100.00% volume, located at (Position of (Picked unit)) with Z offset 0.00
                        Game - Display to Quests_Warrior_Player[(Player number of (Triggering player))], at offset (0.00, 0.00) for 10.00 seconds the text: |c00f9f900QUEST COM...
                        Quest - Mark Quests_Log_Warrior_01[Quests_Wolf_Leaderboarder[(Player number of (Triggering player))]] as Completed
                        Quest - Destroy Quests_Log_Warrior_01[(Player number of (Triggering player))]
                        Hero - Add 500 experience to (Picked unit), Show level-up graphics
                        Item - Create Mask of Death at (Position of (Picked unit))
                        Hero - Give (Last created item) to (Picked unit)
                    Else - Actions
                        Do nothing
        Wait 60.00 game-time seconds
        Special Effect - Create a special effect attached to the overhead of Naga Sea Witch 0007 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
        Set Special_Effects_Warrior_01[(Player number of (Triggering player))] = (Last created special effect)
        Set Quests_Warrior02 = True

Ok. I have been testing this over a lan to make sure it works right. Well, as for quest set up and whatnot. It works fine. Now, when it comes to the leader boarder, that's where it messes up.

It sets for player 1 the correct amout of 10, but for player 4 it set the amount to 4...

Also, when i kill a wolf, it isn't subtracting...

What did I do wrong here?

Anitarf check your private messages btw plz
05-04-2005, 08:41 PM#10
Anitarf
As I already stated in the private message, you are using (player number of (triggering player)) as the index in all triggers, even when they run on events that don't give you a triggering player. When keeping track of wolf kills, you should use (player number of (owner of (killing unit))). When you set up the quest, you should use (player number of (owner of (hero manipulating item))).

Also, when you create the leaderboard for a player group, use the player group function "convert player to player group". That way, you can use triggering player there and you can ditch all those if-then-elses.

Edit: it sets the value on the board to 4 for player 4 because you set it to (Player number of (Triggering player)), instead of Quest_Wolf_Leaderborder[(Player number of (Triggering player))]. Check it, you have it correct for players 1 and 2, but wrong for players 3-6. You'll be fixing this anyway, as you'll be writing a single leaderboard code that works for all players now.
05-04-2005, 09:55 PM#11
Zero
Quote:
Originally Posted by Anitarf
Also, when you create the leaderboard for a player group, use the player group function "convert player to player group". That way, you can use triggering player there and you can ditch all those if-then-elses.

Can you be more specifc on this? Like how do I set this up. Do I change the quest_warrior01 variable to playergroup array instead of player array? I've never used the "convert player to player group" function before.

As for other things, I've got all the triggers to work now, but i've ran into a MAJOR problem with the kill trigger. For some reason, I don't know why, whenever another player kills a wolf, it disconects them from the game...

Here is the current wolf kill trigger:

Code:
Warrior Optional Quest 01 Kills
    Events
        Unit - A unit owned by Neutral Hostile Dies
    Conditions
        Quests_Warrior01[(Player number of (Owner of (Killing unit)))] Equal to True
        Quests_Warrior01_Active[(Player number of (Owner of (Killing unit)))] Equal to True
        Quests_Warrior01_Complete[(Player number of (Owner of (Killing unit)))] Equal to False
        (((Killing unit) is A Hero) Equal to True) or (((Killing unit) is Summoned) Equal to True)
        ((Unit-type of (Dying unit)) Equal to Frost Wolf) or ((Unit-type of (Dying unit)) Equal to Timber Wolf)
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Owner of (Killing unit)) Equal to Quests_Warrior_Player[1]
            Then - Actions
                Set Quests_Wolf_Leaderboarder[1] = (Quests_Wolf_Leaderboarder[1] - 1)
                Leaderboard - Change the value for Quests_Warrior_Player[1] in Leaderboarder_Warrior_01[1] to Quests_Wolf_Leaderboarder[1]
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Owner of (Killing unit)) Equal to Quests_Warrior_Player[2]
            Then - Actions
                Set Quests_Wolf_Leaderboarder[2] = (Quests_Wolf_Leaderboarder[2] - 1)
                Leaderboard - Change the value for Quests_Warrior_Player[2] in Leaderboarder_Warrior_01[2] to Quests_Wolf_Leaderboarder[2]
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Owner of (Killing unit)) Equal to Quests_Warrior_Player[3]
            Then - Actions
                Set Quests_Wolf_Leaderboarder[3] = (Quests_Wolf_Leaderboarder[3] - 1)
                Leaderboard - Change the value for Quests_Warrior_Player[3] in Leaderboarder_Warrior_01[3] to Quests_Wolf_Leaderboarder[3]
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Owner of (Killing unit)) Equal to Quests_Warrior_Player[4]
            Then - Actions
                Set Quests_Wolf_Leaderboarder[4] = (Quests_Wolf_Leaderboarder[4] - 1)
                Leaderboard - Change the value for Quests_Warrior_Player[4] in Leaderboarder_Warrior_01[4] to Quests_Wolf_Leaderboarder[4]
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Owner of (Killing unit)) Equal to Quests_Warrior_Player[5]
            Then - Actions
                Set Quests_Wolf_Leaderboarder[5] = (Quests_Wolf_Leaderboarder[5] - 1)
                Leaderboard - Change the value for Quests_Warrior_Player[5] in Leaderboarder_Warrior_01[5] to Quests_Wolf_Leaderboarder[5]
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Owner of (Killing unit)) Equal to Quests_Warrior_Player[6]
            Then - Actions
                Set Quests_Wolf_Leaderboarder[6] = (Quests_Wolf_Leaderboarder[6] - 1)
                Leaderboard - Change the value for Quests_Warrior_Player[6] in Leaderboarder_Warrior_01[6] to Quests_Wolf_Leaderboarder[6]
            Else - Actions
                Do nothing

Doesn't make any sence why they are getting disconected...

I have another question. Does this work right seeing as the event is based of a time interger. I mean, seeing as how it's checking every 5 seconds of the game.. Does it work right if the player is set as trigger player?

Here is the trigger I am talking about:

Code:
Warrior Optional Quest 01 Check
    Events
        Time - Every 1.00 seconds of game time
    Conditions
        Quests_Warrior01[(Player number of (Triggering player))] Equal to True
        Quests_Warrior01_Active[(Player number of (Owner of (Killing unit)))] Equal to True
        Quests_Warrior01_Complete[(Player number of (Triggering player))] Equal to False
        Quests_Wolf_Leaderboarder[(Player number of (Triggering player))] Equal to 0
    Actions
        Set Quests_Warrior01_Complete[(Player number of (Triggering player))] = True
        Leaderboard - Destroy Leaderboarder_Warrior_01[(Player number of (Triggering player))]
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) is A Hero) Equal to True
                        (Owner of (Picked unit)) Equal to Quests_Warrior_Player[(Player number of (Triggering player))]
                    Then - Actions
                        Sound - Play No sound at 100.00% volume, located at (Position of (Picked unit)) with Z offset 0.00
                        Game - Display to Quests_Warrior_Player[(Player number of (Triggering player))], at offset (0.00, 0.00) for 10.00 seconds the text: |c00f9f900QUEST UPD...
                        Quest - Change the description of Quests_Log_Warrior_01[(Player number of (Triggering player))] to |c00ff2020WARRIOR O...
                        Quest - Flash the quest dialog button
                        Special Effect - Create a special effect attached to the overhead of Naga Sea Witch 0007 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
                        Set Special_Effects_Warrior_01[(Player number of (Triggering player))] = (Last created special effect)
                    Else - Actions
                        Do nothing

Also what I have noticed while testing this out, after the player 4 got disconect from the game, I got one player 1's comp and finished killing. Well, the check trigger fired and said I completed the quest, but when I returned to the unit and selected her. Nothing happened... It was like the check trigger ran correctly, but didn't set everything right. When I test it single player it works fine.

Having issues
05-04-2005, 10:21 PM#12
Anitarf
Quote:
Originally Posted by Zero
Code:
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Owner of (Killing unit)) Equal to Quests_Warrior_Player[1]
            Then - Actions
                Set Quests_Wolf_Leaderboarder[1] = (Quests_Wolf_Leaderboarder[1] - 1)
                Leaderboard - Change the value for Quests_Warrior_Player[1] in Leaderboarder_Warrior_01[1] to Quests_Wolf_Leaderboarder[1]
            Else - Actions
                Do nothing
        .
        .
        .
Why oh why are you still using if-then-elses here? Look, just look! You can replace them all with just the following lines:
Code:
                Set Quests_Wolf_Leaderboarder[(Player number of (Owner of (Killing unit)))] = (Quests_Wolf_Leaderboarder[(Player number of (Owner of (Killing unit)))] - 1)
                Leaderboard - Change the value for (Owner of (Killing unit)) in Leaderboarder_Warrior_01[(Player number of (Owner of (Killing unit)))] to Quests_Wolf_Leaderboarder[(Player number of (Owner of (Killing unit)))]
That's why we have arrays in the first place. You can do the same thing with the other trigger that does this.

Quote:
I have another question. Does this work right seeing as the event is based of a time interger. I mean, seeing as how it's checking every 5 seconds of the game.. Does it work right if the player is set as trigger player?
Obviously not. The "triggering player" is an event response function that only works with player events. Periodic event is not a player event. It's a time event. You need to loop through all players with this, something like this:
Code:
Warrior Optional Quest 01 Check
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        For each Integer A from 1 to 6 do actions
            loop - actions:
                If - then - else multiple functions
                    If - conditions:
                        Quests_Warrior01[(Integer A)] Equal to True
                        Quests_Warrior01_Active[(Integer A)] Equal to True
                        Quests_Warrior01_Complete[(Integer A)] Equal to False
                        Quests_Wolf_Leaderboarder[(Integer A)] Equal to 0
                    Then - Actions:
                        Set Quests_Warrior01_Complete[(Integer A)] = True
                        Leaderboard - Destroy Leaderboarder_Warrior_01[(Integer A)]
                        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
                            Loop - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        ((Picked unit) is A Hero) Equal to True
                                        (Owner of (Picked unit)) Equal to Quests_Warrior_Player[(Integer A)]
                                    Then - Actions
                                        Sound - Play No sound at 100.00% volume, located at (Position of (Picked unit)) with Z offset 0.00
                                        Game - Display to Quests_Warrior_Player[(Integer A)], at offset (0.00, 0.00) for 10.00 seconds the text: |c00f9f900QUEST UPD...
                                        Quest - Change the description of Quests_Log_Warrior_01[(Integer A)] to |c00ff2020WARRIOR O...
                                        Quest - Flash the quest dialog button
                                        Special Effect - Create a special effect attached to the overhead of Naga Sea Witch 0007 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
                                        Set Special_Effects_Warrior_01[(Integer A)] = (Last created special effect)
                                    Else - Actions
                                        Do nothing
                    Else - Actions:
                        do nothing

Quote:
Also what I have noticed while testing this out, after the player 4 got disconect from the game, I got one player 1's comp and finished killing. Well, the check trigger fired and said I completed the quest, but when I returned to the unit and selected her. Nothing happened... It was like the check trigger ran correctly, but didn't set everything right. When I test it single player it works fine.
Of course nothing happened, it's because you were selecting the trainer, not the player that left. The trigger checked for you, and because you already completed the quest, it didn't do anything.
05-04-2005, 10:36 PM#13
Zero
Quote:
Of course nothing happened, it's because you were selecting the trainer, not the player that left. The trigger checked for you, and because you already completed the quest, it didn't do anything.

You misunderstood here. The check trigger set up for this trigger:

Code:
Warrior Optional Quest 01 Complete
    Events
        Player - Player 1 (Red) Selects a unit
        Player - Player 2 (Blue) Selects a unit
        Player - Player 3 (Teal) Selects a unit
        Player - Player 4 (Purple) Selects a unit
        Player - Player 5 (Yellow) Selects a unit
        Player - Player 6 (Orange) Selects a unit
    Conditions
        (Triggering unit) Equal to Naga Sea Witch 0007 <gen>
        Quests_Warrior01[(Player number of (Triggering player))] Equal to True
        Quests_Warrior02[(Player number of (Triggering player))] Equal to False
        Quests_Warrior01_Complete[(Player number of (Triggering player))] Equal to True
        Quests_Wolf_Leaderboarder[(Player number of (Triggering player))] Equal to 0
        (Triggering player) Equal to Quests_Warrior_Player[(Player number of (Triggering player))]
    Actions
        Set Quests_Warrior02[(Player number of (Triggering player))] = True
        Special Effect - Destroy Special_Effects_Warrior_01[(Player number of (Triggering player))]
        Game - Display to Quests_Warrior_Player[(Player number of (Triggering player))], at offset (0.00, 0.00) for 15.00 seconds the text: |c00f9f900Warrior M...
        Wait 15.00 game-time seconds
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) is A Hero) Equal to True
                        (Owner of (Picked unit)) Equal to Quests_Warrior_Player[(Player number of (Triggering player))]
                    Then - Actions
                        Sound - Play No sound at 100.00% volume, located at (Position of (Picked unit)) with Z offset 0.00
                        Game - Display to Quests_Warrior_Player[(Player number of (Triggering player))], at offset (0.00, 0.00) for 10.00 seconds the text: |c00f9f900QUEST COM...
                        Quest - Mark Quests_Log_Warrior_01[Quests_Wolf_Leaderboarder[(Player number of (Triggering player))]] as Completed
                        Quest - Destroy Quests_Log_Warrior_01[(Player number of (Triggering player))]
                        Hero - Add 500 experience to (Picked unit), Show level-up graphics
                        Item - Create Mask of Death at (Position of (Picked unit))
                        Hero - Give (Last created item) to (Picked unit)
                    Else - Actions
                        Do nothing
        Wait 60.00 game-time seconds
        Special Effect - Create a special effect attached to the overhead of Naga Sea Witch 0007 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
        Set Special_Effects_Warrior_01[(Player number of (Triggering player))] = (Last created special effect)

This is to the trigger I was refering to as it didn't fire.

As for the other triggers, I have made all the necessary changes and am currently right now testing to see if it STILL disconects the other players out of the game.

EDIT:
Ok, this is really starting to piss me off. All the triggers are now up and running and it is still kicking out the other players AS SOON as he kills one wolf. For some reason the player is getting disconected... I do not understand...

Here is a repost of every current trigger:

Code:
Warrior Optional Quest 01 Set Up
    Events
        Unit - A unit Uses an item
    Conditions
        (Item-type of (Item being manipulated)) Equal to |c0015ca2cWarrior|r |cffffcc00Training|r
        Quests_Warrior01[(Player number of (Owner of (Hero manipulating item)))] Equal to False
    Actions
        Set Quests_Warrior01[(Player number of (Owner of (Hero manipulating item)))] = True
        Special Effect - Create a special effect attached to the overhead of Naga Sea Witch 0007 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
        Set Special_Effects_Warrior_01[(Player number of (Owner of (Hero manipulating item)))] = (Last created special effect)

Code:
Warrior Optional Quest 01 Acquired
    Events
        Player - Player 1 (Red) Selects a unit
        Player - Player 2 (Blue) Selects a unit
        Player - Player 3 (Teal) Selects a unit
        Player - Player 4 (Purple) Selects a unit
        Player - Player 5 (Yellow) Selects a unit
        Player - Player 6 (Orange) Selects a unit
    Conditions
        (Triggering unit) Equal to Naga Sea Witch 0007 <gen>
        Quests_Warrior01[(Player number of (Triggering player))] Equal to True
        Quests_Warrior01_Active[(Player number of (Triggering player))] Equal to False
        (Number of units in (Units in (Playable map area)(((Unit-type of (Matching unit)) Equal to Mag Bearmaul (Warrior Tier 1 Hero)) and ((Owner of (Matching unit)) Equal to (Triggering player))))) Greater than or equal to 1
    Actions
        Set Quests_Warrior01_Active[(Player number of (Triggering player))] = True
        Set Quests_Wolf_Leaderboarder[(Player number of (Triggering player))] = 10
        Set Quests_Warrior_Player[(Player number of (Triggering player))] = (Triggering player)
        Special Effect - Destroy Special_Effects_Warrior_01[(Player number of (Triggering player))]
        Game - Display to (Triggering player), at offset (0.00, 0.00) for 16.00 seconds the text: |c00f9f900Warrior M...
        Wait 16.00 game-time seconds
        Quest - Create a Optional quest titled Wolf Hunting with the description |c00ff2020WARRIOR O..., using icon path ReplaceableTextures\CommandButtons\BTNTimberWolf.blp
        Set Quests_Log_Warrior_01[(Player number of (Triggering player))] = (Last created quest)
        Quest - Enable (Last created quest)
        Sound - Play No sound at 100.00% volume, located at (Position of Naga Sea Witch 0007 <gen>) with Z offset 0.00
        Game - Display to (Triggering player), at offset (0.00, 0.00) for 10.00 seconds the text: |c00f9f900NEW QUEST...
        Quest - Flash the quest dialog button
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Triggering player) Equal to Player 1 (Red)
            Then - Actions
                Leaderboard - Create a leaderboard for Player Group - Player 1 (Red) titled Wolf Hunt:
                Set Leaderboarder_Warrior_01[(Player number of (Triggering player))] = (Last created leaderboard)
                Leaderboard - Show (Last created leaderboard)
                Leaderboard - Add (Triggering player) to (Last created leaderboard) with label Wolves Remaining and value Quests_Wolf_Leaderboarder[1]
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Triggering player) Equal to Player 2 (Blue)
            Then - Actions
                Leaderboard - Create a leaderboard for Player Group - Player 2 (Blue) titled Wolf Hunt:
                Set Leaderboarder_Warrior_01[(Player number of (Triggering player))] = (Last created leaderboard)
                Leaderboard - Show (Last created leaderboard)
                Leaderboard - Add (Triggering player) to (Last created leaderboard) with label Wolves Remaining and value Quests_Wolf_Leaderboarder[2]
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Triggering player) Equal to Player 3 (Teal)
            Then - Actions
                Leaderboard - Create a leaderboard for Player Group - Player 3 (Teal) titled Wolf Hunt:
                Set Leaderboarder_Warrior_01[(Player number of (Triggering player))] = (Last created leaderboard)
                Leaderboard - Show (Last created leaderboard)
                Leaderboard - Add (Triggering player) to (Last created leaderboard) with label Wolves Remaining and value Quests_Wolf_Leaderboarder[3]
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Triggering player) Equal to Player 4 (Purple)
            Then - Actions
                Leaderboard - Create a leaderboard for Player Group - Player 4 (Purple) titled Wolf Hunt:
                Set Leaderboarder_Warrior_01[(Player number of (Triggering player))] = (Last created leaderboard)
                Leaderboard - Show (Last created leaderboard)
                Leaderboard - Add (Triggering player) to (Last created leaderboard) with label Wolves Remaining and value Quests_Wolf_Leaderboarder[4]
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Triggering player) Equal to Player 5 (Yellow)
            Then - Actions
                Leaderboard - Create a leaderboard for Player Group - Player 5 (Yellow) titled Wolf Hunt:
                Set Leaderboarder_Warrior_01[(Player number of (Triggering player))] = (Last created leaderboard)
                Leaderboard - Show (Last created leaderboard)
                Leaderboard - Add (Triggering player) to (Last created leaderboard) with label Wolves Remaining and value Quests_Wolf_Leaderboarder[5]
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Triggering player) Equal to Player 6 (Orange)
            Then - Actions
                Leaderboard - Create a leaderboard for Player Group - Player 6 (Orange) titled Wolf Hunt:
                Set Leaderboarder_Warrior_01[(Player number of (Triggering player))] = (Last created leaderboard)
                Leaderboard - Show (Last created leaderboard)
                Leaderboard - Add (Triggering player) to (Last created leaderboard) with label Wolves Remaining and value Quests_Wolf_Leaderboarder[6]
            Else - Actions
                Do nothing

Code:
Warrior Optional Quest 01 Kills
    Events
        Unit - A unit owned by Neutral Hostile Dies
    Conditions
        Quests_Warrior01[(Player number of (Owner of (Killing unit)))] Equal to True
        Quests_Warrior01_Active[(Player number of (Owner of (Killing unit)))] Equal to True
        Quests_Warrior01_Complete[(Player number of (Owner of (Killing unit)))] Equal to False
        (((Killing unit) is A Hero) Equal to True) or (((Killing unit) is Summoned) Equal to True)
        ((Unit-type of (Dying unit)) Equal to Frost Wolf) or ((Unit-type of (Dying unit)) Equal to Timber Wolf)
        (Owner of (Killing unit)) Equal to Quests_Warrior_Player[(Player number of (Owner of (Killing unit)))]
    Actions
        Set Quests_Wolf_Leaderboarder[(Player number of (Owner of (Killing unit)))] = (Quests_Wolf_Leaderboarder[(Player number of (Owner of (Killing unit)))] - 1)
        Leaderboard - Change the value for Quests_Warrior_Player[(Player number of (Owner of (Killing unit)))] in Leaderboarder_Warrior_01[(Player number of (Owner of (Killing unit)))] to Quests_Wolf_Leaderboarder[(Player number of (Owner of (Killing unit)))]

Code:
Warrior Optional Quest 01 Check
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 6, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Quests_Warrior01[(Integer A)] Equal to True
                        Quests_Warrior01_Active[(Integer A)] Equal to True
                        Quests_Warrior01_Complete[(Integer A)] Equal to False
                        Quests_Wolf_Leaderboarder[(Integer A)] Equal to 0
                    Then - Actions
                        Set Quests_Warrior01_Complete[(Integer A)] = True
                        Leaderboard - Destroy Leaderboarder_Warrior_01[(Integer A)]
                        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
                            Loop - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        ((Picked unit) is A Hero) Equal to True
                                        (Owner of (Picked unit)) Equal to Quests_Warrior_Player[(Integer A)]
                                    Then - Actions
                                        Sound - Play No sound at 100.00% volume, located at (Position of (Picked unit)) with Z offset 0.00
                                        Game - Display to Quests_Warrior_Player[(Integer A)], at offset (0.00, 0.00) for 10.00 seconds the text: |c00f9f900QUEST UPD...
                                        Quest - Change the description of Quests_Log_Warrior_01[(Player number of (Triggering player))] to |c00ff2020WARRIOR O...
                                        Quest - Flash the quest dialog button
                                        Special Effect - Create a special effect attached to the overhead of Naga Sea Witch 0007 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
                                        Set Special_Effects_Warrior_01[(Integer A)] = (Last created special effect)
                                    Else - Actions
                                        Do nothing
                    Else - Actions
                        Do nothing

Code:
Warrior Optional Quest 01 Complete
    Events
        Player - Player 1 (Red) Selects a unit
        Player - Player 2 (Blue) Selects a unit
        Player - Player 3 (Teal) Selects a unit
        Player - Player 4 (Purple) Selects a unit
        Player - Player 5 (Yellow) Selects a unit
        Player - Player 6 (Orange) Selects a unit
    Conditions
        (Triggering unit) Equal to Naga Sea Witch 0007 <gen>
        Quests_Warrior01[(Player number of (Triggering player))] Equal to True
        Quests_Warrior02[(Player number of (Triggering player))] Equal to False
        Quests_Warrior01_Complete[(Player number of (Triggering player))] Equal to True
        Quests_Wolf_Leaderboarder[(Player number of (Triggering player))] Equal to 0
        (Triggering player) Equal to Quests_Warrior_Player[(Player number of (Triggering player))]
    Actions
        Set Quests_Warrior02[(Player number of (Triggering player))] = True
        Special Effect - Destroy Special_Effects_Warrior_01[(Player number of (Triggering player))]
        Game - Display to Quests_Warrior_Player[(Player number of (Triggering player))], at offset (0.00, 0.00) for 15.00 seconds the text: |c00f9f900Warrior M...
        Wait 15.00 game-time seconds
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) is A Hero) Equal to True
                        (Owner of (Picked unit)) Equal to Quests_Warrior_Player[(Player number of (Triggering player))]
                    Then - Actions
                        Sound - Play No sound at 100.00% volume, located at (Position of (Picked unit)) with Z offset 0.00
                        Game - Display to Quests_Warrior_Player[(Player number of (Triggering player))], at offset (0.00, 0.00) for 10.00 seconds the text: |c00f9f900QUEST COM...
                        Quest - Mark Quests_Log_Warrior_01[Quests_Wolf_Leaderboarder[(Player number of (Triggering player))]] as Completed
                        Quest - Destroy Quests_Log_Warrior_01[(Player number of (Triggering player))]
                        Hero - Add 500 experience to (Picked unit), Show level-up graphics
                        Item - Create Mask of Death at (Position of (Picked unit))
                        Hero - Give (Last created item) to (Picked unit)
                    Else - Actions
                        Do nothing
        Wait 60.00 game-time seconds
        Special Effect - Create a special effect attached to the overhead of Naga Sea Witch 0007 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
        Set Special_Effects_Warrior_01[(Player number of (Triggering player))] = (Last created special effect)

Everything is working, expect for the player gettin disconected o_O
Is it because there is 2 many condtions it has to check for the kill trigger?
Overloading the memory or something and kicking the player out of the game?



:( :\ :o o_O
05-04-2005, 11:14 PM#14
Anitarf
I have no idea what could be causing the player disconnects. Try locating the problem. It's either in the "Warrior Optional Quest 01 Kills" trigger or in the "Warrior Optional Quest 01 Check" trigger. Turn the Check trigger off and test the map to see which one of them is it. If it discs then it's the kills trigger, otherwise it's the check trigger. Once you discover which trigger is it, try disabling actions in that trigger one by one and keep testing unitll you figure out which action is causing this. Then, maybe, we'll get some ideas.

By the way, the "Warrior Optional Quest 01 Acquired" still has a bunch of unneeded if-then-elses instead of some general work-for-any-player code.

And what, exactly, is the purpose of the variable Quests_Warrior_Player?
05-04-2005, 11:26 PM#15
Zero
Quote:
Originally Posted by Anitarf
I have no idea what could be causing the player disconnects. Try locating the problem. It's either in the "Warrior Optional Quest 01 Kills" trigger or in the "Warrior Optional Quest 01 Check" trigger. Turn the Check trigger off and test the map to see which one of them is it. If it discs then it's the kills trigger, otherwise it's the check trigger. Once you discover which trigger is it, try disabling actions in that trigger one by one and keep testing unitll you figure out which action is causing this. Then, maybe, we'll get some ideas.

By the way, the "Warrior Optional Quest 01 Acquired" still has a bunch of unneeded if-then-elses instead of some general work-for-any-player code.

And what, exactly, is the purpose of the variable Quests_Warrior_Player?

Ok. I will experiment on what's going on. I am pretty sure its the wolf kill trigger, seeing as how it discon as soon as I kill a wolf, but will test.

How exactly do I use the convert to player group thing. Never used it before, can you give an example trigger on how it is done?

As for the Quests_Warrior_Player, hehe, I guess now that I switched everything to arrays, I can remove it. I was for the other way the triggers were done.

EDIT:
Wow. LOL. It was the check trigger.. That's interesting. Disabling actions now to see whats going on.

Ok, all I did was change the elapsed game time to 5 seconds instead of 1 and it worked fine. Now, what I noticed this time, was, when I finished the quest with player 4 it destoryed the leaderboard for everyone, not just player 4's leaderboard. Grrr, looking into it

Code:
Warrior Optional Quest 01 Check
    Events
        Time - Every 5.00 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 6, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Quests_Warrior01[(Integer A)] Equal to True
                        Quests_Warrior01_Active[(Integer A)] Equal to True
                        Quests_Warrior01_Complete[(Integer A)] Equal to False
                        Quests_Wolf_Leaderboarder[(Integer A)] Equal to 0
                    Then - Actions
                        Set Quests_Warrior01_Complete[(Integer A)] = True
                        Leaderboard - Destroy Leaderboarder_Warrior_01[(Integer A)]
                        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
                            Loop - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        ((Picked unit) is A Hero) Equal to True
                                        (Owner of (Picked unit)) Equal to Quests_Warrior_Player[(Integer A)]
                                    Then - Actions
                                        Sound - Play No sound at 100.00% volume, located at (Position of (Picked unit)) with Z offset 0.00
                                        Game - Display to Quests_Warrior_Player[(Integer A)], at offset (0.00, 0.00) for 10.00 seconds the text: |c00f9f900QUEST UPD...
                                        Quest - Change the description of Quests_Log_Warrior_01[(Player number of (Triggering player))] to |c00ff2020WARRIOR O...
                                        Quest - Flash the quest dialog button
                                        Special Effect - Create a special effect attached to the overhead of Naga Sea Witch 0007 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
                                        Set Special_Effects_Warrior_01[(Integer A)] = (Last created special effect)
                                    Else - Actions
                                        Do nothing
                    Else - Actions
                        Do nothing

Leaderboard - Destroy Leaderboarder_Warrior_01[(Integer A)]
Is this killing the leaderboard for every player, or for just one the triggering player?

When I ran the test, I figured out that the leaderboard was getting destroyed, but the varabile amount of wolves remaining was staying the same.

Do I need to change the way it removes the leaderboard based on the player/playergroup trigger or something?

EDIT:

Ok, I made the if-then-else go bye bye.

Code:
Warrior Optional Quest 01 Acquired
    Events
        Player - Player 1 (Red) Selects a unit
        Player - Player 2 (Blue) Selects a unit
        Player - Player 3 (Teal) Selects a unit
        Player - Player 4 (Purple) Selects a unit
        Player - Player 5 (Yellow) Selects a unit
        Player - Player 6 (Orange) Selects a unit
    Conditions
        (Triggering unit) Equal to Naga Sea Witch 0007 <gen>
        Quests_Warrior01[(Player number of (Triggering player))] Equal to True
        Quests_Warrior01_Active[(Player number of (Triggering player))] Equal to False
        (Number of units in (Units in (Playable map area)(((Unit-type of (Matching unit)) Equal to Mag Bearmaul (Warrior Tier 1 Hero)) and ((Owner of (Matching unit)) Equal to (Triggering player))))) Greater than or equal to 1
    Actions
        Set Quests_Warrior01_Active[(Player number of (Triggering player))] = True
        Set Quests_Wolf_Leaderboarder[(Player number of (Triggering player))] = 10
        Set Quests_Warrior_Player[(Player number of (Triggering player))] = (Triggering player)
        Special Effect - Destroy Special_Effects_Warrior_01[(Player number of (Triggering player))]
        Game - Display to (Triggering player), at offset (0.00, 0.00) for 16.00 seconds the text: |c00f9f900Warrior M...
        Wait 16.00 game-time seconds
        Quest - Create a Optional quest titled Wolf Hunting with the description |c00ff2020WARRIOR O..., using icon path ReplaceableTextures\CommandButtons\BTNTimberWolf.blp
        Set Quests_Log_Warrior_01[(Player number of (Triggering player))] = (Last created quest)
        Quest - Enable (Last created quest)
        Sound - Play No sound at 100.00% volume, located at (Position of Naga Sea Witch 0007 <gen>) with Z offset 0.00
        Game - Display to (Triggering player), at offset (0.00, 0.00) for 10.00 seconds the text: |c00f9f900NEW QUEST...
        Quest - Flash the quest dialog button
        Leaderboard - Create a leaderboard for (Player group((Triggering player))) titled Wolf Hunt:
        Set Leaderboarder_Warrior_01[(Player number of (Triggering player))] = (Last created leaderboard)
        Leaderboard - Show (Last created leaderboard)
        Leaderboard - Add (Triggering player) to (Last created leaderboard) with label Wolves Remaining and value Quests_Wolf_Leaderboarder[(Player number of (Triggering player))]

The main thing now is it still is deleting all players leaderboards, not the trigger/designated trigger.

Anyone know why this is doing this o_O

Plz help. So close to finishing this up :8