- Joined
- Jul 31, 2012
- Messages
- 2,217
is there a way to make a unit appear only for its allies (Reject invisibility)
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
if IsPlayerAlly(GetLocalPlayer(), GetOwningPlayer(GetSpellAbilityUnit())) then
call CreateUnit(player, typeId, x, y, angle)
endif
JASS:if IsPlayerAlly(GetLocalPlayer(), GetOwningPlayer(GetSpellAbilityUnit())) then call CreateUnit(player, typeId, x, y, angle) endif
Just show me how to make local player enemy force of owner of casting player and +rep if you do
That solution was used in that threadshadowvzs said:vertex color with getlocalplayer
There was a thread like this very recently, do try searching for it next time. Before creating a thread.
That solution was used in that thread.
Here's my post on it.
It makes a unit invisible (or visible) for whoever you want.
didn't workI made the thing you made
didn't work
firstly i made exactly how appocalypse said
secondly just tell me how to post my trigger
tag
blabla = blabla ^ 2
Set TempPlayer1 = Whomever
Set TempLoc1 = (TempPlayer1 start location)
Set TempReal1 = 100.00
Unit - Create 1 Dummy for TempPlayer1 at TempLoc1 facing Default building facing degrees
Custom script: if IsPlayerAlly(GetLocalPlayer(), udg_TempPlayer1) then
Set TempReal1 = 0.00
Custom script: endif
Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with TempReal1% transparency
Custom script: call RemoveLocation(udg_TempLoc1)
this will however not work for all units correctly, for example golems.
I undestand that this is maybe only desync safe method but it still has the disadvantage of setting units vertex colors to 100% 100% 100% but not all units have 100 100 100 vertex colors(several war golems(the red one I believe) has different value etc)
Fire Strike

Events


Unit - A unit Begins casting an ability

Conditions


(Ability being cast) Equal to Fire Strike (Elemental)

Actions


Set Fire_Elemental_FireStrike = (Casting unit)


Set FireStrike_Target = (Target point of ability being cast)


Unit - Create 1 Flame strike first for Player 1 (Red) at (Target point of ability being cast) facing Default building facing degrees


Set y = 100.00


Custom script: if IsPlayerAlly(GetLocalPlayer(), Player(8)) then


Set y = 0.00


Custom script: endif


Animation - Change (Last Created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with y% transparency


Unit - Add a 3.50 second Generic expiration timer to (Last created unit)


Unit - Create 1 Flame strike Loop for Player 1 (Red) at FireStrike_Target facing Default building facing degrees


Unit - Add a 5.00 second Generic expiration timer to (Last created unit)


Wait 3.00 seconds


Unit - Create 1 Flame strike final for Player 1 (Red) at FireStrike_Target facing Default building facing degrees


Unit - Add a 1.50 second Generic expiration timer to (Last created unit)


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




Or - Any (Conditions) are true





Conditions






(Owner of Fire_Elemental_FireStrike) Equal to Player 2 (Blue)






(Owner of Fire_Elemental_FireStrike) Equal to Player 3 (Teal)






(Owner of Fire_Elemental_FireStrike) Equal to Player 4 (Purple)






(Owner of Fire_Elemental_FireStrike) Equal to Player 5 (Yellow)






(Owner of Fire_Elemental_FireStrike) Equal to Player 6 (Orange)



Then - Actions




Unit Group - Pick every unit in (Units within 550.00 of FireStrike_Target matching ((((Owner of (Matching unit)) Equal to Player 7 (Green)) or (((Owner of (Matching unit)) Equal to Neutral Hostile) or ((Owner of (Matching unit)) Equal to (Random player from (All enemies of (Owner of Fire_El and do (Actions)





Loop - Actions






Unit - Cause Fire_Elemental_FireStrike to damage (Picked unit), dealing (90.00 x (Real((Level of Fire Strike (Elemental) for Fire_Elemental_FireStrike)))) damage of attack type Spells and damage type Magic



Else - Actions




Unit Group - Pick every unit in (Units within 550.00 of FireStrike_Target matching ((((Owner of (Matching unit)) Equal to Player 1 (Red)) or (((Owner of (Matching unit)) Equal to Neutral Hostile) or ((Owner of (Matching unit)) Equal to (Random player from (All enemies of (Owner of Fire_Elem and do (Actions)





Loop - Actions






Unit - Cause Fire_Elemental_FireStrike to damage (Picked unit), dealing (90.00 x (Real((Level of Fire Strike (Elemental) for Fire_Elemental_FireStrike)))) damage of attack type Spells and damage type Magic
Set FireStrike_Target = (Target point of ability being cast)
Unit - Create 1 Flame strike first for "Triggering Player" at "FireStrike_Target" facing Default building facing degrees
Custom script: call RemoveLocation(udg_FireStrike_Target)
at end of the trigger
Set FireStrike_Target = (Target point of ability being cast)
Unit - Create 1 Flame strike first for "Triggering Player" at "FireStrike_Target" facing Default building facing degrees
useing wait could break ur system also because the target position/Fire_Elemental_FireStrike variables will be ovewrited if will be casted bt someone else this ability in next 3sec after u casted it, use local variable
Custom script: call RemoveLocation(udg_FireStrike_Target)
also change Player 1 to trigger player if u want apply to any unit or it is single player map?
unit grouyp also got leak and use tag
also change Player 1 to trigger player if u want apply to any unit or it is single player map?
unit group also got leak and use tag
Fire Strike

Events


Unit - A unit Begins casting an ability

Conditions


(Ability being cast) Equal to Fire Strike (Elemental)

Actions


Custom script: local location udg_TempLoc1


Set TempLoc1 = (Target point of ability being cast)


Wait 5.00 seconds


Unit - Create 1 unit at TempLoc1


Custom script: call RemoveLocation(udg_TempLoc1)


Custom script: set udg_TempLoc1 = null
Stop asking questions that I have already covered (in this same thread even)but now ||||the unit is totally made of particals||||
What to do
The trigger should remain almost exactly the same, except that you're not changing the fly height (and not the vertex coloring).In that case, you might want to try using fly height (have the unit have a negative fly height by default, then raise it for the local player). I hope that works.
Might I perhaps convince you to use 3 temporary locations in total for all your triggers?
This means that instead of the variable "FireStrike_Target", you'll have "TempLoc1" (and "TempLoc2" and "TempLoc3" in addition to that). You will never need more than that.
By doing that, you will save a lot of variables (having 3 locations total instead of 1-2 per spell).
You can still make it work by 'converting it to a local' at the start of the trigger (I'll probably have to explain this).
First off: you're not actually converting it to a local. That was a lie.
But it simplifies the explanation, so let's stick with that.
Here's an example:
By doing this, "TempLoc1" cannot be overwritten anymore
Fire Strike
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Fire Strike (Elemental)
Actions
Custom script: local location udg_TempLoc1
Set TempLoc1 = (Target point of ability being cast)
Wait 5.00 seconds
Unit - Create 1 unit at TempLoc1
Custom script: call RemoveLocation(udg_TempLoc1)
Custom script: set udg_TempLoc1 = null
.
If that spell is cast 10 times within 5 seconds, all those locations will still be correct! (Normally, 10 units would be created at the last location).
Frees up some variables and it's pretty clean, too.
Stop asking questions that I have already covered (in this same thread even).
The trigger should remain almost exactly the same, except that you're not changing the fly height (and not the vertex coloring).
I'm sorry if this sounds rude, but did you even try this yourself? You can't expect everyone to do stuff for you, even after they explain how you can do this.DotCa said:show me for the flying height
I'm sorry if this sounds rude, but did you even try this yourself? You can't expect everyone to do stuff for you, even after they explain how you can do this.
Sure, it'd be faster, but it's for the best if you actually did something yourself.
What you need to know for this to work, is that you cannot change a unit's flying height to something negative by triggers.
So the default has to be negative, and then you need to revert that to a flying height of 0 (triggered) for the players who should be able to see the unit.
If you start from the trigger I gave you in my second post here and modify it, you should be able to work it out.
Then why don't you show me what you've got? Then I can tell you where you went wrong and you will learn from your mistakes.I tried to make the flying height and when i failed i posted that i needed help
This thing will desync!!!
Fire Strike

Events


Unit - A unit Begins casting an ability

Conditions


(Ability being cast) Equal to Fire Strike (Elemental)

Actions


Set Fire_Elemental_FireStrike = (Casting unit)


Set FireStrike_Target = (Target point of ability being cast)


Unit - Create 1 Flame strike first for Player 1 (Red) at (Target point of ability being cast) facing Default building facing degrees


Custom script: if IsPlayerAlly(GetLocalPlayer(), Player(2)) then


Animation - Change (Last created unit) flying height to 3000.00 at 3000.00


Custom script: endif


Unit - Add a 3.50 second Generic expiration timer to (Last created unit)


Unit - Create 1 Flame strike Loop for Player 1 (Red) at FireStrike_Target facing Default building facing degrees


Unit - Add a 5.00 second Generic expiration timer to (Last created unit)


Wait 3.00 seconds


Unit - Create 1 Flame strike final for Player 1 (Red) at FireStrike_Target facing Default building facing degrees


Unit - Add a 1.50 second Generic expiration timer to (Last created unit)


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




Or - Any (Conditions) are true





Conditions






(Owner of Fire_Elemental_FireStrike) Equal to Player 2 (Blue)






(Owner of Fire_Elemental_FireStrike) Equal to Player 3 (Teal)






(Owner of Fire_Elemental_FireStrike) Equal to Player 4 (Purple)






(Owner of Fire_Elemental_FireStrike) Equal to Player 5 (Yellow)






(Owner of Fire_Elemental_FireStrike) Equal to Player 6 (Orange)



Then - Actions




Unit Group - Pick every unit in (Units within 550.00 of FireStrike_Target matching ((((Owner of (Matching unit)) Equal to Player 7 (Green)) or (((Owner of (Matching unit)) Equal to Neutral Hostile) or ((Owner of (Matching unit)) Equal to (Random player from (All enemies of (Owner of Fire_El and do (Actions)





Loop - Actions






Unit - Cause Fire_Elemental_FireStrike to damage (Picked unit), dealing (90.00 x (Real((Level of Fire Strike (Elemental) for Fire_Elemental_FireStrike)))) damage of attack type Spells and damage type Magic



Else - Actions




Unit Group - Pick every unit in (Units within 550.00 of FireStrike_Target matching ((((Owner of (Matching unit)) Equal to Player 1 (Red)) or (((Owner of (Matching unit)) Equal to Neutral Hostile) or ((Owner of (Matching unit)) Equal to (Random player from (All enemies of (Owner of Fire_Elem and do (Actions)





Loop - Actions






Unit - Cause Fire_Elemental_FireStrike to damage (Picked unit), dealing (90.00 x (Real((Level of Fire Strike (Elemental) for Fire_Elemental_FireStrike)))) damage of attack type Spells and damage type Magic
Do you know what this means? It means that the unit will rise to a flying height of 3000 (which is way too high, you wouldn't be able to see a unit at that height either) over 3000 seconds (almost an hour).
Animation - Change (Last created unit) flying height to 3000.00 at 3000.00
Simply said: when 2 players are receiving different information, the game will be split into 2 different states.Can someone explain what desync means
[Checked]Flying unit
the unit didn't moveheight 0.00 at 0.00
the unit is still not movingMade it height 1000.00 at 0.00 then 1000.00 at 1.00
Custom script: if IsPlayerAlly(GetLocalPlayer(), Player(2)) then
Ah, wait a second!
With "Player(2)", do you mean Blue or Teal?
In JASS: Player(0) = Red, Player(1) = Blue, Player(2) = Teal.
For scaling special effects, you can use the model dummy.mdx as a base unit (it's a very common model, seen in a lot of maps).
Attach the special effect to the chest of that dummy (scale of the dummy can be changed through triggers or in the object editor).
Special effects can be shown for a single player in the same way the vertex coloring works: use a temporary string, set it to <empty string> at first and within the local-block, set it to the special effect you want to show.
Outside the local block, create the effect.
Fire Strike

Events


Unit - A unit Begins casting an ability

Conditions


(Ability being cast) Equal to Fire Strike (Elemental)

Actions


Set Fire_Elemental_FireStrike = (Casting unit)


Set FireStrike_Target = (Target point of ability being cast)


Unit - Create 1 Flame strike first (dummy model file) for Player 1 (Red) at (Target point of ability being cast) facing Default building facing degrees


Unit - Add a 3.50 second Generic expiration timer to (Last created unit)


Custom script: if IsPlayerAlly(GetLocalPlayer(), GetOwningPlayer(GetSpellAbilityUnit())) then


Special Effect - Create a special effect attached to the chest of (Last created unit) using Abilities\Spells\Human\FlameStrike\FlameStrikeTarget.mdl


Custom script: endif


Unit - Create 1 Flame strike Loop (dummy model file) for Player 1 (Red) at FireStrike_Target facing Default building facing degrees


Unit - Add a 5.00 second Generic expiration timer to (Last created unit)


Custom script: if IsPlayerAlly(GetLocalPlayer(), GetOwningPlayer(GetSpellAbilityUnit())) then


Special Effect - Create a special effect attached to the chest of (Last created unit) using war3mapImporte\FireConsume.mdx


Custom script: endif


Wait 3.00 seconds


Unit - Create 1 Flame strike final for Player 1 (Red) at FireStrike_Target facing Default building facing degrees


Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
You don't remove the special effect, so it's still attached to the corpse of the dummy.
Always remove special effects (and then it will still play the animation, so you're better off removing the dummy as well).

I recently realized something, couldn't we hide the unit for specific players?
Ok no problem since the unit will be an effectand won't move or attack
Set u = Gryphon Rider 0000 <gen>
Set o = 100.00
Set s = <Empty String>
Custom script: if IsPlayerAlly(GetLocalPlayer(), GetOwningPlayer(GetSpellAbilityUnit())) then
Set o = 0.00
Set s = units\human\Knight\Knight
Custom script: endif
Animation - Change u's vertex coloring to (100.00%, 100.00%, 100.00%) with o% transparency
Special Effect - Create a special effect attached to the overhead of u using s
