Energy drain on grenade explosion

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
JimmyAngler
High General
High General
Posts: 837
Joined: Mon Nov 04, 2013 10:37 am
Projects :: Battlefront Halation
Games I'm Playing :: SWBF 1-2-2015
xbox live or psn: none
Location: Area 51

Energy drain on grenade explosion

Post by JimmyAngler »

Is there a line for an odf that drains sprint/roll/energy when a grenade explodes?
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: Energy drain on grenade explosion

Post by Marth8880 »

LRKfm946
Master Sergeant
Master Sergeant
Posts: 163
Joined: Sun Feb 02, 2014 6:13 pm
Projects :: Battlefront II Hunger Games
Games I'm Playing :: SWBF2 BF3
Contact:

Re: Energy drain on grenade explosion

Post by LRKfm946 »

It could be done via lua (I think). When the player gets damaged, get the class of the object that damaged them, if it's the class of the energy drain grenade, then decrease the player's stamina.

It might not work though, because I'm having issues changing stamina via Lua right now. I don't know if I'm not doing it right or if it's just not possible. I'm using SetProperty(playerUnit, "EnergyRestore", value).
Post Reply