| 02-02-2004, 11:56 PM | #1 |
i know nothing about varibles, how to use them, how to make them, how to add to them, or anything! like how would i add players to a group, so i dont have to do the same trigger 6 times only changing the player!!! i know nothing!!! |
| 02-03-2004, 12:24 AM | #2 |
Read Tutorials......................... |
| 02-03-2004, 12:27 AM | #3 |
i cant find one, and i've looked pretty hard |
| 02-03-2004, 05:37 PM | #4 |
sorry to double post, but i really know nothing about varibles, and i know that they are important to do camplex things!!! plz help me! |
| 02-04-2004, 01:39 AM | #5 |
ok this helps a little, i will ask more questions when i get to them |
| 02-04-2004, 01:52 AM | #6 |
First you need to create a variable of the type 'player group'. Next you use the trigger 'Player Group - Add Player' and add the players you want to effect to the variable. Finish by using the action 'Player Group - Pick Every Player in Player Group and do Multiple Action'. Place your actions under the fore-stated action. Make sure to use 'picked player' when referring to the players in the variable. EXP: Adds Players 1 and 2 to a unit group and defeats them when Player 1 types Doom ----Trigger 1----- Events: Map Initialization Conditions: Actions: Add Player 1 (Red) to (Your UnitGroup Here) Add Player 2 (Blue) to (Your UnitGroup Here) ----Trigger 2---- Events: Player 1 (Red) types a chat message containing Doom as an exact match Conditions: Actions: Pick every unit in (Tour UnitGroup Here) and do actions (PlayerGroupActions) Game - Defeat (Picked Player) with the message: Defeat! |
| 02-04-2004, 09:31 PM | #7 |
thanks you so much, but there is one thing that i even less about useing: arrays. so i set an a array, and lets say this is for player kills, and a unit dies give owner of killing unit +1 to kills, but how to i say where in the array that it goes? |
| 02-04-2004, 09:43 PM | #8 |
I'm not sure I completely understand your question. Are you trying to create a kill scoreboard? If so, you might want to try using an integer variable rather then an array. Example: Event: A unit dies Action: Set {IntegerVariableHere} equal to ({IntegerVariableHere} + 1) Then set the score equal to {IntegerVariableHere}. |
| 02-04-2004, 09:46 PM | #9 |
then what do you use an array for? |
| 02-04-2004, 10:01 PM | #10 |
Arrays are kind of like space savers. Instead of making 5 unit variables you can represent all five units in one array. Just create a variable and check array. They appear with the variable name and a place for a number. This number is used to seperate one unit from another. This way you can one variable with five units represented. USE EXP: This trigger sets a footman and a grunt to a variable and tells them to attack one another when Player 1 types Attack -----Trigger 1----- Event: Map Intialization Condition: Action: Set (ArrayVariable) 1 to Grunt 0000 <gen> Set (arrayVariable) 2 to Footman 0001 <gen> -----Trigger 2----- Event: Player 1 types a chat message containing Attack as an exact match Condition: Action: Order unit (ArrayVariable) 1 to attack unit (ArrayVariable) 2 Order unit (ArrayVariable) 2 to attack unit (ArrayVariable) 1 |
| 02-05-2004, 02:25 PM | #11 |
so the number after the varible is the place inside of the varible, but isnt there more than just one place that can be put in? like a a plane, needing two points to say a location? am i wrong? |
| 02-05-2004, 07:02 PM | #12 |
An merely refers to a certain unit within the variable. It like saying Footman 1, Footman 2, Footman 3. You don't have to say Footman (1,2) because you're referring to a unit, not a point. |
| 02-05-2004, 10:02 PM | #13 |
thank you soo much, this will make my life easier! |
| 02-05-2004, 10:07 PM | #14 |
I'm glad I could help. Arrays are being implemented into my Custom Hero System and are making it much smaller variable-wise. |
| 02-05-2004, 10:16 PM | #15 |
ya i would love to get good enough with triggers to make a hero save and load code, i tried ripping the ones that people put up, but i dont understand most of the stuff, maybe you could help me with that? if so that would be the best thing in the world, but if not thats ok too. but hero codes are way above my head |
