A little triggering help

Killerbf21

New Member
Reaction score
1
So I want to set up a trigger that does the fallowing.

- If hero has item of item type Sword and Armor, turn off another trigger
- If hero has item of type Sword, turn off Give Sword trigger
- If hero has item of type Armor, turn off Give Armor trigger
-If hero has items of type Sword and Armor, mark Objective as Complete

EDIT: Also, I can't figure out how to mark the Objective as Completed. This is what I have set up to mark a Mission as finished when you do all the required things.

Code:
    Events
        Unit - Zealot [92.52, 40.92] Enters Wrecked Ship
    Local Variables
        Intro Quest = (Last created objective) <Objective>
    Conditions
    Actions
        Variable - Set Intro Quest = (Last created objective)
        Objective - Mark (Last created objective) as Completed
        UI - Display (Name of Zealot) for (All players) to Subtitle area
        UI - Display "Hmmm" for (All players) to Subtitle area
        General - Wait 10.0 Game Time seconds
        UI - Clear All Messages for (All players)
        UI - Display (Name of Zealot) for (All players) to Subtitle area
        UI - Display "Damnit... Only a Healthkit... I nee..." for (All players) to Subtitle area
        General - Wait 2.0 Game Time seconds
        Objective - Create a Active Primary objective with text "Finding a Sword and Armor" and description "Debree from the ship is scattered a..."
        Objective - Set (Last created objective) players to (Active Players)
        Objective - Show (Last created objective) for (Active Players)
        General - Wait 8.0 Game Time seconds
        UI - Clear All Messages for (All players)

This is what I have so far.

Code:
    Events
        Unit - Zealot [92.52, 40.92] Receives ("Armor" from the Global data table)
        Unit - Zealot [92.52, 40.92] Receives ("Sword" from the Global data table)
    Local Variables
    Conditions
    Actions
        General - If (Conditions) then do (Actions) else do (Actions)
            If
                (Item carried by Zealot [92.52, 40.92] in 1) == ("Sword" from the Global data table)
                And
                    Conditions
                        (Item carried by Zealot [92.52, 40.92] in 1) == ("Armor" from the Global data table)
            Then
                Trigger - Turn Cannot leave untill Armor/Sword is found Off
                Objective - Mark (Last created objective) as Completed
            Else
Code:
    Events
        Unit - Zealot [92.52, 40.92] Enters Leave Begining Area
    Local Variables
    Conditions
    Actions
        General - If (Conditions) then do (Actions) else do (Actions)
            If
                ((Last created objective) state) == Completed
            Then
                UI - Display (Name of Zealot) for (All players) to Subtitle area
                UI - Display "So... No idea where I am... No clue..." for (All players) to Subtitle area
                General - Wait 10.0 Game Time seconds
                UI - Clear All Messages for (All players)
            Else
                UI - Display (Name of Zealot) for (All players) to Subtitle area
                Unit - Move (Triggering unit) instantly to Hero Respawn Point (No Blend)
                UI - Display "I think i'll wait untill I have a w..." for (All players) to Subtitle area

Any help that is givin is greatly appreciated!!!
 

themean

Active Member
Reaction score
7
im not sure what you need
maybe you must use event of type
"Unit manipulates inventory (GUI version)" whit manipulates=gains
unit=some function item =some function
try it
 

Killerbf21

New Member
Reaction score
1
No... What I need is to make the GUI triggers say something along these lines:

Set Variable: Item in item slot 1 = Sword
Set Variable: Item in item slot 2 = Armor

It has to do that when you pick up said item. Then:

Once item in item slot 1 is a Sword, and item in item slot 2 is Armor, turn off a specific trigger, turn on a different trigger.

The Trigger code in GUI for Warcraft3 editor is:
Code:
Untitled Trigger 001
    Events
        Unit - Peasant 0000 <gen> Acquires an item
    Conditions
        (Item-type of (Item being manipulated)) Equal to Tome of Experience
    Actions
        Set HasRequiredItems[1] = 1
Code:
Untitled Trigger 001 Copy
    Events
        Unit - Peasant 0000 <gen> Acquires an item
    Conditions
        (Item-type of (Item being manipulated)) Equal to Tome of Power
    Actions
        Set HasRequiredItems[1] = (HasRequiredItems[1] + 1)
Code:
Untitled Trigger 002
    Events
        Time - Every 0.10 seconds of game time
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                HasRequiredItems[1] Equal to 2
            Then - Actions
                Trigger - Turn off Untitled Trigger 002 Copy <gen>
                Trigger - Turn on Untitled Trigger 002 <gen>
            Else - Actions
Of corse if I knew how to do this via GUI on the Starcraft 2 editor, I wouldn't need to post on here.
 

themean

Active Member
Reaction score
7
i dont know why exactly you want but this event started when you pick item,drop item ,use item ,sell item ,buy item etc.
maybe whit condition you can control slot 1 slot 2 ...
 

Killerbf21

New Member
Reaction score
1
I want something that notices that you have a specific items in an item slot in you bag, then does something. You have a sword? Turn off GIVE sword trigger, Mark Gain A Sword objective as complete, turn on Spawn creep trigger. You dont have a sword? Turn on Give sword trigger, Create new objective titled "Gain a sword", Lock area so you cant leave til you get one....... Don't know how else to explain what i am tryin to make my trigger do...
 

Severon

New Member
Reaction score
7
I'm not sure if this is going to help, but I'm not at home to look into this.

Give the sword a behavior that the units gets upon equiping.

Then if unit has behavior == sword behavior
turn off give sword

like i said not able to look a editor so that might not be right, but I do remember people mentioning the ability to detect different behaviors.
 

Killerbf21

New Member
Reaction score
1
I'm not sure if this is going to help, but I'm not at home to look into this.

Give the sword a behavior that the units gets upon equiping.

Then if unit has behavior == sword behavior
turn off give sword

like i said not able to look a editor so that might not be right, but I do remember people mentioning the ability to detect different behaviors.

That would be great. Because I can't find a trigger that grabs the item unless I place the item in game, which I don't want to do. I'll give that a try and let you know if it works.


Edit: Works like a charm. Thanks man
 
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