Pick up object ---> Give weapon?

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
Aman/Pinguin
Jedi
Jedi
Posts: 1104
Joined: Tue Jan 30, 2007 6:04 am
Projects :: Inactive
Location: Germany

Pick up object ---> Give weapon?

Post by Aman/Pinguin »

Okay I'm trying something at the moment...
Is it possible that if you pick up an ammo pack or something like that, you get a weapon? Maybe there's a lua command for this?
Caleb1117
2008 Most Original Avatar
Posts: 3096
Joined: Sun Aug 20, 2006 5:55 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: X-Fire: caleb1117 ಠ_ಠ

Re: Pick up object ---> Give weapon?

Post by Caleb1117 »

It is possible, but it would affect every class of the type.
So you pick up a rifle, every other unit of whatever class you are, gets one too.
Aman/Pinguin
Jedi
Jedi
Posts: 1104
Joined: Tue Jan 30, 2007 6:04 am
Projects :: Inactive
Location: Germany

Re: Pick up object ---> Give weapon?

Post by Aman/Pinguin »

And HOW does it work? :P
User avatar
trainmaster611
Sith Lord
Sith Lord
Posts: 1779
Joined: Thu Aug 24, 2006 5:22 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Building a railway to Coruscant
Contact:

Re: Pick up object ---> Give weapon?

Post by trainmaster611 »

I don't know much about this. Zerted has said it is possible to have pick-upable weapons. Does he mind if he explains how this might work publicly? :P
Aman/Pinguin
Jedi
Jedi
Posts: 1104
Joined: Tue Jan 30, 2007 6:04 am
Projects :: Inactive
Location: Germany

Re: Pick up object ---> Give weapon?

Post by Aman/Pinguin »

Hopefuly... :?

EDIT: Is there maybe a way, to activate award weapons with Picking up a item?
Syth
General
General
Posts: 784
Joined: Thu Apr 13, 2006 8:46 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: happy fun island

Re: Pick up object ---> Give weapon?

Post by Syth »

Well im definitely not zerted, but basically picking up a flag is an "event", and on an event you can set things to happen, like changing a units inventory. But im pretty sure you can't have the game recognize what unit your currently useing, and i know the changes you make will apply to all of that specific unit.

So if as a clone sniper (if there was a way for the game to recognize you as a sniper) you pick up a weapon (technically a flag), all snipers will get that weapon(which may cause crashing).
Aman/Pinguin
Jedi
Jedi
Posts: 1104
Joined: Tue Jan 30, 2007 6:04 am
Projects :: Inactive
Location: Germany

Re: Pick up object ---> Give weapon?

Post by Aman/Pinguin »

Don't worry, I've got a solucion for this. I don't tell which one though :lol: .
RepSharpshooter
Gametoast Staff
Gametoast Staff
Posts: 1351
Joined: Tue Jul 10, 2007 4:10 pm

Re: Pick up object ---> Give weapon?

Post by RepSharpshooter »

I am interested in this as well. I'm trying to look through the luas to find something of use.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Pick up object ---> Give weapon?

Post by Maveritchell »

When you modify a unit's weapon midgame, it basically will affect every unit of that class spawned thereafter. I've never tested it with multiple units of the same class on the field, but I don't think that a crash would be caused by increasing the amount of units.

Basically, the way it works is when an event is triggered (like the flag pickup mentioned earlier), you modify the property WeaponName in the unit's .odf through the .lua command SetClassProperty. You can only modify that property if it had a previously existing property, so you couldn't "create" a weaponslot if one didn't exist before.

Also, like I mentioned, this change is only applied to all units spawned after the change is made. Therefore, you'd have to make it so that the player either reselected the unit from a command post or that the player was forced to respawn.
Post Reply