| 06-02-2006, 11:38 AM | #1 |
I'm sure this requires JASS (and that's ok, I can check Vex's tutorial to see how to do this) but I need either a JASS or GUI trigger that checks to see how many players are in the game, and then do things to the map, like destroy starting gold mines at the empty areas. Any way I could do this? |
| 06-02-2006, 11:48 AM | #2 |
Well, to check how many players are here, use this trigger: Trigger: Count Players
![]() Conditions
And with gold mines, you will have to destroy them manually, but with triggers ofc :) Trigger: Actions
![]() Unit - Remove Gold Mine 0000 <gen> from the game |
| 06-02-2006, 07:32 PM | #3 |
... Im confused. If, then, else, and, or, etc. triggers make my brain itch *itches brain* Ok. Much better. How do you make an action within an action like you did? This trigger really makes my brain itch badly. I'm not a very advnced trigger maker. Just tell me how to set up action, followed by the if, else stuff and ill fill in the blanks. Basically, I need you to do this for me please. Tell me where & how to make action 1 (for each integer.....), the loop, and the if else conditions. GAHHH! so much trigger stuff, so little brain space. I'm gonna fiddle around a bit, see what I can find out on my own. Thanks for the tigger. So how do I connect the destroy gold mine to the trigger? O wait... Event: Map Init. Condition: Player one slot status equal to not playing Action: Destory gold mine 0000 ( or whatever it may be) And just make a trigger for each player (8) Sorry for rambling on and on ![]() EDIT: I cannot find the "loop-actions" Also, I cannot find the condition "((Player((Integer A))) slot status) Equal to is playing" I know where all but the Integer A part is. How do you make the player into an integer? Do I need to set the integer to something?((Integer A))) Last, what action do I do for the first action? "For each integer A, do actions"? |
| 06-02-2006, 08:26 PM | #4 |
Ok, give me a moment, il write it up. Write up: Ok, so we have: Trigger: Number of Players
![]() Conditions
Firstly. On the events, click new event then select Map Init (this should be default) Secondly, to get For each Integer A, first create a new action, were it says - All. Change to General. Look for a "For each Integer A, Do multiple Actions. By default, it will say from 1 - 10, change this to 1 - 12, the first player being 1, and the last being 12. Now you have the integer loop set up. Go back to general were you found the For each integer a, and look for If / then / else, multiple functions. Add it to your integer a loop. (Make sure its in the loop and not outside of it, i normally rightclick the loop and add the action from there) Once you have your if then else, right click If and click add condition, go to the tab that says "Player slot status Comparison". then click the text that says Player 1 Slot status. then another window will pop up, click Player 1, then another window will pop up, where it says Picked Player, change that too Conversion - Convert Player index to Player. click the 1 thats inside Player(). Then another window will come up, look on the tab for something that says For Loop Inteter A (it should be the second 1 down). Now press ok to all the windows. You should now have: Trigger: Number of Players
Now make a variable (Cntl + b) as a integer, call it something like NumberOfPlayers. In the actions under your If, where it says Then, add the action: Go to general again, click Set Variable, and then select the NumberOfPlayers variable, and set it to NumberOfPlayers = NumbersOfPlayers + 1, to do this click where it says value, and click the integer from the top. then press ok, it should then say in the box: "NumberOfPlayers + 1" Press ok a few times, and your done, you should have: Trigger: Number of Players
![]() Conditions
If not, post what you have |
| 06-02-2006, 08:27 PM | #5 |
K thx : ) OMG I don't know how to repay you here. Thank you so fricken much. I'm glad you walked me throughh it too so I could learn. I've got exactly what youve got, except the 12 is an 8 because ive only got 8 players. So how does this trigger work, and what do I do with it? |
| 06-02-2006, 08:54 PM | #6 |
Yes. If you had 8 players, it would simply as you said be: Trigger: Number of Players
![]() Conditions
|
| 06-02-2006, 08:54 PM | #7 | |
Quote:
One thing that you must take in accout with triggering is to be very efficient, I mean, as less triggers you use, your map will run better. It can be simplified with the trigger suggested by The)TideHunter(. I suggest to add in the else part of the conditional the action to remove the unused gold mine, something like that: Sorry if I wrote wrong the else condition, I don't have WC intalled in this computer. but you can get the idea, The)TideHunter( can check this. |
| 06-02-2006, 09:07 PM | #8 |
Thx for the else action moyack. From what I've seen before, I think your trigger will work fine. Course, I could be terribly wrong. I may have to ask about how to do the else action, but I'll try my best to do it before asking. @TideHunter I actually had gotten pretty close to what you had been doing. I had used the wrong for each action, integer A thingy, and was a little close in that a variable had to be used. I'm really starting to learn. I can't wait to show you guys my map when it's all done. (but that won't be for a while. I've still got tons of units to make, along with the terrain, triggers, etc. Ok Tide, heres a question for you, seeing as how your really good with triggers and JASS. I need a spell that will make a damging ligtning bolt, and I think I know how to do it. I;ve got a couple of theorys. I'll post them as I make them. If I run into any problems I'll lket you know : ) OK!!!! YAY I managed to complete my FIRST Trigger spell and I feel very proud of myself. Here is the trigger. Actually I don't know how to put triggers into messages. All i could find ar the trigger tags, and I don;t know how that works... Help plz! |
| 06-03-2006, 02:36 PM | #10 |
Thx again Tide. To see the spells I made, go to triggers and scripts and look for "My first trigger spell : )" That's mine. I posted the lightning bolt spell there, along with a fire spell at the end. Hope you like them! (yes, I know they leak. I'm going to get around to that as soon as I feel like learning custom scripts) |
