Portal gun?

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

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

Re: Portal gun?

Post by Noobasaurus »

Fiodis wrote:
Noobasaurus wrote:As I was playing Mav's "The Big L" map in campaign, I saw that there might be another way to teleport yourself...

Since it seems when you hit the object you get teleported to it, perhaps you could make all the walls that specific type of object...

Well, I don't know... :?
It should be pointed out that it's easy to teleport yourself via lua. What Mav does in The Big L is teleport you to an object when you hit it with a specific weapon.
Oh...I see.
Hidden/Spoiler:
Errrrm...what would be the code for that? I would like to try it...
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Portal gun?

Post by Fiodis »

Noobasaurus wrote:Errrrm...what would be the code for that? I would like to try it...
You check what weapon the target was hit with using GetObjectLastHitWeaponClass (an example of that is in the Geonosis campaign). Then you use GetEntityMatrix to get the target's matrix and teleport your unit to that using SetEntityMatrix.
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Portal gun?

Post by Noobasaurus »

I got this:
Hidden/Spoiler:
if killer and IsCharacterHuman(killer) and GetObjectTeam(object) == DEF then
if GetObjectLastHitWeaponClass(object) == "rep_weap_lightsaber" or GetObjectLastHitWeaponClass(object) == "com_weap_inf_sabre_throw" then
droid_count_obj21 = droid_count_obj21 - 1
if droid_count_obj21 > 0 then
And I see that you need to kill the droid with either the lightsaber or saber throw, but how would you set up GetEntryMatrix and SetEntry Matrix?
Fiodis wrote:Then you use GetEntityMatrix to get the target's matrix and teleport your unit to that using SetEntityMatrix.
Would you just do GetEntryMatrix = "rep_inf_ep3_rifleman" for an example, or am I completely wrong?

I probably am. :?
Post Reply