• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Spawn Points Across the Map

Status
Not open for further replies.
Level 8
Joined
Oct 20, 2010
Messages
213
I am looking for insight on an alternative to the solution I am currently using. For my map, I have 300+ preplaced wisps, that are solely used at initialization to have their points saved into an array and removed. These points are then used as "spawn points" for enemies throughout the game.

Is there an alternative to this that is as easy, or easier, to use? Without the downside of bloating my map with all the units at the start of the game, or perhaps this is actually a nonissue and I'm worrying about nothing... as I assume having 300+ units just to be removed is a bad idea.
 

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,375
I wouldn't worry about it too much.

That being said, there's probably a way to get the x/y values of each wisp and store that in a text file.

Edit #2: I got something working. I attached the map.
The map will save a file in your Documents that contains the code for creating Points (locations) at the position of each Wisp. It'll look like this:
Code:
    call Preload( "set udg_Points[1] = Location(728.000, 564.250)" )
    call Preload( "set udg_Points[2] = Location(485.500, 561.000)" )
    call Preload( "set udg_Points[3] = Location(77.250, 511.000)" )
    call Preload( "set udg_Points[4] = Location(-208.000, 400.500)" )
    call Preload( "set udg_Points[5] = Location(-526.750, 159.250)" )
    call Preload( "set udg_Points[6] = Location(-635.250, 1.000)" )
    call Preload( "set udg_Points[7] = Location(-580.250, -207.250)" )
    call Preload( "set udg_Points[8] = Location(-487.000, -341.750)" )
    call Preload( "set udg_Points[9] = Location(-396.500, -415.000)" )
    call Preload( "set udg_Points[10] = Location(-307.000, -465.250)" )
    call Preload( "set udg_Points[11] = Location(-96.250, -530.250)" )
    call Preload( "set udg_Points[12] = Location(186.000, -679.250)" )
    call Preload( "set udg_Points[13] = Location(388.000, -752.500)" )
    call Preload( "set udg_Points[14] = Location(482.500, -808.750)" )
    call Preload( "set udg_Points[15] = Location(613.500, -608.500)" )
    call Preload( "set udg_Points[16] = Location(683.000, -300.000)" )
    call Preload( "set udg_Points[17] = Location(718.500, -116.500)" )
    call Preload( "set udg_Points[18] = Location(757.000, 75.500)" )
    call Preload( "set udg_Points[19] = Location(747.500, 189.750)" )
    call Preload( "set udg_Points[20] = Location(661.000, 278.250)" )
    call Preload( "set udg_Points[21] = Location(555.000, 319.000)" )
You can then open this in your IDE of choice (I like Visual Studio Code) and easily separate the unwanted call Preload stuff to get exactly what you need:
Code:
set udg_Points[1] = Location(728.000, 564.250)
set udg_Points[2] = Location(485.500, 561.000)
set udg_Points[3] = Location(77.250, 511.000)
set udg_Points[4] = Location(-208.000, 400.500)
set udg_Points[5] = Location(-526.750, 159.250)
set udg_Points[6] = Location(-635.250, 1.000)
set udg_Points[7] = Location(-580.250, -207.250)
set udg_Points[8] = Location(-487.000, -341.750)
set udg_Points[9] = Location(-396.500, -415.000)
set udg_Points[10] = Location(-307.000, -465.250)
set udg_Points[11] = Location(-96.250, -530.250)
set udg_Points[12] = Location(186.000, -679.250)
set udg_Points[13] = Location(388.000, -752.500)
set udg_Points[14] = Location(482.500, -808.750)
set udg_Points[15] = Location(613.500, -608.500)
set udg_Points[16] = Location(683.000, -300.000)
set udg_Points[17] = Location(718.500, -116.500)
set udg_Points[18] = Location(757.000, 75.500)
set udg_Points[19] = Location(747.500, 189.750)
set udg_Points[20] = Location(661.000, 278.250)
set udg_Points[21] = Location(555.000, 319.000)
This is now usable code that you can put inside a function and call. It will create all of these Points for you which represent the positions of the Wisps. Now the Wisps are no longer needed and can be permanently deleted (backup your map before deleting all of them).

If you have trouble with formatting the text then you can send me your Preload file and I'll do it for you.
 

Attachments

  • DebugLogUncle.w3x
    17.5 KB · Views: 9
Last edited:
Status
Not open for further replies.
Top