Page 1 of 1

Removing Award

Posted: Mon Jan 07, 2008 12:25 am
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.

Re: Removing Award

Posted: Mon Jan 07, 2008 12:51 am
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. :|

Re: Removing Award

Posted: Mon Jan 07, 2008 11:44 am
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?

Re: Removing Award

Posted: Mon Jan 07, 2008 1:25 pm
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.

Re: Removing Award

Posted: Mon Jan 07, 2008 1:36 pm
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.

Re: Removing Award

Posted: Mon Jan 07, 2008 1:40 pm
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.

Re: Removing Award

Posted: Mon Jan 07, 2008 1:57 pm
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?

Re: Removing Award

Posted: Mon Jan 07, 2008 2:05 pm
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.

Re: Removing Award

Posted: Mon Jan 07, 2008 2:29 pm
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.

Re: Removing Award

Posted: Mon Jan 07, 2008 2:33 pm
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?

Re: Removing Award

Posted: Mon Jan 07, 2008 2:53 pm
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.

Re: Removing Award

Posted: Mon Jan 07, 2008 2:57 pm
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

Re: Removing Award

Posted: Mon Jan 07, 2008 3:16 pm
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

Re: Removing Award

Posted: Tue Jan 08, 2008 3:20 pm
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.

Re: Removing Award

Posted: Tue Jan 08, 2008 6:04 pm
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?