[skip all navigation]

how would i make a trigger that allows me to, give minerals very 50 kills

Creator: naipoo
Time: Jul 26 2011, 10:15 pm

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

[Avatar]
offlinecontact
Rank: Member
im just askin
dont call me a dumbass plz
:crazy: :ermm:

Top

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

[Avatar]
Nothing yet! Almost done. Very powerful, very strong.
offlinecontact
Rank: Elite
- 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.

(user posted image)
Top

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

[Avatar]
offlinecontact
Rank: Member
yes i am a bit confused screen shots would be helpful
:D

Top

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

[Avatar]
offlinecontact
Rank: Veteran
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
This post was edited 1 time, last edit by FatalException: Jul 26 2011, 10:48 pm.

Top

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

[Avatar]
offlinecontact
Rank: Member
would i do the sameif i wanted to give them a unit like a civ every 50 kills?

Top

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

[Avatar]
offlinecontact
Rank: Veteran
Yes, just change the Modify Player Properties to to some variety of the Create Units command.

Top

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

[Avatar]
offlinecontact
Rank: Member
THANK YOU SO MUCH :D
This post was edited 1 time, last edit by Roy: Jul 26 2011, 11:04 pm.  Reason given: Excessive Smilies

Top

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

[Avatar]
offlinecontact
Rank: Member
THIS IS NOT SOLVED yet
um i cant find how to put in an "if" in the actions

Top

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

[Avatar]
Back in action!
offlinecontact
Rank: Veteran
Still having problems? I'm asking because of your other topics.

(user posted image)
Top

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

[Avatar]
An artist's depiction of an Extended Unit Death
offlinecontact
Rank: Veteran
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.

Top
0 members in this topic (italic members are currently writing a reply): None
+ guest(s)


[01:07 pm]
Oh_Man -- Oh_Man -- How do I stop the URL in my signature putting staredit in front???
[01:07 pm]
Oh_Man -- Well all I remember is trying to watch some UMS replay and it not being anything like what actually happened.
[12:54 pm]
Roy -- "Oh_Man -- I thought replays didn't work on UMS???" Wait, really? It would be impossible to have that Temple Siege ranking if that were the case. Or speedrun rankings for bounds. Or just proving that you beat a map.
[10:55 am]
KrayZee -- Easy.
[10:54 am]
Oh_Man -- How do I stop the URL in my signature putting staredit in front???
[10:51 am]
Oh_Man -- Sorry to hear that bro.
[06:53 am]
Lanthanide -- so my dad's just been diagnosed with cancer (oral), but because I live in a country with sane healthcare the total cost to us has been $0
Please log in to shout.