• 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.

Add triggers to trigger group?

Status
Not open for further replies.
Level 9
Joined
Oct 15, 2006
Messages
339
(a revolutionary idea for items)
So i have a unit that acts more like an item. It is collected when you get near it. Then what is supposed to happen is a random specified trigger, of X number of triggers, will run.

I can add an array to Trigger(Trigger) but i cannot add TRIGGERS to the trigger variable.

So what then is the use of the Trigger variable? Is is "Add TRIGGER to Trigger Queue"? And what does it mean, "Triggers added to the trigger queue are executed one at a time, in turn."

Thanks
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
umm WHAT ??????????
array ??
arrayed trigger ????

every 0.5 seconds
pick every unit
set temp = picked unit
pick every unit near temp
if picked unit is a item type unit
remove picked unit
add that item to temp

remove leaks
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
Let's say these are your triggers:

Map Initialisation
Item_Trigger1
Item_Trigger2
Item_Trigger3

You have a variable of type trigger, array of 3.

In the Map initialisation trigger, do
Set Variable - set trigger[0] = Item_Trigger1
Set Variable - set trigger[1] = Item_Trigger2
Set Variable - set trigger[2] = Item_Trigger3

Now you can access those 3 triggers by saying "Trigger - run trigger[0]". To run a random trigger of these 3, just do:
Trigger - run trigger[rnd integer between 0 and 2]
 
Level 9
Joined
Oct 15, 2006
Messages
339
If it's anything, i use UMWSE.. and one of the variables is Trigger(trigger) and i can give it an array.

@Need_O2, it is initially a unit

@Eleandor, thanks. Also,
"Trigger - run trigger[rnd integer between 0 and 2]"

Should that be put in "custom text"? I don't suppose that will show up in GUI.

EDIT: ALSO @ NEED_O2, the concept for other maps is making items able to be picked and loaded into inventory just by walking in a relatively short distance to them, instead of having to stop and do whatcha do.
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
WE has the trigger variable too. Basically, a trigger is a "constant", so...

And no, you should just scroll down to "Trigger - run trigger", and select your trigger variable in the list instead of one of the "real" triggers. As your triggervariable is an array, you still need to tell a number to put in the array. I just gave "rnd integer between 0 and 2" as an example.
 
Level 9
Joined
Oct 15, 2006
Messages
339
So basically you are saying "yes" to my previous reply? Because the variable has to be set with the corresponding triggers. If i make the array equal to every trigger, then when i run the trigger group the action wil run through each array?

EDIT:
basically i can't run a random trigger?
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
I fail to understand your question.

A trigger variable is just a pointer to a trigger. It's the same as a unit variable, but this time with triggers you have made.
You can make this variable point to one of the triggers you made in your map. e.g.
Set Variable - set MyTriggerVar = Untitled Trigger 001

As MyTriggerVar can have an array, you can have a "group" of triggers by making this variable an array.

If you made your arrayed trigger variable, you can do multiple things. As an example you could do:

  • Running a triggergroup containing 5 triggers
  • Events
    • An event
  • Conditions
    • Some conditions?
  • Actions
    • For each integer A from 0 to 4 do actions
      • Loop - actions
        • Trigger - run MyTriggerVar[Integer A]
  • Running a random trigger in a group of 5 triggers
  • Events
    • An event
  • Conditions
  • Actions
    • Trigger - run MyTriggerVar[Random integer between 0 and 4]
If you have a problem in a map, perhaps attach it and try to explain WHAT you want to make :p
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
pick every unit near temp
if picked unit is a item type unit

item type unit = Your unit that acts like item
like
if Unit Type of Picked Unit Equal to <Item like Acting Unit>
then
Create <your item> and give it temp to (works for units too)
Remove Picked Unit from game
else
dont put anything here

And this is how to make what you have asked for
Why am I trying to help guys like you anyway you dont even read what I have said
 
Level 9
Joined
Oct 15, 2006
Messages
339
item type unit = Your unit that acts like item
like
if Unit Type of Picked Unit Equal to <Item like Acting Unit>
then
Create <your item> and give it temp to (works for units too)
Remove Picked Unit from game
else
dont put anything here

And this is how to make what you have asked for
Why am I trying to help guys like you anyway you dont even read what I have said

i did read what you said. I even made two comments to you.

My first post stated that they are UNITS ACTING as items, and you gave me an item-based trigger. You also didn't know, or didn't understand that you can make an arrayed-based trigger-variable.

No one is asking for your help, though we're all very grateful for it... So, uhh, next time don't say "people like you", because that's kind of harsh to someone who didn't request your input specifically.

Again, i did read what you said. I have taken note. It was helpful because it is here.. it was just not specific enough for my needs.

So i thank you for your help, and +rep to you for your complimentary service all over the help forums. I have noticed you around more than anyone else. So HAH!

EDIT: ALSO, i said the unit ACTS like an item.. So, if you have an item that is not being used, it's the same as not even having that item. But when you use an item, it's been used, it's done. In the same way, if you run by this unit which triggers a trigger, you automatically gain SOMETHING, but NOT an item in an item-slot.. That's just redundant.
 
Last edited:
Status
Not open for further replies.
Top