There is no pre-built function as far as I know. However, it's pretty easy to build one yourself. You need a variable array that holds each unit type, and then it's as easy as picking a random number within the bounds of your array and creating that unit type at your point.
Its all done, everything works now lol. Actually the error itself was a parameter error. I believe I had nested functions in a weird order that caused the error to occur. But it all works now, after I revamped it. Thanks everyone
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Is their currently a function that would create a random unit at a point? Because I've looked through and seen none. any help?
@cstorm15: Go
There is no pre-built function as far as I know. However, it's pretty easy to build one yourself. You need a variable array that holds each unit type, and then it's as easy as picking a random number within the bounds of your array and creating that unit type at your point.
Changed how I did this. I did how you said but now it gives me an error when the function attempts to run. Here's the code
Make sure every variable from RandomUnitType[0] to RandomUnitType[39] exists and is linked to a Unit Type
@cstorm15: Go What xKenneth said. If you haven't initialized each unit type in RandomUnitType[x], you'll get errors.
do tests in window mode with debug window (editor options) and tell us the error. probably out of bounds
or Owner of (Triggering unit) is emtpy 10 seconds after an units dies. store it in a variable before the wait
@b0ne123: Go
Ooh, forgot about owner of triggering unit. Good catch.
Its all done, everything works now lol. Actually the error itself was a parameter error. I believe I had nested functions in a weird order that caused the error to occur. But it all works now, after I revamped it. Thanks everyone