Staredit Network

Staredit Network -> UMS Assistance -> Executing an action when player kill at location..
Report, edit, etc...Posted by Waddupjee on 2005-12-02 at 23:12:23
How do I make a trigger when a current player kills something [i.e Mineral Chunk] at a certain location?

Eg. Placing a unit beside a mineral chunk will constantly give 5 ore. Once that mineral chunk is destroyed, disable giving 5 ore. There are 4 mineral chunks placed randomly in the map. [EDIT] In addition, a message will display. [/EDIT]

Using that example, can you explain how you would design this? I use StarForge and cannot find KillsAtLocation or anything related to that under the conditions...I've tried using "Bring" followed by "Kills" for Current player and it will not work. Help is much appreciated.
Thanks.
Report, edit, etc...Posted by Joshgt2 on 2005-12-02 at 23:14:11
Use a switch to do this. When the mineral chunk is there then you set the switch to do the conditions. When it is gone then you will clear the switch.
Report, edit, etc...Posted by Waddupjee on 2005-12-02 at 23:21:02
Sounds logical, thanks.
So what if I also want to add a message and other actions?
Report, edit, etc...Posted by Fwop_ on 2005-12-02 at 23:21:50
dont need to use a switch, just detect if it is there, if it is it will fire the actions, if it isnt, it wont fire the actions.
Report, edit, etc...Posted by KaboomHahahein on 2005-12-02 at 23:22:26
Or you just make a condition that was long as the mineral chunk is there (bring 1 mineral chunk), keep giving 5 ore. And when it is no longer there (bring 0) display the text.
Report, edit, etc...Posted by Waddupjee on 2005-12-02 at 23:33:16
QUOTE(Fwop_ @ Dec 2 2005, 11:21 PM)
dont need to use a switch, just detect if it is there, if it is it will fire the actions, if it isnt, it wont fire the actions.
[right][snapback]370000[/snapback][/right]


Okay...so how would I detect it then?

Okay...picture this:
-4 gas tanks (Hydrant)
-bring a SCV near it and it will continually give 5 ore
-each hydrant is placed in different location layers
-->Hydrant in Location 1
-->Hydrant in Location 2
-->Hydrant in Location 3
-->Hydrant in Location 4
-if Hydrant in Location 1 is destroyed, stop giving 5 ore any players in Location 1
---Note: Hydrant in Location 2, Location 3, and Location 4 are not affected---
-if Hydrant in Location 2 is destroyed (as well as in Location 1), Location 2 will stop giving 5 ore to any players
---Note: Hydrant in Location 3 and Location 4 are not affected---
-And so forth...

Now what conditions and actions are involved in this and in what order do I set them at?
Report, edit, etc...Posted by Fwop_ on 2005-12-03 at 00:51:42
If they are preplaced, just have a location over each hydrant and have a trigger something like this.

Trigger
Conditions:
¤ (Player Owning Hydrant) Brings exactly 1 hydrant to Hydrant 1
¤ Current Player brings at least 1 men to Hydrant 1
Actions:
¤ Modify resources: Add 5 minerals for Current Player
¤ Preserve Trigger


If the hydrant is not at its location, the trigger will never fire, thus giving no minerals.
Report, edit, etc...Posted by Waddupjee on 2005-12-03 at 12:58:36
Gonna try it out now. Thx for the suggestions.

Just one more question for Fwop_. How is it going to be possible to display text that a fire hydrant has been destroyed?

ADDITION:
QUOTE(Fwop_ @ Dec 3 2005, 12:51 AM)
If they are preplaced, just have a location over each hydrant and have a trigger something like this.



Trigger
Conditions:
¤ (Player Owning Hydrant) Brings exactly 1 hydrant to Hydrant 1
¤ Current Player brings at least 1 men to Hydrant 1
Actions:
¤ Modify resources: Add 5 minerals for Current Player
¤ Preserve Trigger


If the hydrant is not at its location, the trigger will never fire, thus giving no minerals.
[right][snapback]370109[/snapback][/right]



Doesn't work dude.
Report, edit, etc...Posted by Fwop_ on 2005-12-03 at 15:13:19
I think this how you wanted it. You can bring units to the hydrants and get more minerals. If you have at least one at more than 1 location you will get more money. When you kill one of the hydrants it will give you a text message saying its destroyed and won't give you any more money.
Next Page (1)