Staredit Network > Forums > SC2 Assistance > Topic: [SOLVED] Respawning for an Arena-type map.
[SOLVED] Respawning for an Arena-type map.
Jul 24 2011, 11:45 pm
By: Project100  

Jul 24 2011, 11:45 pm Project100 Post #1



I decided to start mapmaking with SC2... and I must say the triggers are strange. I am remaking the arena map I was going to make prior to SC2 coming out.

For the trigger(s): I have 51 respawn points, and want to make it randomly respawn you at one of them. After messing around with triggers for a while, I don't even know how to make it respawn a unit at one point.

Anyone have an example of this sort of thing or instructions for it?



None.

Jul 24 2011, 11:57 pm Roy Post #2

An artist's depiction of an Extended Unit Death

The "Create Unit" actions take a unit type and a point. To make this a random point in your group of respawn points, you're going to need to put these points into an array and then randomly select one to use.
Make a global point variable of array size 50. Set point[0] to your first point, point[1] to your second point... point[50] to your 51st point.

To pick a random point in this array, randomize an integer value between 0 and 50. Then use this random number as the index for the array. Here's an example:

SpawnAtRandomPoint
    Events
        ------- Spawn Event
    Local Variables
        RandomPoint = My_Global_Point_Array[(Random integer between 0 and 50)] <Point>
    Conditions
    Actions
        Unit - Create 1 My_Spawning_Unit for player 1 at RandomPoint facing 270.0 degrees (No Options)

The "Random Integer" function can be found under the Math label.

If you're not understanding all of this, you may get some help from the GalaxyWiki. Here's some useful links:

Variables (and arrays)
Triggers

Hope this helps!




Jul 25 2011, 12:17 am Project100 Post #3



I can't figure out how to set the variable portion of it



None.

Jul 25 2011, 12:23 am Roy Post #4

An artist's depiction of an Extended Unit Death

There's a "Set Variable" action, but you can also set it inline (like I did above). To do this, create a point variable and click on it. Just below the trigger box there is a section to set "Initial Value." Double-click on this and you can set the initial point.




Jul 25 2011, 12:31 am Project100 Post #5



I got it to -almost- work... It respawns the unit, but it's not random at all and spawns them at the initial point.



None.

Jul 25 2011, 12:36 am Roy Post #6

An artist's depiction of an Extended Unit Death

I could point out the error if you post the trigger and/or the map.

It's either that you aren't setting up your array correctly, or you didn't set up the randomization correctly.




Jul 25 2011, 12:55 am Project100 Post #7



Not sure how to type the trigger into chat... and i can't upload it because my upload space is a rather large negative number.

I have the variable type as Point, and the initial value as the first point of the array, then i have it set underneath Point to Array with the first number as 1, and the second as 50.



None.

Jul 25 2011, 1:22 am Roy Post #8

An artist's depiction of an Extended Unit Death

You can upload files to sites like http://www.filedropper.com/ and http://www.mediafire.com/ for free.

Did you fill the array variable's indexes with all of your points?




Jul 25 2011, 1:25 am Project100 Post #9



Here we go, managed to get it to let me upload the map.

Attachments:
ArenaMap.SC2Map
Hits: 3 Size: 103.15kb



None.

Jul 25 2011, 2:13 am Roy Post #10

An artist's depiction of an Extended Unit Death

Alright, so you did a couple of things wrong. First, you never created a global variable point array to hold all your points. Second, your local variable wasn't random (you made it an array, which it shouldn't be, and filled all values with point 00).

Attached is the corrected trigger setup. In the Initialization trigger, you can see how each point is placed into an index in the global variable. In the Spawn_At_Random_Point trigger, you can see how a point is selected randomly from the array, and that randomly selected point is used when creating the unit.

Attachments:
ArenaMap.SC2Map
Hits: 1 Size: 108.92kb




Jul 25 2011, 2:17 am Project100 Post #11



Awesome. Thanks.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[02:53 am]
Mr.BurnLiquid -- Symmetry
Symmetry shouted: I'll check it out this weekend!
Thanks
[02:47 am]
Symmetry -- I'll check it out this weekend!
[02:40 am]
Mr.BurnLiquid -- Symmetry
Symmetry shouted: Another map maker? Damn we really ARE back
I invite you to try out the map I modified. I don't have the creativity to create maps from scratch, but I do have the know-how to modify existing ones; my project is to tweak community campaigns (specifically those with errors—to make them playable.
[02:27 am]
Symmetry -- Another map maker? Damn we really ARE back
[01:51 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Now that I wanted to change my avatar, the error image is showing up, haha.
[01:34 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Mr.BurnLiquid
Mr.BurnLiquid shouted: Ultraviolet Thanks; I'm new to the site and a Spanish speaker. I must have missed the part where it was prohibited—I'll change it now.
I invite you to try out a mission I'm modifying from *StarCraft Reversed*; I'm trying to make it more playable and challenging.
[01:33 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Thanks; I'm new to the site and a Spanish speaker. I must have missed the part where it was prohibited—I'll change it now.
[01:31 am]
Ultraviolet -- Mr.BurnLiquid
Mr.BurnLiquid shouted: Ultraviolet Is it forbidden to have a large avatar?
actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
[12:20 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: https://staredit.net/profile/133367/ dude's avatar is massive
Is it forbidden to have a large avatar?
[12:04 am]
Ultraviolet -- https://staredit.net/profile/133367/ dude's avatar is massive
Please log in to shout.


Members Online: UndeadStar, Ultraviolet