Like a unit dies, it drops a random item frm the current items existing in the Data editor. I need the part with droping a random item out of the items that are currently in the data editor. Any idea to do that in the simplest way?
Wait, I think I got it, seems there is no way to create a random unit other than setting through a variable.
I am not really sure what u mean, but i would make each item a variable. Soooo say there are 10 items do an action that is randomly choose an integer between 1-10. then an If then else saying If chosen was 1 then create 1 item at place of triggering unit. etc etc
hmm you should take a look in the Data editor and go to the Tab Loot. You can make an killed unit drop certain classes or levels, so it will only drop for example from level 3 to 7 items. =3
Basically, create global variable Unit Type e.g X= Random Item = No Game Link <Game Link - Unit[33]>
So with this global variable set all the Arrays somewhere, like in Map Initialization event trigger. Like
Variable - Set Random Item[1] = Gas (Natural) ... etc until the final array and when a unit I want dies:
Unit - Create 1 Random Item[(Random integer between 1 and 33)] for player 1 at (Position of (Triggering unit)) using default facing (No Options)
where the Triggering unit is for 'Any Unit dies' event
Thanks, didn't know it can be done in Data too, have to check that out.
Like a unit dies, it drops a random item frm the current items existing in the Data editor. I need the part with droping a random item out of the items that are currently in the data editor. Any idea to do that in the simplest way?
Wait, I think I got it, seems there is no way to create a random unit other than setting through a variable.
I am not really sure what u mean, but i would make each item a variable. Soooo say there are 10 items do an action that is randomly choose an integer between 1-10. then an If then else saying If chosen was 1 then create 1 item at place of triggering unit. etc etc
hmm you should take a look in the Data editor and go to the Tab Loot. You can make an killed unit drop certain classes or levels, so it will only drop for example from level 3 to 7 items. =3
@patrickwobben: Go
OO i dont much about data editor, hey patrick can u look at my post of making a unit gatherable, hopefully ull b able to help
Actually I did it using this thread:
http://www.sc2mapster.com/forums/development/triggers/21717-random-unit-creation/#p7
Basically, create global variable Unit Type e.g X= Random Item = No Game Link <Game Link - Unit[33]>
So with this global variable set all the Arrays somewhere, like in Map Initialization event trigger. Like
Variable - Set Random Item[1] = Gas (Natural) ... etc until the final array and when a unit I want dies:
Unit - Create 1 Random Item[(Random integer between 1 and 33)] for player 1 at (Position of (Triggering unit)) using default facing (No Options)
where the Triggering unit is for 'Any Unit dies' event
Thanks, didn't know it can be done in Data too, have to check that out.
thats exactly what i said lol :) anyways good for u