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

Protoss Pylons - Best way to do it?

Status
Not open for further replies.
Level 9
Joined
Jun 18, 2004
Messages
565
I'm making a map right now (duh) and I want to put the Protoss Pylon can't-build-out-of-it's-range effect in, but before doing it I want to know the best way. Clearly the VERY best would just use blight that only the Pylon generates, but I'm already using it (for the Zerg) so it has to be something different.

I already have a pylon effect, a model. Is there any way to make it only show up for one player? Bearing in mind this is a "melee" style map, so variables are a no no.

Thanks in advance,

iron_warrior.
 
Level 5
Joined
Jun 3, 2007
Messages
167
cant u make a blight that doesnt change terrain looks? maybe give a selection point model and make it as big as the range it gives power, attach it to the model? although b visible to all. or make a trigger when its selected to cast an aoe that does no dmg but hits area of effect of range of power but that doesnt answer how to give power... maybe its way of giving power will b brilliance aura when buildings need mana to work and no natural mana regeneration. make triggers for the buildings for whenever u start research on a building it checks for mana and no mana cancels research?
 
Level 5
Joined
Jan 23, 2005
Messages
124
Not sure if this is possible, but my guess of what I would try if I had to was to set a different terrain with the skin type thing for the psi, and have a trigger that different terrain blight =/. Or just another terrain in general. But like I said, not sure if that's possible.
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Variables are a nono? Lol, this plain afirmation simply makes me laugh. How do you expect to enhance your map with complicated features if you don't use variables? Are you refering to instanceability? Now that's something different. Using JASS you can overcome this problem.

And yes, it is possible to execute a piece of code for only one player. But be careful about one thing: desyncs. When multiple players share different global information (I'll give you an example in a moment) then some get disconnected (I don't know more about this area, as I've never programmed for multiplayer). So be careful! The example: consider that player 1 has a unit with 100 life. However, locally, its life was modified to 300. If the unit receives 150 damage, for player 2, for example, the unit would be dead. But since for player 1 the unit had more life, it will be alive. Boom! Desync!

There is a function that can allow you to make the "only for one player" code above. You are going to need JASS for this though.

JASS:
native function GetLocalPlayer takes nothing returns player

How to use it? Pretty simple as well.

JASS:
    local player p //set pylon player here
    if (GetLocalPlayer() == p) then
         call CreateUnit(p, PylonModel(), x0,y0,0)
    endif

Be careful! Unit must have locust! And even this could cause desync, as the unit is global information. However, I know one thing for sure: Unit vertex coloring can be locally modified. So create the unit perhaps globally, and if the local player is NOT the one with the pylon power, set the coloring's alpha to 0 (or was it 255? Can't remember exactly, invisible anyway).

Hope this helped!

-Mihai
 
Status
Not open for further replies.
Top