Teleport Weapon Code

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Teleport Weapon Code

Post by Noobasaurus »

Alright, I was wondering how and if you could make a weapon that when you use it it goes straight down:
Hidden/Spoiler:
[code]
ShotElevate = "-2.0"[/code]
And then smoke comes up as the explosion and you instantly teleport somewhere near.

So...is it possible as just a weapon or no?

EDIT: I found this thread that has the same thing. Now I wondering what that teleporting code in the lua and the weapon's odf might be.
User avatar
Firefang
Major
Major
Posts: 518
Joined: Mon Nov 15, 2010 8:55 pm
Location: California

Re: Teleport Weapon Code

Post by Firefang »

Use the same teleporting code but have OnObjectDamage rather than OnEnterRegion.
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Teleport Weapon Code

Post by DarthD.U.C.K. »

the topic you linked is about teleporting once something is damaged/activated. as far as i understand you want a teleportweapon that can be used anywhere and teleports the player to a random position close to his current positions?!
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Teleport Weapon Code

Post by Noobasaurus »

DarthD.U.C.K. wrote:the topic you linked is about teleporting once something is damaged/activated. as far as i understand you want a teleportweapon that can be used anywhere and teleports the player to a random position close to his current positions?!
Yes. There would be a bunch of nodes or something in a certain place he would be and when he uses the weapon he would teleport to one of those.
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Teleport Weapon Code

Post by DarthD.U.C.K. »

uh, that will be quite a bit of code, youll have to compare the players location to the nodes and find the nearest one.
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Teleport Weapon Code

Post by Noobasaurus »

DarthD.U.C.K. wrote:uh, that will be quite a bit of code, youll have to compare the players location to the nodes and find the nearest one.
Well I just want it to be any of those nodes, not the nearest one. When they use it they will be near all of them.
Hidden/Spoiler:
OFFTOPIC: What does a reflection region do? Reflect? I used one and it crashed...
Post Reply