Staredit Network > Forums > SC2 Assistance > Topic: how would i make a trigger that allows me to
how would i make a trigger that allows me to
Jul 26 2011, 10:15 pm
By: naipoo  

Jul 26 2011, 10:15 pm naipoo Post #1



im just askin
dont call me a dumbass plz
:crazy: :ermm:



None.

Jul 26 2011, 10:31 pm Ahli Post #2

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

- Create a global integer array for the players to store their killcount.
- Trigger with the event "unit dies"
and a condition that checks the following:
1. attacker is human (check if the player is between 1 and x). you should know how many humans you have in your map that can gain money for kills
AND
2. the triggering player has to be the attacker's enemy (no teamkilling allowed to get money)

In the actions do the following:
-if the player's variable is < 50, then raise the players variable by 1;
else: give money and set the variable to 0

If you have no idea what I'm talking about I can make screenshots or post a map.




Jul 26 2011, 10:36 pm naipoo Post #3



yes i am a bit confused screen shots would be helpful
:D



None.

Jul 26 2011, 10:37 pm FatalException Post #4



Make an integer array variable to hold the kill count of each player. When the event "Unit Killed" occurs, add 1 to the index of the array tracking Killing Player's kills. If the value of that index modulo 50 is equal to 0, modify the mineral player property accordingly. Here's some pseudocode:

Code
int[] kills = {0,0,0,0}; //should have a number of indices equal to the number of players you're tracking

if(UnitKilled(Any)) //if a unit is killed
{
   kills[UnitKilled(Any).KillingPlayer] += 1; //add 1 to the killer's kill count
   if((kills[UnitKilled(Any).KillingPlayer] % 50) = 0) //if the kill count is divisible by 50 with no remainder
   {
       ModifyPlayerProperty(UnitKilled(Any).KillingPlayer, minerals, add, amount); //add amount of minerals to the killing player's stockpile
   }
}


Edit: Crap, Ahli types faster apparently.

Double edit: Screenshot of the generalized case here: http://i55.tinypic.com/29c486v.jpg

Post has been edited 1 time(s), last time on Jul 26 2011, 10:48 pm by FatalException.



None.

Jul 26 2011, 10:38 pm naipoo Post #5



would i do the sameif i wanted to give them a unit like a civ every 50 kills?



None.

Jul 26 2011, 10:51 pm FatalException Post #6



Yes, just change the Modify Player Properties to to some variety of the Create Units command.



None.

Jul 26 2011, 10:58 pm naipoo Post #7



THANK YOU SO MUCH :D

Post has been edited 1 time(s), last time on Jul 26 2011, 11:04 pm by Roy. Reason: Excessive Smilies



None.

Jul 27 2011, 6:36 pm naipoo Post #8



THIS IS NOT SOLVED yet
um i cant find how to put in an "if" in the actions



None.

Jul 27 2011, 7:30 pm Devourer Post #9

Hello

Still having problems? I'm asking because of your other topics.



Please report errors in the Staredit.Network forum.

Jul 27 2011, 11:01 pm Roy Post #10

An artist's depiction of an Extended Unit Death

Quote from naipoo
THIS IS NOT SOLVED yet
Please do not make "Thank you" posts if you haven't applied the advice given or otherwise solved the issue. Your posts should either contribute towards getting to the solution (i.e. saying what you tried and how it didn't work) or to confirm that the problem has been solved.

Quote from naipoo
um i cant find how to put in an "if" in the actions
There's an action called "If / Then / Else" that you can put in actions. If you need am if condition for the whole trigger, it may be better to create a condition instead of an action for this.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[12:34 pm]
NudeRaider -- curiosity kills the cat!
[06:18 am]
Sylph-Of-Space -- No complaints here, i'm just curious!
[11:05 pm]
Ultraviolet -- :wob:
[03:55 pm]
Zoan -- :wob:
[2024-5-18. : 10:34 am]
NudeRaider -- SEN doesn't rely on spammers initiate its sleep cycle. It hat fully automated rest and clean-up phases. Please understand that this is necessary for the smooth operation of the site. Thank you.
[2024-5-18. : 3:45 am]
Sylph-Of-Space -- Does the shoutbox get disabled when there's spammers?
[2024-5-17. : 6:47 am]
NudeRaider -- lil-Inferno
lil-Inferno shouted: nah
strong
[2024-5-17. : 5:41 am]
Ultraviolet -- 🤔 so inf is in you?
[2024-5-17. : 4:57 am]
O)FaRTy1billion[MM] -- my name is mud
[2024-5-17. : 4:35 am]
Ultraviolet -- mud, meet my friend, the stick
Please log in to shout.


Members Online: Roy, lil-Inferno, NudeRaider