Poll | | What game does everyone play now? | Starcraft 2 | | 26% | [ 8 ] | Warcraft 3 | | 35% | [ 11 ] | League of Legends | | 19% | [ 6 ] | World of Warcraft | | 0% | [ 0 ] | Diablo 2 | | 0% | [ 0 ] | No games at all | | 10% | [ 3 ] | Other game not listed | | 10% | [ 3 ] |
| Total Votes : 31 |
|
| | Help Me Plox Sooner Than Later | |
| | Author | Message |
---|
AmAzIn[G] Commander
| Subject: Help Me Plox Sooner Than Later Wed Jul 13, 2011 10:21 pm | |
| Ok you all know my maps bugged. Here's the trigger, help me out lol. I know it's massive, maybe help me simplify it? Btw: There is 45 units that I have, the reason I made them all level 1 creeps is so that I could add more units with ease (lol I know right, this trigger makes things easier on you? What a joke amaz) Trigger: Initialization Trigger: New Round Trigger: Restart Round Variables: Basically if you can help me with this trigger I can finish my map. (Triggering is my weakest point, I'm really good at terraining tho ) | |
| | | Pat1487 Moderator
| Subject: Re: Help Me Plox Sooner Than Later Thu Jul 14, 2011 2:47 am | |
| Im not going to make your trigger work because its terrible, honestly i cant even see how its able to make any random units at all But i will give you a rough rundown of the basics on how to do it better
Make an array for the units Lets call it playableunits[] Make its size 45 At map init, set it to all the units they could get, 1 at a time So set playableunits[1]=Demon Hunter, playableunits[2]=Blademaster, and so on down to 45 and all the units they can get have been added
Make a loop from 1 to 12 (or however many players can play, in your trigger you have it as 12, but then in another area you have it as 8, so im not sure if its 12 max players or 8 ) Inside the loop generate a random number between 1 and 45 and set it to a var, lets call that var randunit Check if player((Integer A)) is playing Unit -Create 1 playableunits[randunit] for player((Integer A)) Use this loop any time you need to give a unit to the player (like at a new round and the start of the game) In fact you can just have a trigger that has this loop and call that trigger when you want to use it so that you dont need to make it more then once
And thats it You dont need 20 different random variables to make 1 thing random | |
| | | AmAzIn[G] Commander
| Subject: Re: Help Me Plox Sooner Than Later Thu Jul 14, 2011 10:27 am | |
| - Pat1487 wrote:
- Im not going to make your trigger work because its terrible, honestly i cant even see how its able to make any random units at all
But i will give you a rough rundown of the basics on how to do it better
Make an array for the units Lets call it playableunits[] Make its size 45 At map init, set it to all the units they could get, 1 at a time So set playableunits[1]=Demon Hunter, playableunits[2]=Blademaster, and so on down to 45 and all the units they can get have been added
Make a loop from 1 to 12 (or however many players can play, in your trigger you have it as 12, but then in another area you have it as 8, so im not sure if its 12 max players or 8 ) Inside the loop generate a random number between 1 and 45 and set it to a var, lets call that var randunit Check if player((Integer A)) is playing Unit -Create 1 playableunits[randunit] for player((Integer A)) Use this loop any time you need to give a unit to the player (like at a new round and the start of the game) In fact you can just have a trigger that has this loop and call that trigger when you want to use it so that you dont need to make it more then once
And thats it You dont need 20 different random variables to make 1 thing random Dark already helped me do this but for some reason the stupid trigger didn't work. (And when I say this dark, I don't mean your trigger is stupid, I mean the making a random unit trigger all together is stupid ! | |
| | | Pat1487 Moderator
| Subject: Re: Help Me Plox Sooner Than Later Thu Jul 14, 2011 11:17 am | |
| If you already got help why didnt your delete your post, or at least say something Not going to waste my time telling you what to do for your stuff that someone else has already done
Also, 12 calls to the same function in a row, learn to loop | |
| | | Sponsored content
| Subject: Re: Help Me Plox Sooner Than Later | |
| |
| | | | Help Me Plox Sooner Than Later | |
|
| Permissions in this forum: | You cannot reply to topics in this forum
| |
| |
| |