• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Ally only visual effect

Status
Not open for further replies.
Level 10
Joined
Sep 3, 2009
Messages
458
It's an effect that you and your allies can only see.(Enemies cant see it.)

For example on the Hero Gyrocopter, when he launches his ultimate there would be a large marker on the ground that only you and your allies can see.

That' basically what I mean.
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
Try this:
JASS:
function onCast takes nothing returns nothing
    local string path=""
    local integer i=0
    loop
        exitwhen i==bj_MAX_PLAYERS
        if (IsPlayerAlly(GetOwningPlayer(GetTriggerUnit()),Player(i)) then
            set path="special\effect\path"
        endif
        set i=i+1
    endloop
    call AddSpecialEffect(path,0,0)
endfunction

You need Local Player. Do it like this:
JASS:
function onCast takes nothing returns nothing
    local string path=""
    if IsPlayerAlly(GetOwningPlayer(GetTriggerUnit()),GetLocalPlayer()) then
        set path="special\effect\path"
    endif
    call AddSpecialEffect(path,0,0)
endfunction

More about GetLocalPlayer() here: http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=89207
 
The JASS script will desync every battle.net game you try to play. It needs this instead:

JASS:
function onCast takes nothing returns nothing
    local string path = "special\\effect\\path.mdl"
    if IsPlayerEnemy(GetTriggerPlayer(), GetLocalPlayer()) then
        set path = ""
    endif
    call AddSpecialEffect(path, 0, 0)
endfunction

The string needs to be initialized before entering the "local player" block.
 
Status
Not open for further replies.
Top