Jump to content


Teleport Units


  • Please log in to reply
6 replies to this topic

#1 Guest_Guest_kteagel_*_*

Guest_Guest_kteagel_*_*
  • Guests

Posted 26 January 2009 - 09:52 AM

I have a question. Is it possible to teleport any unit that enters a area to a waypoint (in the World Builder (bfme2))?
Something like this:
*** IF ***
	 Unit '<"Any Object">' enters  area 'Tele1'
*** THEN ***
  Teleport Unit '<This Object>' to Waypoint 'Tele1w'.
(Any Object doesnt exists)

#2 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 26 January 2009 - 11:39 AM

I suggest you try and see what happens :thumbsupsmiley:
Ridder Geel

#3 Crusard

Crusard

    Local n00b

  • Project Team
  • 483 posts
  • Location:Buenos Aires, Argentina
  • Projects:Crusard's Tower Defense
  •  Poor feedback kills mapper.

Posted 26 January 2009 - 06:07 PM

Sadly, the game engine can't work with references like "triggering unit", etc.

Here's a possible workaround that does the job:
*** IF ***
	 Player '<All Players>' has Greater Than  0  unit or structure of type 'GondorFighter' in the area 'Portal Area'
*** THEN ***
  Find unnamed 'GondorFighterHorde' Owned by Player 'Player_1' nearest team Team 'PlyrCivilian/Portal1' and reference as UnitRef 'TeleportedUnit'
  Play Sound 'SpellArrowVolleyStomp' as though it was a 2D sound (NOT RECOMMENDED for 3D sounds).
  Teleport Unit 'TeleportedUnit' to Waypoint 'Portal Exit'.
  Move Unit 'TeleportedUnit' to Waypoint 'Portal Exit WalkTo'.
(unckeck "deactivate after success" and set the "Evaluate script every X seconds")

"Portal Exit" is the teleport exit.
"Portal Exit WalkTo" is where units walk to when they exit from Portal Exit (prevents a bug)
Use an object as portal, on team "PlyrCivilian/Portal1" (can be a rock or anything)

As you see this script only works for a single unit type at a time, for one player.
You'll have to make copies and change the unit types as you need for your map.

Edited by Crusard, 26 January 2009 - 06:45 PM.

Posted Image


#4 Puppeteer

Puppeteer

    title available

  • Global Moderators
  • 2,947 posts
  • Location:United Kingdom
  •  Faute de Mieux
  • Division:Community
  • Job:Magazine Staff/Global Moderator

Posted 26 January 2009 - 09:45 PM

I was never too sure if Local Unit and all that doodah actually worked. Apparently not.

#5 Devon

Devon

    Dark Nerd of the Sith

  • Global Moderators
  • 5,886 posts
  • Location:Colbert Nation
  • Projects:RJ RotWK, Twilight of the Republic, HDLH
  •  T3A Chamber Member
  • Division:Community
  • Job:Global Moderator
  • Donated

Posted 27 January 2009 - 12:04 AM

If I had worldbuilder on this comp, I could load one of my old maps and tell you an easier way :good: Alas, I don't...I forget what it was...

yodasig2.png
My political compass
There's a story that the grass is so green...what did I see? Where have I been?


#6 Fingulfin

Fingulfin

    I Like Pi3. Do you?

  • Hosted
  • 1,752 posts
  • Location:California, USA
  • Projects:Staying Alive.
  •  This place looks familiar. I can't remember why.

Posted 28 January 2009 - 10:24 AM

I have a very interesting workaround that I made some time ago, I can dig up the info if you want. It does use map.ini, but you can probably use a direct copy paste of my code.
Video of what it does

Basically I wtfpwned the CaH teleport ability, gave it to a building (can be invisible or even off map if you want) and then made a script that says to use the ability whenever a unit enters the area.
Posted Image
--------------------------------------
"You look like a ghost of your former self..."

#7 Crusard

Crusard

    Local n00b

  • Project Team
  • 483 posts
  • Location:Buenos Aires, Argentina
  • Projects:Crusard's Tower Defense
  •  Poor feedback kills mapper.

Posted 28 January 2009 - 04:34 PM

I have a very interesting workaround that I made some time ago, I can dig up the info if you want. It does use map.ini, but you can probably use a direct copy paste of my code.
Video of what it does

Basically I wtfpwned the CaH teleport ability, gave it to a building (can be invisible or even off map if you want) and then made a script that says to use the ability whenever a unit enters the area.


Nice thinking :p

Posted Image





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users