• 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.

[vJASS] Need help adding a portion of code

Status
Not open for further replies.
Level 4
Joined
May 27, 2012
Messages
60
http://www.hiveworkshop.com/forums/spells-569/ultimate-hero-pick-system-2-0-0-4-vjass-206059/

In this public hero pick system that I want to use, it places heroes at whatever X,Y coordinates I choose as the Author made it highly configurable.

But what I need help with is, if I was to make a hero line wars style game, how would I make the heroes be placed on each separate side based on player color since I don't want everyone spawning on one side for a hero wars type game.

JASS:
 call ShowSystem(Player(i), false)
            set HERO_SPAWN_X[i] = -1408.00 //X Coordinate, it's value is shown in WE bottom left corner
            set HERO_SPAWN_Y[i] = -1728.00 //Y Coordinate, it's value is shown in WE bottom left corner

Thanks in advanced to anyone who can help
 
Well, i is the variable that reference which player, so what you need is to make a function that takes a player's index and returns its spawn coordinates. Try this:

JASS:
if i > 5 then
    set HERO_SPAWN_X[i] = {northSpawnX}
    set HERO_SPAWN_Y[i] = {northSpawnY}
else
    set HERO_SPAWN_X[i] = {southSpawnX}
    set HERO_SPAWN_Y[i] = {southSpawnY}
endif
 
Level 4
Joined
May 27, 2012
Messages
60
Well, i is the variable that reference which player, so what you need is to make a function that takes a player's index and returns its spawn coordinates. Try this:

JASS:
if i > 5 then
    set HERO_SPAWN_X[i] = {northSpawnX}
    set HERO_SPAWN_Y[i] = {northSpawnY}
else
    set HERO_SPAWN_X[i] = {southSpawnX}
    set HERO_SPAWN_Y[i] = {southSpawnY}
endif

Thanks I'll try it! I'm very very new to Jass and what he created makes me want to make a map using it :)
 
Status
Not open for further replies.
Top