• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] The trigger should work...

Status
Not open for further replies.

Deleted member 177737

D

Deleted member 177737

Hey,
I'm attempting to make a customized auto-collection system for my map. I cannot use the default ones because I'm using custom resources and blah blah blah...

Anyways I'm trying to get the game to run the below triggers but when I go in and test them out nothing happens. It should add the selected unit into the AutoCollect_LJ group and then set a few variables send some messages etc...

Can anyone see my (probably simple) mistake?

  • test
    • Events
      • Player - Player 1 (Red) types a chat message containing go as An exact match
    • Conditions
      • (Owner of (Targeted unit)) Equal to Player 1 (Red)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Targeted unit)) Equal to Tree Cutter
        • Then - Actions
          • Set AutoCollection_Interger = (AutoCollection_Interger + 1)
          • Game - Display to Player Group - Player 1 (Red) the text: (Auto-Collection Enabled on + ((Name of AutoCollection_Unit[AutoCollection_Interger]) + .))
          • Unit Group - Add (Targeted unit) to AutoCollection_LJ_Group
          • Trigger - Turn on Untitled Trigger 001 <gen>
        • Else - Actions
          • Game - Display to (All players) the text: Targeted unit must ...
Untitled Trigger 001 is set to "Initally Off"
  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Killing unit)) Equal to Tree Cutter
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Killing unit) is in AutoCollection_LJ_Group) Equal to True
        • Then - Actions
          • Unit - Order (Killing unit) to Attack (Random unit from (Units within 2000.00 of (Position of (Killing unit)) matching ((Unit-type of (Matching unit)) Equal to Fallen Log (5))))
        • Else - Actions
  • Untitled Trigger 002
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • ((Targeted unit) is in AutoCollection_LJ_Group) Equal to True
    • Actions
      • Game - Display to Player Group - Player 1 (Red) the text: ((Name of (Targeted unit)) + unit currently has Auto-Collection Enabled.)
 

Deleted member 177737

D

Deleted member 177737

It should take the unit that the player has targeted after the player types go. The way I'm trying to get it to work is that you type a command to set the unit into the "Auto Collecting" units group which then lets the unit do it's thing without the player having to click again. Then when the player selects that unit or any other unit in the "Auto Collecting" group a message will popup saying that the unit has already been put into "Auto Collection Mode".
 

Deleted member 177737

D

Deleted member 177737

Well I managed to get it to work after adding a lot more triggers but maybe you know a better way.


My map uses custom resources which are represented by units using models such as rocks, logs, etc... To allow the player to collect these 'resources' I've created specific units so that when say a 'Tree Cutter' attacks and kills a 'Tree Resource' the player gains some of my custom wood resource.

I realized that managing a lot of units at once would be a bit tough so I decided to create a way for the player to set the unit up to go collect resources by itself without any further interaction (Unless the unit cannot find more resources).

Now onto the main topic...

I want it so that when the player types a command, for example lets just say 'GO', the trigger will take the currently selected unit, assign it to one of the unit groups (Tree Cutter, Rock Breaker, Hunter) and then be able to refrence the unit and tell it to go gather resources.

Because I managed to get it working I can get the unit to collect the resources but when it comes to getting the trigger to take the currently selected unit when the player types the command 'GO' I just can't get it to work.


Right now it is all set up with a clunky type command -> bring up dialogue box 'Do you want unit to auto collect?' (Yes/No) -> Put unit in group (Tree Cutter, Rock Breaker, Hunter) & Tell unit to go kill a tree, rock, or beast -> Every time unit kills tree, rock, or beast it is ordered to go kill another.
 

Deleted member 177737

D

Deleted member 177737

I just moved everything over to an ability based system. It works better than I had planned but there are still a few bugs to work out. +rep to all.
 
Last edited by a moderator:
Status
Not open for further replies.
Top