• 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] A color changing system in (v)JASS

Status
Not open for further replies.
Level 19
Joined
Oct 12, 2007
Messages
1,821
Is there anyone out here that could tell me what's the best way to create a system that does the following:

Every time a unit, (that matches some conditions like Unit Type checking, checking if its alive), enters a given rect it will change the unit's visibility to something like 50% for 11 seconds every 0.25 seconds.
In addition this system should also run at the start of the game. So it has to activate at map init and whenever a unit that matches the conditions enters the rect(s).

(This is the action that has to occur every interval: call SetUnitVertexColor(unit, 255, 255, 255, 100))

In the system I want to be able to assign specific unit types to specific rects. So per example, in Rect A, only unit Type 'u001' should have this effect while in Rect B only unit Type 'u002' should get this.

I don't really know what's the best way to get started.
Is there anyone that could help me out here?
 
Level 19
Joined
Oct 12, 2007
Messages
1,821
The thing I want to use this for is to make some 'ghost' creeps. They most not be 'invisible' as in you can't see them. It has to be done by the vertexcoloring action, I'm 100% sure of that.
Giving true sight to units and perm inv to those units will not work because it's a huge map I'm working on and there are several units that also will be able to cast stuff like windwalk or have some kind of invis detection from theirselves.

It's not a problem that I can't go back anymore.
This system is to cooperate with my respawn system.
As soon as one of those 'ghost' units respawns it will change his transp. to something like 50%. He will stay at 50% until the unit dies eventually.

That's why I want this to work at map init too, because I placed some of those units in the map already.:)
 
It's not a problem that I can't go back anymore.
so whats the problem of vertex coloring adjustments if it's not a problem that you cant
go back anymore?...that's the solution...

in your map init, save into the hashtable ALL creep units that requires changing of color,
once creep units dies and respawns them, check the saved handle/boolean/integer etc...
of that unit, if it returns true then adjust the vertex of the spawned unit to 50%...

JASS:
if HaveSavedHandle(HT,GetHandleId(GetTriggerUnit()),0) then
     set bj_lastCreatedUnit = CreateUnit(......
     call SetUnitVertexColor(.........)
endif
 
Status
Not open for further replies.
Top