Help - JASS spell (Idiot Coder)

megma

New Member
Reaction score
1
Okay, so I'm trying to make a Portal remake into wc3, well, not a remake, but general idea of portal into like, a PvP game, or something. Anyway. I was working on the creation of the portals. And for what ever reason, JASSHelper is saying I have 4 errors. I don't get why these are syntax erros.

Anyway here's the code. Errors are comments. There's a second trigger almost the exactly the same, except instead of "PortsYellow" its "PortsBlue" and instead of "PYY"/"PYX" its "PBY"/"PBX". also the unit id, PY00 is PB00 in the 2nd trigger.

JASS:
function PY_Actions takes nothing returns nothing
    set P = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
    //RemoveUnit(PortsYellow[P])
    set PortsYellow[P] = null
    set CX[P] = GetUnitX(GetTriggerUnit())
    set CY[P] = GetUnitY(GetTriggerUnit())
    set PYY[P] = GetSpellTargetY()
    set PYX[P] = GetSpellTargetX()
    //CreateUnitAtLoc(P, PY00, (GetLocationY(PYY[P]) + GetLocationX(PYX[P])), (GetLocationX(PYX[P]) + GetLocationY(PYY[P])))
    set PortsYellow[P] = GetLastCreatedUnit()
endfunction

//===========================================================================
function Init_PY takes nothing returns nothing
    set PY = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( PY, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddAction( PY, function PY_Actions )
endfunction


Now, I know I'm kinda stupid when it comes to JASS, for an example, I have RemoveUnit, when there is no unit to start with. So I have no idea what it does when there's no unit in the first place.

Edit: I forgot to add this. I have all the globals in the map specific custom script. They are
JASS:
globals
    integer P
    unit array PortsBlue[12]
    unit array PortsYellow[12]
    real array PBX[12]
    real array PBY[12]
    real array PYX[12]
    real array PYY[12]
    real array CX[12]
    real array CY[12]
    trigger PY
    trigger PB
endglobals
 

luorax

Invasion in Duskwood
Reaction score
67
You should use UnitApplyTimedLife() instead of RemoveUnit().
Also, PYY and PYX are real variable, so you can't use GetLocationX().

And when you use "CreateUnit" then GetLastCeatedUnit() doesn't works. It only works with BJs.

So everything what I said:

JASS:
function PY_Actions takes nothing returns nothing
    set P = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
    call UnitApplyTimedLife(PortsYellow[P], 'BTLF', 0.1)
    set PortsYellow[P] = null
    set CX[P] = GetUnitX(GetTriggerUnit())
    set CY[P] = GetUnitY(GetTriggerUnit())
    set PYY[P] = GetSpellTargetY()
    set PYX[P] = GetSpellTargetX()
    set PortsYellow[P] = CreateUnitAtLoc(P, 'PY00', PYY[P]) + PYX[P], PYX[P] + PYY[P])
endfunction

//===========================================================================
function Init_PY takes nothing returns nothing
    set PY = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( PY, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddAction( PY, function PY_Actions )
endfunction


Also you could use a local integer for "P".
 

Laiev

Hey Listen!!
Reaction score
188
use locals... better then use lots of array (and will be mui, not mpi)
 

Ashlebede

New Member
Reaction score
43
use locals... better then use lots of array (and will be mui, not mpi)

Ditto, but you can also use non-array globals , since there are no waits, timers and such in your triggers at all. (Setting a global takes less time than creating a local.)
 

megma

New Member
Reaction score
1
You should use UnitApplyTimedLife() instead of RemoveUnit().
Also, PYY and PYX are real variable, so you can't use GetLocationX().

And when you use "CreateUnit" then GetLastCeatedUnit() doesn't works. It only works with BJs.

So everything what I said:

JASS:
function PY_Actions takes nothing returns nothing
    set P = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
    call UnitApplyTimedLife(PortsYellow[P], 'BTLF', 0.1)
    set PortsYellow[P] = null
    set CX[P] = GetUnitX(GetTriggerUnit())
    set CY[P] = GetUnitY(GetTriggerUnit())
    set PYY[P] = GetSpellTargetY()
    set PYX[P] = GetSpellTargetX()
    set PortsYellow[P] = CreateUnitAtLoc(P, 'PY00', PYY[P]) + PYX[P], PYX[P] + PYY[P])
endfunction

//===========================================================================
function Init_PY takes nothing returns nothing
    set PY = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( PY, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddAction( PY, function PY_Actions )
endfunction


Also you could use a local integer for "P".

Alright, so set everything as you said + some extra modifications (name changes and added a condition) Saved fine, but the unit wasn't created.

After messing around a little bit, I decided to have another trigger do the creation. But after a little testing, I realized that for what ever reason, the trigger isn't getting the event or getting to the actions, that didn't work, so I'm wondering if its the ability I based my spell off of.

Yellow Portal is based off of Rain of Fire
And Blue Portal is based off Blizzard.

I had at first tried using dark portal, and I'm not totally sure why I changed it. (me = :nuts:) But anyway, my reasoning for saying that the trigger isn't getting the event is because that I added a DisplayTextToPlayer, which never came up.
 

megma

New Member
Reaction score
1
Okay, I found the problem. I forgot to add Trig to the
Code:
function Init_PY takes nothing returns nothing
so it'd become
Code:
function InitTrig_PY takes nothing returns nothing
But then, since the creation didn't work, I just decided to go to BJ, even tho I know its not as good, or at least that's what I've been told.

New code:
JASS:
unction PY_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'APY0' ) ) then
        return false
    endif
    return true
endfunction

function PY_Actions takes nothing returns nothing
    call UnitApplyTimedLife(PortsYellow[p], 'BTLF', 0.1)
    call CreateNUnitsAtLocFacingLocBJ( 1, 'py00', GetTriggerPlayer(), GetSpellTargetLoc(), GetUnitLoc(GetTriggerUnit()) )
    set PortsYellow[p] = GetLastCreatedUnit()
endfunction

//===========================================================================
function InitTrig_PY takes nothing returns nothing
    set PY = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( PY, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( PY, Condition( function PY_Conditions ) )
    call TriggerAddAction( PY, function PY_Actions )
endfunction
 

luorax

Invasion in Duskwood
Reaction score
67
You should edit the condition function, using if/then is useless.
Also you should use "EVENT_PLAYER_UNIT_SPELL_EFFECT" instead of "EVENT_PLAYER_UNIT_SPELL_CAST"

But if it works, then use this:

JASS:
function PY_Conditions takes nothing returns boolean
    local integer p = GetPlayerId(GetTriggerPlayer())
    local location tl
    local location tl2
    if GetSpellAbilityId() == 'APY0' then
        set tl = GetSpellTargetLoc()
        set tl2 = GetUnitLoc(GetTriggerUnit())
        call UnitApplyTimedLife(PortsYellow[p], 'BTLF', 0.1)
        call CreateNUnitsAtLocFacingLocBJ( 1, 'py00', GetTriggerPlayer(), tl, tl2 )
        set PortsYellow[p] = bj_lastCreatedUnit
        debug call BJDebugMsg("It works!!!")
        call RemoveLocation(tl)
        call RemoveLocation(tl2)
        set tl = null
        set tl2 = null
        return true
    endif
    set tl = null
    set tl2 = null
    return false
endfunction

//===========================================================================
function InitTrig_PY takes nothing returns nothing
    set PY = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( PY, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( PY, Condition( function PY_Conditions ) )
endfunction


Ohh, and use the "Channel" ability, it was designed for map makers, that's quite configurable.
 

megma

New Member
Reaction score
1
You should edit the condition function, using if/then is useless.
Also you should use "EVENT_PLAYER_UNIT_SPELL_EFFECT" instead of "EVENT_PLAYER_UNIT_SPELL_CAST"

But if it works, then use this:

JASS:
function PY_Conditions takes nothing returns boolean
    local integer p = GetPlayerId(GetTriggerPlayer())
    local location tl
    local location tl2
    if GetSpellAbilityId() == 'APY0' then
        set tl = GetSpellTargetLoc()
        set tl2 = GetUnitLoc(GetTriggerUnit())
        call UnitApplyTimedLife(PortsYellow[p], 'BTLF', 0.1)
        call CreateNUnitsAtLocFacingLocBJ( 1, 'py00', GetTriggerPlayer(), tl, tl2 )
        set PortsYellow[p] = bj_lastCreatedUnit
        debug call BJDebugMsg("It works!!!")
        call RemoveLocation(tl)
        call RemoveLocation(tl2)
        set tl = null
        set tl2 = null
        return true
    endif
    set tl = null
    set tl2 = null
    return false
endfunction

//===========================================================================
function InitTrig_PY takes nothing returns nothing
    set PY = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( PY, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( PY, Condition( function PY_Conditions ) )
endfunction


Ohh, and use the "Channel" ability, it was designed for map makers, that's quite configurable.
Oh right I forgot about the channel ability lol. But anyway, there is no spell effect on the spells. I've also changed up what "p" is, its now a global that is set to "GetConvertedPlayerId(GetOwningPlayer(u)" [u = GetTriggerUnit()]

But anyway, I'll try it.

Oh also, what do you think about a map with Portal's portals in it? (since that's what I'm trying to create)

Edit: Does something like this work?

Calling GVI for the array integer?

JASS:
function GVI takes nothing returns integer
    local integer i = 0
    loop
        exitwhen i > 12
        return i
        set i = i + 1
    endloop
endfunction

JASS:
function TeleportPortBlue_Actions takes nothing returns nothing
    if ( TeleprotPortBlue_Func001C() ) then
    call SetUnitPositionLocFacingBJ( GetTriggerUnit(), PolarProjectionBJ(GetUnitLoc(PortsYellow[GVI]), -110.00, GetUnitFacing(null)), GetUnitFacing(null) )
    endif
endfunction
 

luorax

Invasion in Duskwood
Reaction score
67
As i know, 1 function can return only one value... you have to use that loop in the "TeleportPortBlue_Actions"
 

Laiev

Hey Listen!!
Reaction score
188
luorax is right, you you want that to execute for all players, you should make the loop inside the Actions and with the function SetUnitPositionLocFacingBJ too


and try to avoid BJs and Locations :p this is just a suggestion...
 

megma

New Member
Reaction score
1
@lorax, okays. Actually I decided to use another function that checks the unit then returns a global integer.

@Laiev I'd avoid BJs if I could, but at the moment, I'd just like to get it working in the first place. And locations are needed. Like I said in my first post, I'm trying to recreate the portal from valve's Portal.


Okay, so here's new code

JASS:
function TeleportPortBlue_Actions takes nothing returns nothing
    local integer i = 0
    set Temp_Point[1] = GetUnitLoc(PortsBlue[temp_i])
    set Temp_Point[2] = GetUnitLoc(temp_u)
    set Temp_Point[3] = GetUnitLoc(PortsYellow[temp_i])
    set Temp_Point[4] = OffsetLocation(Temp_Point[3], 110, 110)
    if PortsYellow[temp_i] == null then
        call DisplayTextToPlayer(GetOwningPlayer(PortsBlue[temp_i]), 0, 0, "An object tried to go through your portal, but there wasn't any exit")
        set temp_r = 0.00
        set temp_u = null
        set temp_i = 0
    else
        if GetUnitFacing(PortsBlue[temp_i]) == AngleBetweenPoints(Temp_Point[2], Temp_Point[1]) then
            set temp_r = GetUnitFacing(PortsYellow[temp_i])
            call SetUnitPositionLoc( temp_u, Temp_Point[4])
            call SetUnitFacing( temp_u, temp_r )
            set temp_r = 0.00
            set temp_u = null
            set temp_i = 0
            else
            endif
    endif
    loop
        exitwhen i > 4
    call RemoveLocation(Temp_Point<i>)
    set i = i + 1
    endloop
endfunction

//===========================================================================
function InitTrig_TeleportPortBlue takes nothing returns nothing
    set TeleportPortBlue = CreateTrigger(  )
    call TriggerRegisterUnitInRangeSimple( TeleportPortBlue, 100.00, null )
    set temp_u = GetTriggerUnit()
    set YorB = false
    call GVI()
    call TriggerAddAction( TeleportPortBlue, function TeleportPortBlue_Actions )
endfunction</i>


GVI
JASS:
function GVI takes nothing returns integer
    local integer i = 0
    loop
        exitwhen i &gt; 12
    if YorB == true then
        if IsUnitInRange(temp_u, PortsYellow<i>, 100) == true then
            set temp_i = i
        endif
    else
        if IsUnitInRange(temp_u, PortsBlue<i>, 100) == true then
            set temp_i = i
        endif
    endif
    set i = i + 1
    endloop
return temp_i
endfunction</i></i>


Now the only thing I'm unsure of, is the null in this.
JASS:
call TriggerRegisterUnitInRangeSimple( TeleportPortBlue, 100.00, null )


Would it still check?

Note: There will be a trigger almost the same thing, except, YorB will be set to true, and PortsBlue and PortsYellow will switch places.

Edit: For the "RegisterUnitInRange", what would be better to use, if null is supposed to be anyunit? FYI, I know about the periodic event and pick every unit in range. But that isn't what's supposed to happen. The unit is supposed to "enter" from the front of one portal, and exits at the other portal + 110 units, so it doesn't trigger the "entering". Also, a small knockback will be added later off, to ensure it doesn't trigger the "entering" of the exiting portal.
 

Laiev

Hey Listen!!
Reaction score
188
>>>I'd avoid BJs if I could, but at the moment, I'd just like to get it working in the first place. And locations are needed. Like I said in my first post, I'm trying to recreate the portal from valve's Portal.

why you need locations for it?


>> [ljass]call TriggerRegisterUnitInRangeSimple( TeleportPortBlue, 100.00, null )[/ljass]

not, don't will run because you can't run something based on a nulled value



other way you can try to do that is with periodic groups

(pick every unit with X range of 'portal' and do action)
 

megma

New Member
Reaction score
1
>>>I'd avoid BJs if I could, but at the moment, I'd just like to get it working in the first place. And locations are needed. Like I said in my first post, I'm trying to recreate the portal from valve's Portal.

why you need locations for it?


>> [ljass]call TriggerRegisterUnitInRangeSimple( TeleportPortBlue, 100.00, null )[/ljass]

not, don't will run because you can't run something based on a nulled value



other way you can try to do that is with periodic groups

(pick every unit with X range of 'portal' and do action)

Because I need to check which way the portal is facing, if the unit enters the portal from the front, it'll come out the front of the other portal, and vis versa. So I'll be checking the angle between the portal and the triggering unit.

Well, I guess I could always add an if then else to the periodic.
 

Laiev

Hey Listen!!
Reaction score
188
Ya, you'll need to check the angle between portal and the unit no matter what you do

and of course to do that with a little secures you'll need to pick every unit with range like 50-150 or something like that to have some 'ground' to check the angle
 

luorax

Invasion in Duskwood
Reaction score
67
You can avoid BJ's by using these functions:

JASS:
function DistanceBetweenXY takes real x1, real y1, real x2, real y2 returns real
    return SquareRoot((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1))
endfunction
    
function OffsetX takes real x1, real dist, real angle returns real
    return x1 + dist * Cos(angle * bj_DEGTORAD)
endfunction
    
function OffsetY takes real y1, real dist, real angle returns real
    return y1 + dist * Sin(angle * bj_DEGTORAD)
endfunction
    
function AngleBetweenXY takes real x1, real y1, real x2, real y2 returns real
    return bj_RADTODEG * (Atan2(y2 - y1, x2 - x1))
endfunction
 

Ashlebede

New Member
Reaction score
43
Wait, if its a global, doesnt he need udg_ before the variable?

Only if they're declared using CTRL+B. vJass globals, generated globals and pre-made globals don't need the udg_ prefix, though some have more complexe prefixes (such as generated regions, [ljass]gg_rct_My_Regions_Name[/ljass]).
 

megma

New Member
Reaction score
1
You can avoid BJ's by using these functions:

JASS:
function DistanceBetweenXY takes real x1, real y1, real x2, real y2 returns real
    return SquareRoot((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1))
endfunction
    
function OffsetX takes real x1, real dist, real angle returns real
    return x1 + dist * Cos(angle * bj_DEGTORAD)
endfunction
    
function OffsetY takes real y1, real dist, real angle returns real
    return y1 + dist * Sin(angle * bj_DEGTORAD)
endfunction
    
function AngleBetweenXY takes real x1, real y1, real x2, real y2 returns real
    return bj_RADTODEG * (Atan2(y2 - y1, x2 - x1))
endfunction

this is for Laiev also.

Okay, if I use the GetUnitsInRangeOfLocAll, it returns a group, how am I supposed to compare each unit to the facing of the portal? And since the position of the unit vs the facing of the portal, effects how it will move them, that means I need to single out every unit and compare them. Now, I know it's not likely that there's going to be more than one unit in the group, but there's still that chance that, another unit is entering the same portal from the back, or is near its sides.

Oh also, what's a good margin of error for the facing, and how would I do it?? In a sense, it should be a cone from the portal. Something like, if the protal's facing is 0, like, the margin of error is say, like 40, so units that have a degree of 340-360 and 0-20 (since the angle is a degree, and there's 360 of them, wouldn't that mean that the angle of the units be perfect?)
 

Laiev

Hey Listen!!
Reaction score
188
JASS:
native UnitAlive takes unit id returns boolean

private struct data
    group g
    timer t
    unit ta
    unit ca
    real cx
    real cy
    real tx
    real ty
endstruct

function DistanceBetweenXY takes real x1, real y1, real x2, real y2 returns real
    return SquareRoot((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1))
endfunction
    
function OffsetX takes real x1, real dist, real angle returns real
    return x1 + dist * Cos(angle * bj_DEGTORAD)
endfunction
    
function OffsetY takes real y1, real dist, real angle returns real
    return y1 + dist * Sin(angle * bj_DEGTORAD)
endfunction
    
function AngleBetweenXY takes real x1, real y1, real x2, real y2 returns real
    return bj_RADTODEG * (Atan2(y2 - y1, x2 - x1))
endfunction

function test takes nothing returns nothing
    local data d = GetTimerData(GetExpiredTimer())
    local unit u
    local real a
    
    set d.g = CreateGroup()
    call GroupEnumUnitsInRange(d.g, d.cx, d.cy, 100, null)
    
    loop
        set u = FirstOfGroup(d.g)
        exitwhen u == null
        
        set a = AngleBetweenXY(d.cx, d.cy, GetUnitX(u), GetUnitY(u))
        
        call SetUnitX(u, d.tx)
        call SetUnitY(u, d.ty)
        
        set SetUnitFacing(u, a)
        
        call IssuePointOrder(u, &quot;move&quot;, OffSetX(d.tx, 100., a), OffSetY(d.ty, 100., a))
        
        call GroupRemoveUnit(d.g, u)
    endloop
    
    call DestroyGroup(d.g)
    
    set d.g = CreateGroup()
    call GroupEnumUnitsInRange(d.g, d.tx, t.cy, 100, null)
    
    loop
        set u = FirstOfGroup(d.g)
        exitwhen u == null
        
        set a = AngleBetweenXY(d.tx, d.ty, GetUnitX(u), GetUnitY(u))
        
        call SetUnitX(u, d.cx)
        call SetUnitY(u, d.cy)
        
        set SetUnitFacing(u, a)
        
        call IssuePointOrder(u, &quot;move&quot;, OffSetX(d.cx, 100., a), OffSetY(d.cy, 100., a))
        
        call GroupRemoveUnit(d.g, u)
    endloop
    
    call DestroyGroup(d.g)
    
    if not UnitAlive(d.ca) or not UnitAlive(d.ta) then
        call ReleaseTimer(d.t)
        call d.destroy()
    endif
    
    set u = null
endfunction

function acts takes nothing returns nothing
    local data d = data.create()
    
    set d.ca = Portal-I
    set d.ta = Portal-II
    
    set d.cx = GetUnitX(d.ca)
    set d.cy = GetUnitY(d.ca)
    
    set d.tx = GetUnitX(d.ta)
    set d.ty = GetUnitY(d.ta)
    
    set d.t = NewTimer()
    
    call SetTimerData(d.t, d)
    call TimerStart(d.t, 0.10, true, function test)
endfunction


it SHOULD do:

you enter in range (100) of some portal (I and II), then you automatic teleport to the other portal facing angle what you was facing and order the unit that enter in the portal to move X and Y range (to prevent ugly effect)

PS: i have not tested it
 

megma

New Member
Reaction score
1
JASS:

native UnitAlive takes unit id returns boolean

private struct data
    group g
    timer t
    unit ta
    unit ca
    real cx
    real cy
    real tx
    real ty
endstruct

function DistanceBetweenXY takes real x1, real y1, real x2, real y2 returns real
    return SquareRoot((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1))
endfunction
    
function OffsetX takes real x1, real dist, real angle returns real
    return x1 + dist * Cos(angle * bj_DEGTORAD)
endfunction
    
function OffsetY takes real y1, real dist, real angle returns real
    return y1 + dist * Sin(angle * bj_DEGTORAD)
endfunction
    
function AngleBetweenXY takes real x1, real y1, real x2, real y2 returns real
    return bj_RADTODEG * (Atan2(y2 - y1, x2 - x1))
endfunction

function test takes nothing returns nothing
    local data d = GetTimerData(GetExpiredTimer())
    local unit u
    local real a
    
    set d.g = CreateGroup()
    call GroupEnumUnitsInRange(d.g, d.cx, d.cy, 100, null)
    
    loop
        set u = FirstOfGroup(d.g)
        exitwhen u == null
        
        set a = AngleBetweenXY(d.cx, d.cy, GetUnitX(u), GetUnitY(u))
        
        call SetUnitX(u, d.tx)
        call SetUnitY(u, d.ty)
        
        set SetUnitFacing(u, a)
        
        call IssuePointOrder(u, &quot;move&quot;, OffSetX(d.tx, 100., a), OffSetY(d.ty, 100., a))
        
        call GroupRemoveUnit(d.g, u)
    endloop
    
    call DestroyGroup(d.g)
    
    set d.g = CreateGroup()
    call GroupEnumUnitsInRange(d.g, d.tx, t.cy, 100, null)
    
    loop
        set u = FirstOfGroup(d.g)
        exitwhen u == null
        
        set a = AngleBetweenXY(d.tx, d.ty, GetUnitX(u), GetUnitY(u))
        
        call SetUnitX(u, d.cx)
        call SetUnitY(u, d.cy)
        
        set SetUnitFacing(u, a)
        
        call IssuePointOrder(u, &quot;move&quot;, OffSetX(d.cx, 100., a), OffSetY(d.cy, 100., a))
        
        call GroupRemoveUnit(d.g, u)
    endloop
    
    call DestroyGroup(d.g)
    
    if not UnitAlive(d.ca) or not UnitAlive(d.ta) then
        call ReleaseTimer(d.t)
        call d.destroy()
    endif
    
    set u = null
endfunction

function acts takes nothing returns nothing
    local data d = data.create()
    
    set d.ca = Portal-I
    set d.ta = Portal-II
    
    set d.cx = GetUnitX(d.ca)
    set d.cy = GetUnitY(d.ca)
    
    set d.tx = GetUnitX(d.ta)
    set d.ty = GetUnitY(d.ta)
    
    set d.t = NewTimer()
    
    call SetTimerData(d.t, d)
    call TimerStart(d.t, 0.10, true, function test)
endfunction


it SHOULD do:

you enter in range (100) of some portal (I and II), then you automatic teleport to the other portal facing angle what you was facing and order the unit that enter in the portal to move X and Y range (to prevent ugly effect)

PS: i have not tested it

Okay, so I finally got some time to try it. It didn't work, first off, the private struct isn't in a scope or library. There was a few typos mainly the offset functions being called., and shouldn't it be
JASS:
call SetUnitFacing(u, a)

not
JASS:
set SetUnitFacing(u, a)


Also, after doing those few changes, there were errors with the "GetTimerData, SetTimerData, NewTimer, and ReleaseTimer" because they are undeclared functions. But those I can fix pretty easy, well probably, depends on what you're doing with the ReleaseTimer. Anyway, the
JASS:
local integer d = GetTimerData(GetExpiredTimer())
gets the error "Cannot convert null to integer". Which is probably caused by the undeclared function "GetTimerData".

After looking at the code, I'm going over it as I'm typing, I'm not actually sure what you are doing with "SetTimerData".

Note: Yes I haven't learned much of structs, scopes, libraries, and private functions. Maybe I should read up on structs, scopes, ect.
 
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