| 07-17-2008, 09:21 PM | #1 |
if anyone can help please do this is my current trigger i got from another thread somewhere in this site... Trigger: ![]() Income-
![]() event: periodic event: every 5 secs
![]() Condition: Player owns a (insert unit here)
![]() Action: Give player goldi cant find the condition so i was wondering if someone else could help find or they make their own i don't care if its in jass since all i'd have to do is set it to custom script and then copy and paste but i really need this and i may be able to finally set my map out into the open.... |
| 07-17-2008, 10:59 PM | #2 |
Please copy the triggers directly from WE. :P It's Player Comparison. |
| 07-17-2008, 11:00 PM | #3 |
i cant i told you in my post i cant find the condition part i have that in notepad |
| 07-17-2008, 11:06 PM | #4 |
Have you tried "Pick every unit of type <insert unit type> and do action: Add X gold to Owner of Picked Unit"? Or do you just want to give the gold once, regardless of how many units of that type exist for the player? EDIT: Here's two triggers, first is for gold on a per unit basis (each unit will result in X gold for the owner), second is for gold on a per player basis (player will result X gold if they have at least 1 unit, but additional gold will not be received for more than 1 unit) Trigger: Trigger: Just edit the unit type to whatever you need |
| 07-17-2008, 11:24 PM | #5 | |
Quote:
|
| 07-18-2008, 12:44 AM | #6 |
bah late reply but i cant find the Set SomeGroup = (Units of type Footman) thx for the all the help guys |
| 07-18-2008, 01:11 AM | #7 |
SomeGroup is just the name of a variable, and the action itself is called "Set Variable". |
| 07-19-2008, 02:51 AM | #8 |
ok um i cant get the type part of the trigger i can get the set variable action but nothing after that and my friend right now is afk prolly for the night |
| 07-19-2008, 08:02 AM | #9 |
Did you create a variable in the Variable Editor of type Unit Group? |
| 07-19-2008, 10:51 PM | #10 |
no thx for the reply... i think i have it =) Trigger: if this is wrong please tell me |
| 07-19-2008, 11:35 PM | #11 |
First of all, your "SomeGroup" variable seems to be a unit type variable, not unit group variable, because you're setting it to "graveyard" instead of "Units of type Graveyard". Furthermore, you made it an array for no adequately explained reason, untick the "array" checkbox in the variable edit window, it is not needed for this purpose. The rest seems ok, of course once you have a proper unit group variable you'll want to be using that for your unit group loop instead of creating a new group in that line, and you'll want to clean up the variable after the loop. Either that, or just remove the set variable action and keep the rest as is. You'll have a small memory leak in there but I've seen worse. Actually, no, you can't keep the rest as is, you need to replace "triggering unit" with "picked unit", triggering unit makes no sense there. |
| 07-20-2008, 06:02 PM | #12 | |
Quote:
my friend says i need the variable im getting confused =( |
| 07-20-2008, 07:23 PM | #14 |
wow thx and thx again for the trigger uh so then this should be right? Trigger: undead i![]() Conditionsand wow i didnt know they could all be in one trigger O.o p.s. this is just a beta for the first release the income for all races will be set to one income until later advancment |
| 07-20-2008, 10:09 PM | #15 |
What you have there should work, however you didn't write it correctly so you have a memory leak in there. As I explained before and wrote in my example triggers, you're supposed to use your unit group variable in the unit loop. Instead, you're using "(Units of type Graveyard)" again, which creates another unit group object. That defeats the purpose of us having the variable in the first place; we store the unit group to a variable for the sole purpose of being able to destroy it with that last line of the trigger after we're done using it. |
