does local unit u still worK?

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
If I heard right, no. Ask someone else on this.
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
Why wouldn't it? They fixed the return bug, they didn't remove the most basic functionalities of the syntax.
 

R 3 T R O

New Member
Reaction score
12
i can save the map and host it properly but it doesnt seem to get the unit with local unit u = GetTriggerUnit() well its not working for some reason. weird
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
They said in the patch, 'Shadowing globals', and then in a thread at wc3c.net Vex said something along the lines that that was the pseudo-locals. I could be wrong...
 

Komaqtion

You can change this now in User CP.
Reaction score
469
I can still use it :D

JASS:
private function Knockback takes nothing returns nothing
    local unit u = GetEnumUnit()
    local real angle = 57.2958 * Atan2(GetUnitY(u) - GetUnitY(Data(TempStruct).caster), GetUnitX(u) - GetUnitX(Data(TempStruct).caster))
    local real facing = GetUnitFacing(Data(TempStruct).caster)
    if KBS_IsUnitSliding(u) == false and Filters_Enum() then
        call GroupAddUnit(gr, u)
        if ONLY_FRONT == false and angle >= facing + 25. and angle >= facing - 25. then
                call KBS_BeginCommon(u,DISTANCE,SPEED,angle)
        endif
        if angle <= facing + 25. and angle >= facing then
            set angle = angle + 25.
            call KBS_BeginCommon(u,DISTANCE,SPEED,angle)
        elseif angle >= facing - 25. and angle <= facing then
            set angle = angle - 25.
            call KBS_BeginCommon(u,DISTANCE,SPEED,angle)
        endif
    endif
endfunction


That works :D
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
He means in GUI... I think.

Trigger:
  • Custom Script: local unit u = GetTriggerUnit()
 

R 3 T R O

New Member
Reaction score
12
Sorry my bad its in jass not in GUI custom script I'll post the trigger


This is runned in the start of map.
JASS:
function StartFunc takes nothing returns nothing
    local trigger t = CreateTrigger()
    local integer i = 1
    local integer allowboot = 1
    local real x
    local real y
    local player p
    call StartSound(gg_snd_ALICEBeep)
    call DisplayTimedTextToPlayer(GetLocalPlayer(),0.0,0.0,10.0,"Initializing...")
    call TriggerSleepAction(0.)
    call TriggerRegisterPlayerUnitEvent(gg_trg_NVG, p, EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
    call SetUnitTimeScalePercent( gg_unit_h00F_0031, 0.00 )
    call SetUnitTimeScalePercent( gg_unit_h00F_0029, 0.00 )
    call SetUnitTimeScalePercent( gg_unit_h00G_0033, 0.00 )
    call SetUnitTimeScalePercent( gg_unit_h00G_0038, 0.00 )
    call SetUnitTimeScalePercent( gg_unit_h00G_0037, 0.00 )
    set t = null
    set i=1
endfunction


JASS:
function NVGConditions takes nothing returns boolean
    return GetSpellAbilityId()=='A007'
endfunction

function NVG takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local player p = GetOwningPlayer(u)
    local integer i = GetConvertedPlayerId(p)
    set udg_NightVision<i> = not(udg_NightVision<i>)
    call NightVision(p,udg_NightVision<i>)
    set bj_meleeNearestMineDist = GetUnitX(u)
    set bj_lastTransmissionDuration = GetUnitY(u)
    set u = null
endfunction

//===========================================================================
function InitTrig_NVG takes nothing returns nothing
    set gg_trg_NVG = CreateTrigger()
    call TriggerAddCondition(gg_trg_NVG,Condition(function NVGConditions))
    call TriggerAddAction(gg_trg_NVG,function NVG)
endfunction</i></i></i>


the problem is Player red can use the NVG but player 2 cant so i dont think anyother player other than red cna use it
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
Isn't it GetPlayerId() not GetConvertedPlayerId() o_O'.
 

BlackRose

Forum User
Reaction score
239
It is the same thing...... Converted is just -1 I think.

I'd also add in debug messages to show who is player p, and who is u etc. Why don't people debug stuff like that?
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
Converted is +1 IIRC. It's the useless junk used by GUI which gives Player 1 (red) the value 1 instead of 0 etc.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top