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.
[05:21 pm]
NudeRaider -- Oh_Man
Oh_Man shouted: NudeRaider yeh thts straight up cheating
the mutas yes, the wraiths probably not. Have you even watched the video? ;)
[12:56 pm]
Oh_Man -- NudeRaider
NudeRaider shouted: Oh_Man Artosis hasn't caught on how devastating the perfect focus fire is. With the mutas he was like "the Mutas always seem to have less hp than against a human". But he didn't notice that the flock he had selected always just had one muta that was hurt. Same with the wraiths here. He's talking about how valks+wraith is gonna destroy Pluto's valks, then 5s later he's dumbfounded the human player's air is just gone and he never figured out why. And for some reason didn't even think to go back and look at the battle.
yeh thts straight up cheating
[12:24 pm]
Oh_Man -- arty's done another vid. he's also announced he's going to organise showmatches with pro, with NO maphacks, so we can see its actual capabilities
[10:09 am]
NimoStar -- It can by playing the same map thousands of times. It is similar to AI speedrunning games
[2026-9-23. : 2:30 am]
Symmetry -- I dreamed about that as a kid. The idea of a computer capable of analyzing a starcraft map and calculating the fastest possible way to hit the victory condition
[2026-9-23. : 2:29 am]
Symmetry -- But can AI beat my custom maps?
[2026-9-22. : 12:32 pm]
Oh_Man -- yea APM vs eAPM
[2026-9-22. : 8:48 am]
NimoStar -- plus most of the human APM is just spam clicking APM inflation
[2026-9-22. : 8:47 am]
NimoStar -- the thing with the "*12" thing is completely misleading. The AI isn't using two control groups, it can use each of those actions to command a single unit individually and issue different commands to each single unit.
Please log in to shout.


Members Online: Heinermann