• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Teleporting Units

Status
Not open for further replies.
Level 5
Joined
Jul 25, 2008
Messages
155
Hiya, I have been trying to make a unit who goes into a region teleport to another one, but I'm doing something wrong.. It looks like this:

  • function Trig_Teleport_to_HigherMoria_Actions takes nothing returns nothing
    • call SetUnitPositionLoc( GetTriggerUnit(), GetRectCenter(gg_rct_Teleport_into) )
  • endfunction
  • //===========================================================================
  • function InitTrig_Teleport_to_LowerMoria takes nothing returns nothing
    • set gg_trg_Teleport_to_LowerMoria = CreateTrigger( )
    • call TriggerRegisterEnterRectSimple( gg_trg_Teleport_to_HigherMoria, gg_rct_Teleport_Into_2 )
    • call TriggerAddAction( gg_trg_Teleport_to_HigherMoria, function Trig_Teleport_to_HigherMoria_Actions )
  • endfunction
Where the Teleport_to_HigherMoria is the trigger name, The Teleport_Into_2 is the region where you go into to get teleported, and Teleport_Into is the region where you get teleported from teleport_into_2
Anyone see what kind of mistake I'm doing here? I'd love some help =)
 
Level 8
Joined
Mar 23, 2007
Messages
302
I dont get it completly. However, i will try to help.
First... Do u try to cross Jass ang Gui??
dont do this, my advice, if u start to use scripts then go and learn
jass.

ok back to the problem to move a unit from Aenter to Aexit u will need
somthing like this:
  • Event - A unit enters REGION Aenter
  • Action
  • Unit - Move Entering/Triggering Unit to Aexit
now, do this for every Teleport way.

Important to know would be, this is a 1-way-teleport. because
u would need more efort to make it a 2-way with only 2 zones.
I would preffer u to make 4 Regions in total. then it would look
like this:
A enter ---------> A exit
B enter ---------> B exit

now place them correctly, so that the Exit of one is near but not in the Enter
of the other:
A enter ---------> A exit
B exit <--------- A enter

If u do a misstake like placing them into each other, or
try to make a 2 way with only 2 zones then u could create a loop.
that loop wold infinitly send this unit around... what could cause errors.

greets Equal
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
JASS:
function Trig_Teleport_to_HigherMoria_Actions takes nothing returns nothing
    call SetUnitPositionLoc( GetTriggerUnit(), GetRectCenter(gg_rct_Teleport_into) )
endfunction

//===========================================================================
function InitTrig_Teleport_to_LowerMoria takes nothing returns nothing
    set gg_trg_Teleport_to_LowerMoria = CreateTrigger(  )
    call TriggerRegisterEnterRectSimple( gg_trg_Teleport_to_HigherMoria, gg_rct_Teleport_Into_2 )
    call TriggerAddAction( gg_trg_Teleport_to_HigherMoria, function Trig_Teleport_to_HigherMoria_Actions )
endfunction
i think he just messed the tags
second, why use jass for that? the way Equal told is fairly easier
 
Level 5
Joined
Jul 25, 2008
Messages
155
Well, I borrowed it from another map which had a teleport aswell :p then I just changed the regions, I always use regular otherwise, but you can't convert GUI jass to GUI :/
Thanks for the help by the way, mucho appreciated :)
 
Status
Not open for further replies.
Top