Can this trigger be simplified? (I don't think it can)

marvey323

Member
Reaction score
1
Help with quest-making (trying to make one like the black road rpg)

I'm looking for a good tutorial for creating quests for my rpg the way that 'The Black Road' has their quests

i.e. If it is a 'kill x number of monsters' then it will show on the left side of the screen each time you kill that monster like 1/5, 2/5, etc

any quest system you feel is the best one you've come across I'd appreciate if you linked me to learn.
 

marvey323

Member
Reaction score
1
Fix my quest system please

Trigger:
  • NPC Special Effects
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Special Effect - Create a special effect attached to the overhead of Theodus 0108 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl


Trigger:
  • Theodus Quests
    • 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 Theodus 0108 <gen>
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HasSatyrQuest[(Player number of (Owner of (Triggering unit)))] Equal to False
        • Then - Actions
          • Set KillSatyrs_PlayerGroup[quest1ticker] = (Units within 250.00 of (Position of Theodus 0108 <gen>) matching (((Owner of (Matching unit)) Not equal to Neutral Hostile) and (((Unit-type of (Matching unit)) Not equal to Backpack) and ((Owner of (Matching unit)) Not equal to Player 11 (Dark Green)))))
          • Set HasSatyrQuest[(Player number of (Owner of (Triggering unit)))] = True
          • Unit Group - Pick every unit in KillSatyrs_PlayerGroup[quest1ticker] and do (Actions)
            • Loop - Actions
              • Quest - Display to (All players) the Quest Update message: Help us please! Th...
              • Quest - Create a Required quest titled Invasion of Satyrs with the description Satyrs have invaded..., using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
              • Set Quest1[(Player number of (Owner of (Picked unit)))] = (Last created quest)
              • Trigger - Turn on Kill 10 Satyrs <gen>
          • Set quest1ticker = (quest1ticker + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HasKoboldQuest[(Player number of (Owner of (Triggering unit)))] Equal to True
        • Then - Actions
          • Hero - Add 500 experience to (Triggering unit), Hide level-up graphics
          • Sound - Play GoodJob <gen>
          • Set KillKobolds_PlayerGroup[quest2ticker] = (Units within 250.00 of (Position of Theodus 0108 <gen>) matching (((Owner of (Matching unit)) Not equal to Neutral Hostile) and (((Unit-type of (Matching unit)) Not equal to Backpack) and ((HasKoboldQuest[(Player number of (Owner of (Matching unit)))] Equal
          • Unit Group - Pick every unit in KillKobolds_PlayerGroup[quest2ticker] and do (Actions)
            • Loop - Actions
              • Quest - Display to (All players) the Quest Update message: I have another task...
              • Quest - Create a Required quest titled Kobold Menace with the description Kobolds, Kobolds, K..., using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
              • Set Quest2[(Player number of (Owner of (Picked unit)))] = (Last created quest)
              • Trigger - Turn on Kill 7 Kobolds <gen>
          • Set quest2ticker = (quest2ticker + 1)
        • Else - Actions


Trigger:
  • Kill 10 Satyrs
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Dying unit)) Equal to Satyr
    • Actions
      • For each (Integer A) from 0 to quest1ticker, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SatyrKills[(Integer A)] Less than 10
            • Then - Actions
              • Set SatyrKills[(Integer A)] = (SatyrKills[(Integer A)] + 1)
              • Unit Group - Pick every unit in KillSatyrs_PlayerGroup[(Integer A)] and do (Actions)
                • Loop - Actions
                  • Game - Display to Player Group - Player 1 (Red) the text: (Satyrs Killed + ((String(SatyrKills[(Integer A)])) + ( / + 10)))
                  • Game - Display to Player Group - Player 2 (Blue) the text: (Satyrs Killed + ((String(SatyrKills[(Integer A)])) + ( / + 10)))
                  • Game - Display to Player Group - Player 3 (Teal) the text: (Satyrs Killed + ((String(SatyrKills[(Integer A)])) + ( / + 10)))
                  • Game - Display to Player Group - Player 4 (Purple) the text: (Satyrs Killed + ((String(SatyrKills[(Integer A)])) + ( / + 10)))
                  • Game - Display to Player Group - Player 5 (Yellow) the text: (Satyrs Killed + ((String(SatyrKills[(Integer A)])) + ( / + 10)))
                  • Game - Display to Player Group - Player 6 (Orange) the text: (Satyrs Killed + ((String(SatyrKills[(Integer A)])) + ( / + 10)))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SatyrKills[(Integer A)] Equal to 10
                    • Then - Actions
                      • Unit Group - Pick every unit in KillSatyrs_PlayerGroup[(Integer A)] and do (Actions)
                        • Loop - Actions
                          • Quest - Display to Player Group - Player 1 (Red) the Quest Update message: You have shown your...
                          • Quest - Display to Player Group - Player 2 (Blue) the Quest Update message: You have shown your...
                          • Quest - Display to Player Group - Player 3 (Teal) the Quest Update message: You have shown your...
                          • Quest - Display to Player Group - Player 4 (Purple) the Quest Update message: You have shown your...
                          • Quest - Display to Player Group - Player 5 (Yellow) the Quest Update message: You have shown your...
                          • Quest - Display to Player Group - Player 6 (Orange) the Quest Update message: You have shown your...
                          • Quest - Mark Quest1[(Player number of (Owner of (Picked unit)))] as Completed
                          • Sound - Play GoodJob <gen>
                          • Set HasKoboldQuest[(Player number of (Owner of (Picked unit)))] = True
                    • Else - Actions
            • Else - Actions


Trigger:
  • Kill 7 Kobolds
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Dying unit)) Equal to Kobold
    • Actions
      • For each (Integer A) from 0 to quest2ticker, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • KoboldKills[(Integer A)] Less than 7
            • Then - Actions
              • Set KoboldKills[(Integer A)] = (KoboldKills[(Integer A)] + 1)
              • Unit Group - Pick every unit in KillKobolds_PlayerGroup[(Integer A)] and do (Actions)
                • Loop - Actions
                  • Game - Display to Player Group - Player 1 (Red) the text: (Kobolds Killed + ((String(KoboldKills[(Integer A)])) + ( / + 7)))
                  • Game - Display to Player Group - Player 2 (Blue) the text: (Kobolds Killed + ((String(KoboldKills[(Integer A)])) + ( / + 7)))
                  • Game - Display to Player Group - Player 3 (Teal) the text: (Kobolds Killed + ((String(KoboldKills[(Integer A)])) + ( / + 7)))
                  • Game - Display to Player Group - Player 4 (Purple) the text: (Kobolds Killed + ((String(KoboldKills[(Integer A)])) + ( / + 7)))
                  • Game - Display to Player Group - Player 5 (Yellow) the text: (Kobolds Killed + ((String(KoboldKills[(Integer A)])) + ( / + 7)))
                  • Game - Display to Player Group - Player 6 (Orange) the text: (Kobolds Killed + ((String(KoboldKills[(Integer A)])) + ( / + 7)))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • KoboldKills[(Integer A)] Equal to 7
                    • Then - Actions
                      • Unit Group - Pick every unit in KillKobolds_PlayerGroup[(Integer A)] and do (Actions)
                        • Loop - Actions
                          • Quest - Display to Player Group - Player 1 (Red) the Quest Update message: Thank you for killi...
                          • Quest - Display to Player Group - Player 2 (Blue) the Quest Update message: Thank you for killi...
                          • Quest - Display to Player Group - Player 3 (Teal) the Quest Update message: Thank you for killi...
                          • Quest - Display to Player Group - Player 4 (Purple) the Quest Update message: Thank you for killi...
                          • Quest - Display to Player Group - Player 5 (Yellow) the Quest Update message: Thank you for killi...
                          • Quest - Display to Player Group - Player 6 (Orange) the Quest Update message: Thank you for killi...
                          • Hero - Add 500 experience to (Picked unit), Hide level-up graphics
                          • Quest - Mark Quest1[(Player number of (Owner of (Picked unit)))] as Completed
                          • Sound - Play GoodJob <gen>
                    • Else - Actions
            • Else - Actions



This system I created is meant to work for multiplayer, where player A clicks on a chain quest from an npc (Theodus) and only players within 250 AOE of the npc will also get the quest, if not they have to go click on him on their own and they have to do the quest separately (creep kills from player A wont count for player B if player B didnt get the quest at the same time as A).

My issue: Once the first quest is done (killing satyrs), the next quest (killing kobolds) wont trigger for some reason.

I have many arrays and booleans and I believe I need them all in order to make the kind of complex questing system I have here. ANy help?
 

Exide

I am amazingly focused right now!
Reaction score
448
In your first trigger (Theodus Quests), you're using Number of (Owner of (Triggering Unit)). -This won't work.
If, for example, Player 1 (Red) owns this unit - the number will be 1. If, more likely, Neutral Passive owns this unit the number will be something like 14 or 15. -For ALL players.
I suggest you change it to (Triggering Player), like this:
Trigger:
  • Set HasSatyrQuest[(Player number of (Triggering Player)] = True


In your second trigger you've got a crazy Player Group and Unit Group -action.
Instead of displaying to Player 1 (Red), Player 2 (Blue), Player 3 (Teal), etc, try this:
Trigger:
  • Unit Group - Pick every unit in KillSatyrs_PlayerGroup[(Integer A)] and do (Actions)
    • Loop - Actions
    • Game - Display to Player Group - (Picked Player) the text: (Satyrs Killed + ((String(SatyrKills[(Integer A)])) + ( / + 10)))


Trigger:
  • Unit Group - Pick every unit in KillSatyrs_PlayerGroup[(Integer A)] and do (Actions)
    • Loop - Actions
    • Quest - Display to Player Group - (Owner of (Picked unit)) the Quest Update message: You have shown your...
    • Quest - Mark Quest1[(Player number of (Owner of (Picked unit)))] as Completed


Same thing in the third trigger.
Fix these errors and post your new triggers (if it still doesn't work). Then, at least, it will be easier to find out what's not working properly.
 

marvey323

Member
Reaction score
1
I've cleaned up my triggers. How do these look?

Trigger:
  • Theodus Quests
    • Events
      • Unit - Theodus 0108 <gen> Is selected
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units within 512.00 of (Position of Theodus 0108 <gen>) matching (((Owner of (Matching unit)) Not equal to Player 11 (Dark Green)) and (((Owner of (Matching unit)) Not equal to Neutral Hostile) and ((((Matching unit) is A Hero) Equal to True) and ((Unit-type and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • HasSatyrQuest[(Player number of (Owner of (Picked unit)))] Equal to False
            • Then - Actions
              • Unit Group - Add (Picked unit) to KillSatyrs_PlayerGroup[quest1ticker]
              • Set HasSatyrQuest[(Player number of (Owner of (Picked unit)))] = True
              • Unit Group - Pick every unit in KillSatyrs_PlayerGroup[quest1ticker] and do (Actions)
                • Loop - Actions
                  • Sound - Play QuestNew <gen>
                  • Quest - Display to (Player group((Owner of (Picked unit)))) the Quest Update message: Help us please! Th...
                  • Quest - Create a Required quest titled Invasion of Satyrs with the description Satyrs have invaded..., using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
                  • Set Quest1[(Player number of (Owner of (Picked unit)))] = (Last created quest)
                  • Trigger - Turn on Kill 10 Satyrs <gen>
                  • Set quest1ticker = (quest1ticker + 1)
            • Else - Actions
      • Unit Group - Pick every unit in (Units within 512.00 of (Position of Theodus 0108 <gen>) matching (((Owner of (Matching unit)) Not equal to Player 11 (Dark Green)) and (((Owner of (Matching unit)) Not equal to Neutral Hostile) and ((((Matching unit) is A Hero) Equal to True) and ((Unit-type and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Quest1[(Player number of (Owner of (Picked unit)))] is completed) Equal to True
            • Then - Actions
              • Unit Group - Add (Picked unit) to KillKobolds_PlayerGroup[quest2ticker]
              • Unit Group - Pick every unit in KillKobolds_PlayerGroup[quest2ticker] and do (Actions)
                • Loop - Actions
                  • Sound - Play QuestNew <gen>
                  • Quest - Display to (Player group((Owner of (Picked unit)))) the Quest Update message: I have another task...
                  • Quest - Create a Required quest titled Kobold Menace with the description Kobolds, Kobolds, K..., using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
                  • Set Quest2[(Player number of (Owner of (Picked unit)))] = (Last created quest)
                  • Trigger - Turn on Kill 7 Kobolds <gen>
                  • Set quest2ticker = (quest2ticker + 1)
            • Else - Actions


Trigger:
  • Kill 10 Satyrs
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Dying unit)) Equal to Satyr
    • Actions
      • For each (Integer A) from 0 to quest1ticker, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SatyrKills[(Integer A)] Less than 10
            • Then - Actions
              • Set SatyrKills[(Integer A)] = (SatyrKills[(Integer A)] + 1)
              • Unit Group - Pick every unit in KillSatyrs_PlayerGroup[(Integer A)] and do (Actions)
                • Loop - Actions
                  • Game - Display to (Player group((Owner of (Picked unit)))) the text: (Satyrs Killed + ((String(SatyrKills[(Integer A)])) + ( / + 10)))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SatyrKills[(Integer A)] Equal to 10
                    • Then - Actions
                      • Quest - Display to (Player group((Owner of (Picked unit)))) the Quest Update message: You have shown your...
                      • Quest - Mark Quest1[(Player number of (Owner of (Picked unit)))] as Completed
                      • Hero - Add 500 experience to (Picked unit), Hide level-up graphics
                      • Sound - Play GoodJob <gen>
                      • Unit Group - Remove (Picked unit) from KillSatyrs_PlayerGroup[(Integer A)]
                    • Else - Actions
            • Else - Actions


Trigger:
  • Kill 7 Kobolds
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Dying unit)) Equal to Kobold
    • Actions
      • For each (Integer A) from 0 to quest2ticker, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • KoboldKills[(Integer A)] Less than 7
            • Then - Actions
              • Set KoboldKills[(Integer A)] = (KoboldKills[(Integer A)] + 1)
              • Unit Group - Pick every unit in KillKobolds_PlayerGroup[(Integer A)] and do (Actions)
                • Loop - Actions
                  • Game - Display to (Player group((Owner of (Picked unit)))) the text: (Kobolds Killed + ((String(KoboldKills[(Integer A)])) + ( / + 7)))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • KoboldKills[(Integer A)] Equal to 7
                    • Then - Actions
                      • Unit Group - Pick every unit in KillKobolds_PlayerGroup[(Integer A)] and do (Actions)
                        • Loop - Actions
                          • Quest - Display to (Player group((Owner of (Picked unit)))) the Quest Update message: Thank you for killi...
                          • Hero - Add 500 experience to (Picked unit), Hide level-up graphics
                          • Quest - Mark Quest2[(Player number of (Owner of (Picked unit)))] as Completed
                          • Sound - Play GoodJob <gen>
                          • Unit Group - Remove (Picked unit) from KillKobolds_PlayerGroup[(Integer A)]
                    • Else - Actions
            • Else - Actions



I havent tested it in multiplayer yet but I'm able to do the first quest and then the second one like a chain (the way I wanted it to be). And I cant' do the second one without doing the first one first.

Can I get some suggestions on additional features I can add?

I don't know the capabilities of quest systems I'm really new at everything here.

Things I had in mind:
- Showing players how much of the current quest they've done ?
-
 

Exide

I am amazingly focused right now!
Reaction score
448
I just noticed this:
Trigger:
  • Kill 10 Satyrs
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Dying unit)) Equal to Satyr
    • Actions


Might as well be this:

Trigger:
  • Kill 10 Satyrs
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Satyr
    • Actions


>Showing players how much of the current quest they've done
-You can do this by adding:
Code:
Quest - Display to (Player group((Owner of (Picked unit)))) the Quest Update message: (SatyrKills[(Integer A)]) + / 10 Satyrs killed.)
in the 'Kill 10 Satyrs' trigger.

Notice: You must also add a 'Unit Group' - action to actually pick units.
 

marvey323

Member
Reaction score
1
I went in multiplayer and what's happening now is that the quest is being shown multiple times for every player in the game..

Trigger:
  • Theodus Quests Remake
    • Events
      • Unit - Theodus 0108 <gen> Is selected
    • Conditions
    • Actions
      • Set PositionofTheodus = (Position of Theodus 0108 <gen>)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 512.00 of PositionofTheodus matching (((Owner of (Matching unit)) Not equal to Player 11 (Dark Green)) and (((Owner of (Matching unit)) Not equal to Neutral Hostile) and ((((Matching unit) is A Hero) Equal to True) and ((Unit-type of (Matching u and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • HasSatyrQuest[(Player number of (Owner of (Picked unit)))] Equal to False
            • Then - Actions
              • Set MyPlayerGroup = (Player group((Owner of (Picked unit))))
              • Unit Group - Add (Picked unit) to KillSatyrs_PlayerGroup[quest1ticker]
              • Sound - Play QuestNew <gen>
              • Quest - Display to MyPlayerGroup the Quest Update message: Help us please! Th...
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • HasSatyrQuest[(Player number of (Owner of (Picked unit)))] Equal to False
                • Then - Actions
                  • Quest - Create a Required quest titled Invasion of Satyrs with the description Satyrs have invaded..., using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
                  • Set HasSatyrQuest[(Player number of (Owner of (Picked unit)))] = True
                  • Set Quest1[(Player number of (Owner of (Picked unit)))] = (Last created quest)
                  • Trigger - Turn on Kill 10 Satyrs <gen>
                • Else - Actions
            • Else - Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Set quest1ticker = (quest1ticker + 1)


How do I make it so that
Trigger:
  • Quest - Create a Required quest titled Invasion of Satyrs with the description Satyrs have invaded..., using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp


Is only made once to each player and not for as many players are there are in the game?
 

Exide

I am amazingly focused right now!
Reaction score
448
>I went in multiplayer and what's happening now is that the quest is being shown multiple times for every player in the game..
-I expect it's because of you mixing loops with unit and player groups.


>How do I make it so that

>Is only made once to each player and not for as many players are there are in the game?
Probably the same as above, move it outside them loops of yours. :p
 

marvey323

Member
Reaction score
1
Okay I understand that the loop is the problem here because it's creating x many satyr quests according to how many people are within 512 units of the npc. The problem with moving it out of the loop means that its going to keep creating the same quest as many times as you click on the npc...
 

Exide

I am amazingly focused right now!
Reaction score
448
>The problem with moving it out of the loop means that its going to keep creating the same quest as many times as you click on the npc...
-Unless, of course, you put it in an 'If / Then / Else', and add a condition to it.
 

marvey323

Member
Reaction score
1
I got the part fixed where its showing the quest multiple times but now another issue came up where the second quest can be spammed unlimited times.

Well I'm grateful for you spending time with me but I think after over nearly 10 hours of trying to figure this out it is just is way beyond me. I'll just scrap the idea of having quests on my map.
 

marvey323

Member
Reaction score
1
oKAY SOMEONE has to know how to fix this !!! I can't create any quests right now if I can't fix this issue!

The problem: Satyr quest involving killing 10 satyrs causes all players on the map to do the quest at the same time. I know why this is happening but i dont know how to resolve it. So say Player A goes afk for 10 minutes and then comes back and player B is done that quest. When player A clicks on the npc to start it, he's already finished it because quest1ticker is working the same for both players. How can I fix this?

Trigger:
  • Theodus Satyr Quest
    • Events
      • Unit - Theodus 0108 <gen> Is selected
    • Conditions
    • Actions
      • Set PositionofTheodus = (Position of Theodus 0108 <gen>)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 512.00 of PositionofTheodus matching (((Owner of (Matching unit)) Not equal to Player 11 (Dark Green)) and (((Owner of (Matching unit)) Not equal to Neutral Hostile) and ((((Matching unit) is A Hero) Equal to True) and ((HasSatyrQuest[(Player nu and do (Actions)
        • Loop - Actions
          • Set MyPlayerGroup = (Player group((Owner of (Picked unit))))
          • Unit Group - Add (Picked unit) to KillSatyrs_PlayerGroup[quest1ticker]
          • Sound - Play QuestNew <gen>
          • Quest - Display to MyPlayerGroup the Quest Update message: Help us please! Th...
          • Set HasSatyrQuest[(Player number of (Owner of (Picked unit)))] = True
          • 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
                  • And - All (Conditions) are true
                    • Conditions
                      • HasSatyrQuest[(Integer A)] Equal to True
                      • HasSatyrQuestStarted[(Integer A)] Equal to False
                • Then - Actions
                  • Quest - Create a Required quest titled Invasion of Satyrs with the description Satyrs have invaded..., using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
                  • Set Quest1[(Integer A)] = (Last created quest)
                  • Set HasSatyrQuestStarted[(Integer A)] = True
                  • Trigger - Turn on Kill 10 Satyrs <gen>
                • Else - Actions
      • Custom script: call RemoveLocation(udg_PositionofTheodus)
      • Set quest1ticker = (quest1ticker + 1)


Trigger:
  • Kill 10 Satyrs
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Dying unit)) Equal to Satyr
          • (Owner of (Killing unit)) Not equal to Player 11 (Dark Green)
    • Actions
      • For each (Integer A) from 0 to quest1ticker, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SatyrKills[(Integer A)] Less than 10
            • Then - Actions
              • Set SatyrKills[(Integer A)] = (SatyrKills[(Integer A)] + 1)
              • Unit Group - Pick every unit in KillSatyrs_PlayerGroup[(Integer A)] and do (Actions)
                • Loop - Actions
                  • Set MyPlayerGroup = (Player group((Owner of (Picked unit))))
                  • Game - Display to MyPlayerGroup the text: (Satyrs Killed + ((String(SatyrKills[(Integer A)])) + ( / + 10)))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SatyrKills[(Integer A)] Equal to 10
                    • Then - Actions
                      • Quest - Display to MyPlayerGroup the Quest Update message: You have shown your...
                      • Quest - Mark Quest1[(Player number of (Owner of (Picked unit)))] as Completed
                      • Hero - Add 500 experience to (Picked unit), Hide level-up graphics
                      • Unit Group - Remove (Picked unit) from KillSatyrs_PlayerGroup[(Integer A)]
                      • Sound - Play GoodJob <gen>
                    • Else - Actions
            • Else - Actions


Somewhere in that second trigger I need to add something like this: Killing unit is in unit group KillSatyrs_PlayerGroup[x] but I can't find the options to do it.. is it even doable?

Please and thank you... I've been spending toooo much time on just this.
 

marvey323

Member
Reaction score
1
How do you create a quest for ONLY the person clicking on the npc ?

Whenever I add
Trigger:
  • Quest - Create a Required quest titled Invasion of Satyrs with the description Satyrs have invaded..., using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp


It is creating the quest for every single player on the map regardless if they are near the npc or not...

Full trigger:

Trigger:
  • Theodus Satyr Quest
    • Events
      • Unit - Theodus 0108 <gen> Is selected
    • Conditions
    • Actions
      • Set PositionofTheodus = (Position of Theodus 0108 <gen>)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 512.00 of PositionofTheodus matching (((Owner of (Matching unit)) Not equal to Player 11 (Dark Green)) and (((Owner of (Matching unit)) Not equal to Neutral Hostile) and ((((Matching unit) is A Hero) Equal to True) and ((HasSatyrQuest[(Player nu and do (Actions)
        • Loop - Actions
          • Set MyPlayerGroup = (Player group((Owner of (Picked unit))))
          • Unit Group - Add (Picked unit) to KillSatyrs_PlayerGroup
          • Sound - Play QuestNew <gen>
          • Quest - Display to MyPlayerGroup the Quest Update message: Help us please! Th...
          • Set HasSatyrQuest[(Player number of (Owner of (Picked unit)))] = True
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • HasSatyrQuest[(Player number of (Owner of (Picked unit)))] Equal to True
                  • HasSatyrQuestStarted[(Player number of (Owner of (Picked unit)))] Equal to False
            • Then - Actions
              • Quest - Create a Required quest titled Invasion of Satyrs with the description Satyrs have invaded..., using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
              • Set Quest1[(Player number of (Owner of (Picked unit)))] = (Last created quest)
              • Set HasSatyrQuestStarted[(Player number of (Owner of (Picked unit)))] = True
              • Trigger - Turn on Kill 10 Satyrs <gen>
            • Else - Actions
      • Custom script: call RemoveLocation(udg_PositionofTheodus)


Before you say that it's because I have it in a unit group loop I know this isn't the case because players are getting the quest even if they are not within 512 range of that npc.
 

Cheesy

some fucker
Reaction score
95
The action has nothing to do with the rest of the loop. Creating a quest does so for all players, regardless of where you place it.

As far as I know that is...
 

marvey323

Member
Reaction score
1
So player A clicks on Theodus.. player A gets quest to kill Satyrs.

5 min later player B comes back from being AFK and clicks on Theodus.

Now player A has 2 quests of killing Satyrs... Ugh.

How come this problem doesn't exist in other RPG maps I've been in? I think I have to somehow disable the quest if it has been triggered more than once or something ?
 

mgsfan18

New Member
Reaction score
1
You need to do is add a trigger making sure that the player activating the quest is the only player activating this action

Quest - Create a Required quest titled Invasion of Satyrs with the description Satyrs have invaded..., using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
 

marvey323

Member
Reaction score
1
You need to do is add a trigger making sure that the player activating the quest is the only player activating this action

Quest - Create a Required quest titled Invasion of Satyrs with the description Satyrs have invaded..., using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp

I KNOW what to do.

I DON'T KNOW how to do it !

And what you said right there didn't really explain much. 'Create a Required quest is creating it for every single player'.


Thanks for trying.
 

mango

Member
Reaction score
0
couldnt you create a seperate trigger for each character? :

event - player owned unit enters region
actions - create quest for player

or am i missing something important...?
 

Redeamed

New Member
Reaction score
2
for some reason quests are not player individual (from what I've found)...I think you can create the quest for everyone but hide it from players that have yet to discover it...if not make a variable that must be active to complete the quest this way the quest would exist for everyone but when they click on the quest giver they get the variable activated to allow them to do the quest. Ill play around with it a bit and see what else i can come up with.
 

Exide

I am amazingly focused right now!
Reaction score
448
>Killing unit is in unit group KillSatyrs_PlayerGroup[x]
You can't have a unit in a Player Group. However, you can check if the Owner of that unit is in the Player Group.

I suggest you change your quest triggers so that players can't share kills. No matter how close they are to the quest giver, when another player clicks on him.
-Easier to code that way.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top