• 0

    posted a message on Randomly select integer array

    The warp animation works, thanks!

    So Set PointArray[(Random integer between 0 and 8)] = PointArray[(Random integer between 0 and 8)] is just picking a random point, and then changing it to be another random point? I'm trying to make it so that it'll pick one of the points at random.

    As it stands it'll randomly pick a spot and spawn the unit there. But if I add in a line to create the warp-in affect, it'l also be somewhere random: so the unit won't appear where the warp in affect is.

    I want it so that the trigger will randomly select one of the points from the point list, and then spawn/create/dowhatever to the point that was picked

    Posted in: Triggers
  • 0

    posted a message on Randomly select integer array

    Okay, I hope I say all this stuff right.

    I created a variable array for 9 points, since I want a trigger to randomly pick one of those points to create a unit at said point.

    I have a map initialization trigger that has Variable-Set PointArray[0] = point 1 (i did that for each point)

    Now in my creation trigger, I have Variable - Set PointArray[(Randon integer between - and 9)] = PointArray[(Random integer between 0 and 8)] Unit - Create 1 unit for Player at PointArray[(Random integer between 0 and 8)] facing 0.0 degrees

    Is this correct? Did I set up the trigger correctly? It does work in game - I just want to know if it's because of the intended function (the trigger selecting a random point and then spawning a unit there) or if it's because of something else.

    Also possible two for one? The unit spawning is a protoss unit, how can I get it to warp-in, instead of just poofing into existence? Would it be possible to have it warp in facing the direction I want it too? (having the warp-in effect facing the same direction that the unit will). Do I hide a unit somewhere on the map to use an ability to warp in the units, or can I just use triggers? (and avoid having to edit/make any abilities).

    Posted in: Triggers
  • To post a comment, please or register a new account.