• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

I need help with an item trigger

Status
Not open for further replies.
Level 3
Joined
Dec 17, 2008
Messages
37
In my map, I've created a box of food supplies that need to be picked up for a quest. However, I want to make it so that people who haven't started the quest will not be able to pick it up and I also want it to be able to respawn so that other players can do the quest as well.

Well, now the item can't be picked up, even when the quest is started and the character doesn't have the item in his inventory yet.

Here are screenshots of the problem. (I have no Idea how to make those cool highlightable tags or whatever they are called.)

The First Trigger:
1f46fbc40ce8f6fbccdbbb9c113208e42g.jpg


The Second Trigger:
662db9e7680aeaf5f6a7f8869b110c072g.jpg


Sorry for making you have to download the files, I just do not want to sign up for more image sharing sites. :sad:
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
I can't see your code at all. In the trigger-editor right-click on your trigger (where you input events/conditions/actions) and click copy as text. Then switch to your internet browser and type "
  • " to start the appropriate tags, then [B]CTRL+V[/B] to paste your trigger, and then close the tag ("[ /trigger]" but no space in between [ and /).
 
Level 3
Joined
Dec 17, 2008
Messages
37
The Triggers as text

  • Banditfood
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Bandit Food Supplies
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • QuestFS[(Player number of (Owner of (Triggering unit)))] Equal to started
        • Then - Actions
          • Wait 20.00 seconds
          • Item - Create Bandit Food Supplies at (Center of Bandit food spawn <gen>)
        • Else - Actions
          • Hero - Drop (Item carried by (Triggering unit) of type Bandit Food Supplies) from (Triggering unit)
          • Item - Move (Last dropped item) to (Center of Bandit food spawn <gen>)
          • Game - Display to (All players controlled by a ((Owner of (Triggering unit)) controller) player) the text: You can't pick that...
  • Banditfood part 2
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Bandit Food Supplies
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has an item of type Bandit Food Supplies) Equal to True
        • Then - Actions
          • Hero - Drop (Item carried by (Triggering unit) of type Bandit Food Supplies) from (Triggering unit)
          • Item - Move (Last dropped item) to (Center of Bandit food spawn <gen>)
          • Game - Display to (All players controlled by a ((Owner of (Triggering unit)) controller) player) the text: You can't pick that...
        • Else - Actions
          • Do nothing
 
Last edited:
Level 3
Joined
Dec 17, 2008
Messages
37
  • Finish MTP
    • Events
      • Unit - A unit comes within 256.00 of Elven Paladin 0014 <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • QuestFS[(Player number of (Owner of (Triggering unit)))] Equal to notstarted
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Cinematic - Disable user control for (All players controlled by a ((Owner of (Triggering unit)) controller) player)
          • Quest - Display to (All players controlled by a ((Owner of (Triggering unit)) controller) player) the Quest Completed message: QUEST COMPLETE: Mee...
          • Quest - Mark (Last created quest requirement) as Completed
          • Set QuestMTP[(Player number of (Owner of (Triggering unit)))] = Complete
          • Quest - Mark (Last created quest) as Completed
          • Game - Display to (All players controlled by a ((Owner of (Triggering unit)) controller) player) the text: Paladin: Welcome t...
          • Set QuestFS[(Player number of (Owner of (Triggering unit)))] = started
          • Quest - Create a Required quest titled Food Supplies with the description The Paladin's just ..., using icon path ReplaceableTextures\CommandButtons\BTNMonsterLure.blp
          • Quest - Create a quest requirement for (Last created quest) with the description Find some food.
          • Quest - Display to (All players controlled by a ((Owner of (Triggering unit)) controller) player) the Quest Discovered message: QUEST DISCOVERED: F...
          • Cinematic - Enable user control for (All players controlled by a ((Owner of (Triggering unit)) controller) player)
        • Else - Actions
          • Do nothing
Here is the trigger that sets the quest as started. If you want to have an in-depth look at the map, I can send you it, just PM me. (also, tell me if I have any leaks, since I am still pretty much nooby.)
 
Level 6
Joined
Mar 22, 2009
Messages
276
Get rid of the do nothing function. It does nothing but slows down your trigger.
I can't find anything wrong with your trigger to make it not pick up the food supply even the following conditions are met..
 
Level 3
Joined
Dec 17, 2008
Messages
37
String variables can't be put into the boolean comparison condition =( .... wait, did you mean to make the quest variable boolean as well?
 
Level 3
Joined
Dec 17, 2008
Messages
37
Hang on, when I make the variables for "Started", do I have to make another variable for "Complete"? Because when they were still strings, I had the strings to check on the quest status, "Notstarted", "Started" and "Complete"
 
If your Notstarted is true, then Started and Complete will be false. When your NotStarted is false, then Started will be true. When specific conditions are met, the Complete will also become true. Generlaly, just make checks of type:
  • NotStarted[Player number of (Owner of (Triggering unit))] = True
So, to answer your question, it depends on what you want to achieve. If you find it necessary for 3 variables to exist, then use 3 variables, simple as that. If you don't make a check during the "Started" (for example) check, then don't use it at all.
 
Level 3
Joined
Dec 17, 2008
Messages
37
Alright. So I have to make 3 variables for each quest, for started, not started and complete for that specific quest, is that what you mean?
 
Level 3
Joined
Dec 17, 2008
Messages
37
The problem is still here and now I can't turn in the first quest, possibly all the rest.
The triggers:

  • Get MTP
    • Events
      • Unit - A unit comes within 256.00 of Guard 0009 <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • QuestMTP_Started[(Player number of (Owner of (Triggering unit)))] Equal to False
        • Then - Actions
          • Cinematic - Disable user control for (All players controlled by a ((Owner of (Triggering unit)) controller) player)
          • Game - Display to (All players controlled by a ((Owner of (Triggering unit)) controller) player) for 7.00 seconds the text: Guard: Stop, I've n...
          • Quest - Create a Required quest titled Meet The Paladin with the description Go to the centre of..., using icon path ReplaceableTextures\CommandButtons\BTNTheCaptain.blp
          • Quest - Create a quest requirement for (Last created quest) with the description Talk to the Paladin
          • Quest - Display to (All players controlled by a ((Owner of (Triggering unit)) controller) player) the Quest Discovered message: QUEST DISCOVERED: M...
          • Set QuestMTP_Started[(Player number of (Owner of (Triggering unit)))] = True
          • Cinematic - Enable user control for (All players controlled by a ((Owner of (Triggering unit)) controller) player)
          • Cinematic - Ping minimap for (All players controlled by a ((Owner of (Triggering unit)) controller) player) at (Position of Elven Paladin 0014 <gen>) for 3.00 seconds
          • Skip remaining actions
        • Else - Actions
          • Game - Display to (All players controlled by a ((Owner of (Triggering unit)) controller) player) for 10.00 seconds the text: You have already st...
          • Skip remaining actions
  • Finish MTP
    • Events
      • Unit - A unit comes within 256.00 of Elven Paladin 0014 <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • QuestFS_started[(Player number of (Owner of (Triggering unit)))] Equal to False
      • QuestMTP_Started[(Player number of (Owner of (Triggering unit)))] Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Cinematic - Disable user control for (All players controlled by a ((Owner of (Triggering unit)) controller) player)
          • Quest - Display to (All players controlled by a ((Owner of (Triggering unit)) controller) player) the Quest Completed message: QUEST COMPLETE: Mee...
          • Quest - Mark (Last created quest requirement) as Completed
          • Set QuestMTP_Complete[(Player number of (Owner of (Triggering unit)))] = True
          • Quest - Mark (Last created quest) as Completed
          • Game - Display to (All players controlled by a ((Owner of (Triggering unit)) controller) player) the text: Paladin: Welcome t...
          • Set QuestFS_started[(Player number of (Owner of (Triggering unit)))] = True
          • Quest - Create a Required quest titled Food Supplies with the description The Paladin's just ..., using icon path ReplaceableTextures\CommandButtons\BTNMonsterLure.blp
          • Quest - Create a quest requirement for (Last created quest) with the description Find some food.
          • Quest - Display to (All players controlled by a ((Owner of (Triggering unit)) controller) player) the Quest Discovered message: QUEST DISCOVERED: F...
          • Cinematic - Enable user control for (All players controlled by a ((Owner of (Triggering unit)) controller) player)
        • Else - Actions
          • Do nothing
  • Banditfood
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Bandit Food Supplies
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • QuestFS_started[(Player number of (Owner of (Triggering unit)))] Equal to True
          • ((Triggering unit) has an item of type Bandit Food Supplies) Equal to False
        • Then - Actions
          • Wait 20.00 seconds
          • Item - Create Bandit Food Supplies at (Center of Bandit food spawn <gen>)
        • Else - Actions
          • Hero - Drop (Item carried by (Triggering unit) of type Bandit Food Supplies) from (Triggering unit)
          • Item - Move (Last dropped item) to (Center of Bandit food spawn <gen>)
          • Game - Display to (All players controlled by a ((Owner of (Triggering unit)) controller) player) the text: You can't pick that...
 
Last edited:
Level 3
Joined
Dec 17, 2008
Messages
37
Plus, I did a test for the "Finish MTP" Trigger, and it doesn't run, even with the requirement of having started Quest_MTP removed and it doesn't show the text message (That I added as a tester) that happens in the "else" action.

EDIT: I've found the reason for the quest not being able to start, I used to have an action at the start which disabled Finish MTP due to Elf players being able to warp to the paladin and get the quest while the previous had not been started yet. I've fixed this by implementing the Variables but forgot to delete the trigger *Facepalm*. But still, players can have more than one crate of food supplies and I want to limit that to one, and it does disallow the item to be picked up when the quest hasn't been started yet.
 
Last edited:
Status
Not open for further replies.
Top