Teleport to Region Item

Quauhtli

I have the right to remain silent.
Reaction score
62
copied your trigger EXACTLY, MR Zero
and when i saved it said its not correct... wtf

what the hell does this mean?
Code:
//***************************************************************************
//*
//*  Global Variables
//*
//***************************************************************************

globals
    // User-defined
    integer array           udg_Pick_Taken

    // Generated
    rect                    gg_rct_Int                 = null
    rect                    gg_rct_Agi                 = null
    rect                    gg_rct_Str                 = null
    rect                    gg_rct_Spawn               = null
    rect                    gg_rct_Starting_Zone       = null
    trigger                 gg_trg_Melee_Initialization = null
    trigger                 gg_trg_Player_Spawning     = null
    trigger                 gg_trg_Leaving_the_Game    = null
    trigger                 gg_trg_Wheater_Effects1    = null
    trigger                 gg_trg_Wheater_Effects2    = null
    trigger                 gg_trg_Wheater_Effects3    = null
    trigger                 gg_trg_Wheater_Effects4    = null
    trigger                 gg_trg_ChooseInt           = null
    trigger                 gg_trg_ChooseAgi           = null
    trigger                 gg_trg_ChooseStr           = null
    trigger                 gg_trg_Inn_Teleport        = null
    unit                    gg_unit_E001_0003          = null
    unit                    gg_unit_E000_0004          = null
    unit                    gg_unit_E002_0005          = null
    rect                    gg_rct_StrInt              = null
    rect                    gg_rct_AgiInt              = null
    trigger                 gg_trg_ChooseStrInt        = null
    trigger                 gg_trg_ChooseAgiInt        = null
    unit                    gg_unit_E003_0014          = null
    unit                    gg_unit_E004_0013          = null
endglobals

function InitGlobals takes nothing returns nothing
    local integer i = 0
    set i = 0
    loop
        exitwhen (i > 1)
        set udg_Pick_Taken[i] = 0
        set i = i + 1
    endloop

endfunction

function Trig_Inn_Teleport_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A005' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Inn_Teleport_Actions takes nothing returns nothing
    local unit udg_a
    set udg_a = GetTriggerUnit()
    call TriggerSleepAction( 3.00 )
    call SetUnitPositionLoc( udg_a, GetRandomLocInRect(udg_Staring_Zone))
    set udg_a = null
endfunction

//===========================================================================
function InitTrig_Inn_Teleport takes nothing returns nothing
    set gg_trg_Inn_Teleport = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Inn_Teleport, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Inn_Teleport, Condition( function Trig_Inn_Teleport_Conditions ) )
    call TriggerAddAction( gg_trg_Inn_Teleport, function Trig_Inn_Teleport_Actions )
endfunction
 

Mr Zero

Junior Regular (Got the T-shirt)
Reaction score
64
copied your trigger EXACTLY, MR Zero
and when i saved it said its not correct... wtf

what the hell does this mean?
It means you have not altar the region in the code to your region; try this insted:
Code:
Custom script:   call SetUnitPositionLoc( udg_a, GetRandomLocInRect(gg_rct_Starting_Zone))
 

Quauhtli

I have the right to remain silent.
Reaction score
62
EDIT:
Yes!!
FINALLY!!!!
No error that it doesnt work!
HURRAY
 

Quauhtli

I have the right to remain silent.
Reaction score
62
http://www.thehelper.net/forums/showpost.php?p=358391&postcount=3

Just tell why it won't work for all players since I used Triggering unit and not a variable.

what u mean i used a variable?
i havnt used any variable -- that i know of:nuts:
Generic unit means whatever unit - normal trigger
and Point well thats just your region name - normal trigger + region...
so...
variable?
i would help if you want me, but i just dont know how this wont work
are u sure u used a good item? the item should be clickable and have an ability on it! base the ability on Item Mana Regain and change the mana regained to 0 and change the Art - Caster to whatever you want and remove the Art - Target
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
To conclude the whole thread, the trigger will work if you just use triggering unit instead of casting unit and no variables needed.:eek:
 

Chocobo

White-Flower
Reaction score
409
To conclude the whole thread, the trigger will work if you just use triggering unit instead of casting unit and no variables needed.:eek:

And other posts are just for fun (just get more posts ffs?!), aren't they?

I repost the trigger if someone lost it in the page 1 :

Code:
Spot Move
Events
Unit - Generic unit starts the effect of an ability

Conditions
(Ability being cast) Equal to <your item ability>

Actions
Wait 3.00 second of game-time
Unit - Move instantly (Triggering unit) to Point
 

Tonks

New Member
Reaction score
160
It's odd, but I had a similar trigger, and it doesn't work.
My trigger used "Move (Triggering Unit) instantly..." after a wait, but then I realised that the wait removes the triggering unit function.
So at the beginning of the trigger I set a variable = triggering unit. Then I referenced the unit with the variable, after the wait. Still, it doesn't work.
Why is this? I'm using RoC, so Custom Script is not available to me. :rolleyes:
Is there any way around this? Any other way to reference the unit, or wait a few seconds before doing the actions?
 

Chocobo

White-Flower
Reaction score
409
Code:
function Trig_Teleport_Conditions takes nothing returns boolean
    if(not(GetSpellAbilityId()=='A005')) then
        return false
    endif
    return true
endfunction

function Trig_Teleport_Actions takes nothing returns nothing
    local unit a=GetTriggerUnit()
    call PolledWait(3.)
    call SetUnitPositionLoc(a,udg_point))
    set a=null
endfunction

//===========================================================================
function InitTrig_Teleport takes nothing returns nothing
    set gg_trg_Teleport=CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(gg_trg_Teleport,EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(gg_trg_Teleport,Condition(function Trig_Teleport_Conditions))
    call TriggerAddAction(gg_trg_Teleport,function Trig_Teleport_Actions)
endfunction

You extract the .j file of the map after having created a trigger called Teleport and a variable point (location) called point, then you put this before InitCustomTriggers, and you add a line in InitCustomTrigger called call InitTrig_Teleport(). Then you reinject the .j file inside the map. Don't forget the location of the point you want to move the unit (called udg_point, in GUI it is point only).
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top