Mav's weapon pickup system [Solved]

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
User avatar
General_Nate
Lieutenant General
Lieutenant General
Posts: 689
Joined: Sun Jun 28, 2009 4:01 pm
Projects :: None because BFII is not working
Games I'm Playing :: Minecraft
xbox live or psn: No gamertag set
Location: 127.0.0.1

Mav's weapon pickup system [Solved]

Post by General_Nate »

Ok guys. This may sound a bit odd, but I need to know how Mav did it. The entire mod relies on that one piece of code. Except, I want you to pickup a weapon once you destroy a prop. Also, if someone picks up a weapon, does the entire soldier class get it, or the entire side?

Please, I really need to know this code! I usually come up with it on my own now, but this time, I need you help.

Thanks in advance. :thumbs:
Last edited by General_Nate on Fri Jan 22, 2010 6:05 pm, edited 3 times in total.
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: Mav's weapon pickup system

Post by Fiodis »

If you look through his WIP for Bakura, you'd see pretty clearly that the dropped objects were flags and he used OnFlagPickup.

Also, I assume you know this, but it can't hurt to point it out just in case: changing a unit's weapon will cause a MP crash.
User avatar
General_Nate
Lieutenant General
Lieutenant General
Posts: 689
Joined: Sun Jun 28, 2009 4:01 pm
Projects :: None because BFII is not working
Games I'm Playing :: Minecraft
xbox live or psn: No gamertag set
Location: 127.0.0.1

Re: Mav's weapon pickup system

Post by General_Nate »

Fiodis wrote:If you look through his WIP for Bakura, you'd see pretty clearly that the dropped objects were flags and he used OnFlagPickup.

Also, I assume you know this, but it can't hurt to point it out just in case: changing a unit's weapon will cause a MP crash.
Yes I know all of that. Except the MP crash... :cry: Well, I guess I have a work around for that...

So the weapon replacement code would be:

Code: Select all

SetClassProperty("inf_classname", "WeaponName1", "weap_inf_weaponname") ?
If so, that code would be under: OnObjectKill, right?

All of the sudden I feel real stupid... :cpu:

If all of that jazz above is right, this can be solve-ified!

EDIT:
Just tried it and it works!

EDIT2:
Wait, what causes the MP crash? The flag pickup command? Or the SetClassProperty() command?
User avatar
Sky_216
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2086
Joined: Mon Feb 13, 2006 3:28 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Mav's weapon pickup system [UN-SOLVED]

Post by Sky_216 »

Entire class.

This may sound weird, but Mav's way actually seems like the easiest - I made it (flag version) and another (steal from enemy version) before bakura was released and flag works much better.
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: Mav's weapon pickup system

Post by Fiodis »

The weapon change itself, the SetClassProperty, causes the MP crash.
User avatar
General_Nate
Lieutenant General
Lieutenant General
Posts: 689
Joined: Sun Jun 28, 2009 4:01 pm
Projects :: None because BFII is not working
Games I'm Playing :: Minecraft
xbox live or psn: No gamertag set
Location: 127.0.0.1

Re: Mav's weapon pickup system [UN-SOLVED]

Post by General_Nate »

Skyhammer_216 wrote:Entire class.

This may sound weird, but Mav's way actually seems like the easiest - I made it (flag version) and another (steal from enemy version) before bakura was released and flag works much better.
Yeah I know, I already tried it. And sorry, I thought Mav was the first.
Fiodis wrote:The weapon change itself, the SetClassProperty, causes the MP crash.
Blast! Oh well, I guess my work around will work...

EDIT:
Oh yeah, can be solved.
Post Reply