Just a point in the map

koeienboei

Member
Reaction score
4
Is it possible to set a variable point to an point on the map, for example with x = 500 and y = 500, in one step like this:

Set RespawnPlace = (500,500)
 

Romek

Super Moderator
Reaction score
964
If you're using JASS, you should just use reals rather than locations.
JASS:
set SpawnX = 500
set SpawnY = 500

No cleaning up to do, more efficient, and almost every native takes reals anyway.

You could use structs:
JASS:
struct Point
    real x
    real y
endstruct

Though that requires creation, destruction, and still doesn't allow you to set it in one line (unless you use a method).
 

koeienboei

Member
Reaction score
4
I got this function to create a unit at x = 350 and y = 600, and it puts the unit in a variable Hero[PlayerNumber]:

set Hero[ GetConvertedPlayerId(GetTriggerPlayer()) ] = CreateUnit( GetTriggerPlayer(), GetUnitTypeId(GetTriggerUnit()) , 350.00, 600.00, 90.00 )

But the coordinates doesnt seem to work. The unit spawns at the same place when i use different x and y's
 

Sgqvur

FullOfUltimateTruthsAndEt ernalPrinciples, i.e shi
Reaction score
62
set Hero[ GetConvertedPlayerId(GetTriggerPlayer()) ] = CreateUnit( GetTriggerPlayer(), GetUnitTypeId(GetTriggerUnit()) , 350.00, 600.00, 90.00 )

set Hero[ GetConvertedPlayerId(GetTriggerPlayer()) ] = CreateUnit( GetTriggerPlayer(), GetUnitTypeId(GetTriggerUnit()) , x, y, 90.00 )

?

Also use GetPlayerId insplace of GetConvertedPlayerId
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top