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.
[02:53 am]
Mr.BurnLiquid -- Symmetry
Symmetry shouted: I'll check it out this weekend!
Thanks
[02:47 am]
Symmetry -- I'll check it out this weekend!
[02:40 am]
Mr.BurnLiquid -- Symmetry
Symmetry shouted: Another map maker? Damn we really ARE back
I invite you to try out the map I modified. I don't have the creativity to create maps from scratch, but I do have the know-how to modify existing ones; my project is to tweak community campaigns (specifically those with errors—to make them playable.
[02:27 am]
Symmetry -- Another map maker? Damn we really ARE back
[01:51 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Now that I wanted to change my avatar, the error image is showing up, haha.
[01:34 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Mr.BurnLiquid
Mr.BurnLiquid shouted: Ultraviolet Thanks; I'm new to the site and a Spanish speaker. I must have missed the part where it was prohibited—I'll change it now.
I invite you to try out a mission I'm modifying from *StarCraft Reversed*; I'm trying to make it more playable and challenging.
[01:33 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Thanks; I'm new to the site and a Spanish speaker. I must have missed the part where it was prohibited—I'll change it now.
[01:31 am]
Ultraviolet -- Mr.BurnLiquid
Mr.BurnLiquid shouted: Ultraviolet Is it forbidden to have a large avatar?
actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
[12:20 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: https://staredit.net/profile/133367/ dude's avatar is massive
Is it forbidden to have a large avatar?
[12:04 am]
Ultraviolet -- https://staredit.net/profile/133367/ dude's avatar is massive
Please log in to shout.


Members Online: City, sarahtaylor