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.
[07:41 pm]
Ultraviolet -- just sent you a message on Discord. I suspect you're probably trying to change unit speeds for units that don't use flingy.dat for movement (like any units that walk instead of hovering/flying). You can change their movement to flingy, but they unfortunately look more like they're gliding than walking when you do that.
[07:31 pm]
Symmetry -- EE2, I've been using setdatfile successfully for units.dat and weapons.dat but the flingy changes don't seem to happen
[05:25 pm]
Ultraviolet -- in EE2 you just open DatEdit, go to the flingy tab, and make whatever changes you want. Though if you want to do dynamic shit, you have to use the trigger editor with the setdatfile action. And of course you have to inject your changes when done. Can give more specific troubleshooting advice if you provide more details
[05:20 pm]
Ultraviolet -- Symmetry
Symmetry shouted: why can't I seem to make eud editor change flingy.dat D:
Are you using EE2 or EE3?
[04:57 pm]
Symmetry -- wdym
[02:24 pm]
Apos -- :wob:
[04:16 am]
NudeRaider -- files in c:\program files\ are protected
[2026-7-11. : 8:11 pm]
Symmetry -- why can't I seem to make eud editor change flingy.dat D:
[2026-7-11. : 4:33 pm]
Ultraviolet -- :wob:
[2026-7-10. : 11:00 pm]
Vrael -- :wob:
Please log in to shout.


Members Online: O)FaRTy1billion[MM], lil-Inferno, Symmetry