Push player by lua

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
Donhomerj
Recruit Womprat Killer
Posts: 12
Joined: Sun Feb 17, 2019 5:55 am
Projects :: No Mod project currently.
Games I'm Playing :: SWBF2
xbox live or psn: No gamertag set

Push player by lua

Post by Donhomerj »

Hi Guys,
is it possible to push an object by a lua script?

Like something happens, and the game spawn a small explosion or something on the objects location and pushes it?
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Push player by lua

Post by Marth8880 »

You could spawn an invisible auto-firing turret that fires an emitterordnance with a push value. I did something similar to implement incendiary ammo here: https://github.com/marth8880/MEUScripts ... ce.lua#L87

Worth noting that the turret should have a very short LifeTime. Mine uses a value of 0.02 seconds, which gives it enough time to fire once and self-destruct.
User avatar
AnthonyBF2
Sith
Sith
Posts: 1255
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Re: Push player by lua

Post by AnthonyBF2 »

You could also put together some sort of destructible entity, then use IsVisible and IsCollidable to make it invisible and hollow, then use KillObject to trigger it's death near the player which would have an explosion attached.
Donhomerj
Recruit Womprat Killer
Posts: 12
Joined: Sun Feb 17, 2019 5:55 am
Projects :: No Mod project currently.
Games I'm Playing :: SWBF2
xbox live or psn: No gamertag set

Re: Push player by lua

Post by Donhomerj »

Complicated but logic solution. I am not sure however if that will work in multiplayer.

But thanks for the ideas!
Post Reply