Removing Award

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
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Removing Award

Post by Maveritchell »

Anyone know how to remove the effects of the awards "Endurance" and "War Hero?" For the life of me I can't figure it out. It seems like it should be really easy, but there's no LUA callback for removing the effects of player awards, and obviously you can't change them both through .odfs. Anyway, I'm fairly sure it can be done; I think it was done in archer01's OFM.
MasterSaitek009
Black Sun Slicer
Posts: 619
Joined: Wed Aug 23, 2006 4:10 pm

Re: Removing Award

Post by MasterSaitek009 »

I don't know if this helps but I think that in OFM's side folder Archer had a LVL called removeawards.lvl(or something like that).
Open it up with a notepad and see if you can find anything intelligible that looks like a function call.
That's all I've got. :|
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Removing Award

Post by [RDH]Zerted »

Do you just want to remove the graphical award effects (but still have the bonuses) or do you want the award bonuses gone too?
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Removing Award

Post by Maveritchell »

[RDH]Zerted wrote:Do you just want to remove the graphical award effects (but still have the bonuses) or do you want the award bonuses gone too?
Ideally, both. I figured I could just remove the award particle effects, but getting rid of the awards altogether would be ideal.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Removing Award

Post by Teancum »

If it's a custom side you can build em' without Award weapons to start. I did that with the Classic Conquest sides.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Removing Award

Post by Maveritchell »

Teancum wrote:If it's a custom side you can build em' without Award weapons to start. I did that with the Classic Conquest sides.
No kidding. The tough part is removing the buffing effects of the "Endurance" and "War Hero" awards, which is what I'm working on.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Removing Award

Post by [RDH]Zerted »

To remove the buff's graphical effects from a unit in the lua, use SetClassProperty( "<unit class>", "<buff name>", "")
Where <unit class> is the class of the unit you want to not have the effect.
Where <buff name> is BuffHealthEffect, BuffOffenseEffect, or BuffDefenseEffect.

Did you want to disable the awards in SP that you get when you earn everything?
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Removing Award

Post by Maveritchell »

[RDH]Zerted wrote:To remove the buff's graphical effects from a unit in the lua, use SetClassProperty( "<unit class>", "<buff name>", "")
Where <unit class> is the class of the unit you want to not have the effect.
Where <buff name> is BuffHealthEffect, BuffOffenseEffect, or BuffDefenseEffect.

Did you want to disable the awards in SP that you get when you earn everything?
I've actually already got the correct .odf setup to remove those effects:

Code: Select all

BuffHealthEffect = "cura"
HealthGainEffect = "cura"
DebuffEffect	 = "poisoned"
BuffOffenseEffect= " "
BuffDefenseEffect= " "

...and it doesn't seem to work - although what I'm going to do is just make a null effect and set that as an actual effect, because it seems to default to the common effects when it tries to read a nonexistant one.

But what I really want to do is, like you said, disable the awards so that nothing - particle effects, sounds, actual buff is present.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Removing Award

Post by [RDH]Zerted »

It works for me as a FakeConsole command. However there is a different between our code. You have a space, mine does not. Remove your space. This method should remove the particle effects and sounds.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Removing Award

Post by Maveritchell »

[RDH]Zerted wrote:It works for me as a FakeConsole command. However there is a different between our code. You have a space, mine does not. Remove your space. This method should remove the particle effects and sounds.
Whoops. I've noticed that before when working with HUDTags. Forgot to take that out here, although the null effects I'm using should work too. No idea on removing the actual physical effect, then?
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Removing Award

Post by [RDH]Zerted »

A " " should be an invalid effect and "" should mean disabling that field.

There is ScriptCB_SetPlayerAwardsEnabled and ScriptCB_GetPlayerAwardsEnabled. These set/get the value in the shell you change to turn on/off effects. It may work if you change the value while the map is being setup, but it may also change it for all the other maps too. You'd need to get and store the value, then change it before the map loads. When the map is ending, you restore the stored value. However, if an admin changes the map in the middle of a game, the server's award setting will not be restored.

The ScriptCBs are never used by the retail game, but here is an example of the value being used in the shell:

Code: Select all

this.GamePrefs.bIsPlayerAwardsEnabled = not this.GamePrefs.bIsPlayerAwardsEnabled
I'd guess its a boolean value: 0 or 1, nil or 'anything else', true or false.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Removing Award

Post by Maveritchell »

So what you're guessing is just that I have to use:
ScriptCB_SetPlayerAwardsEnabled(0) in the beginning of my ScriptPostLoad (or earlier?) and then before I trigger a missionvictory (or defeat) set it back to ScriptCB_SetPlayerAwardsEnabled(1).

If that's the case, how do I account for people quitting midgame?

Edit: No apparent effect in ScriptPostLoad
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Removing Award

Post by [RDH]Zerted »

More like ScriptPostLoad (or earlier):
defaultAwards = ScriptCB_GetPlayerAwardsEnabled() --store server's/user's setting
ScriptCB_SetPlayerAwardsEnabled(0) --turn off awards for this map

End of map (maybe could just change it back right after loading...):
ScriptCB_SetPlayerAwardsEnabled( defaultAwards ) --restore the server's/user's settings

I only looked at messing with game settings once, and that was a while ago with turning team damage on/off. Try it and see what it does.

(Off-topic: there was a topic on getting custom values from the shell (for custom modes settings and stuff) that I wanted to post in, but can't find it. Was it deleted?) Edit: Never mind, I found it in the SWBF1 Pack area
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Removing Award

Post by Maveritchell »

Forgot to mention this earlier, changing BuffOffense/DefenseEffect only changes the affect when the buff is administered; it doesn't have anything to do with the awarded "permanent" effects.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Removing Award

Post by [RDH]Zerted »

It works fine for me in removing the permanent awarded effects as a FakeConsole command. Though it does take effect when you respawn. Have you tried respawning?
Post Reply