Jump to content

Unable to modify reputation with script


AxlDave

Recommended Posts

SO I have a piece of armour that alters reputation all over the Mojave. Trouble is, I can't get it to work. The script saves, so it must make sense, and the script is linked to the armour. I can't see why it doesn't work, but it doesn't. As in, nothing changes.

 

Here's the script, it's quite long but fairly simple:

 

scn RepScript

 

short DoOnce

BEGIN OnEquip Player

if ( DoOnce == 0 ) || ( DoOnce == 2 )
if ( Player.GetAV Karma >= 250 )
Player.AddReputation RepNVFreeside 1 100
Player.AddReputation RepNVGoodsprings 1 100
Player.AddReputation RepNVNovac 1 100
Player.AddReputation RepNVPrimm 1 100
Player.AddReputation RepNVTheStrip 1 100
Player.AddReputation RepNVBoomer 1 25
Player.AddReputation RepNVGreatKhans 1 25
Player.AddReputation RepNVPowderGanger 1 0
Player.AddReputation RepNVWhiteGloveSociety 1 25
Player.AddReputation RepNVFollowers 1 50
Player.AddReputation RepNVBrotherhood 1 50
Player.AddReputation RepNVNCR 1 50
Player.AddReputation RepNVCaesarsLegion 1 -100

Player.AddReputation RepNVFreeside 0 0
Player.AddReputation RepNVGoodsprings 0 0
Player.AddReputation RepNVNovac 0 0
Player.AddReputation RepNVPrimm 0 0
Player.AddReputation RepNVTheStrip 0 0
Player.AddReputation RepNVBoomer 0 25
Player.AddReputation RepNVGreatKhans 0 25
Player.AddReputation RepNVPowderGanger 0 50
Player.AddReputation RepNVWhiteGloveSociety 0 50
Player.AddReputation RepNVFollowers 0 0
Player.AddReputation RepNVBrotherhood 0 50
Player.AddReputation RepNVNCR 0 25
Player.AddReputation RepNVCaesarsLegion 0 100

set DoOnce to 1

ShowMessage AXL1

endif
endif

if ( DoOnce == 0 ) || ( DoOnce == 1 )
if ( Player.GetAV Karma <= -250 )
Player.AddReputation RepNVFreeside 1 0
Player.AddReputation RepNVGoodsprings 1 0
Player.AddReputation RepNVNovac 1 0
Player.AddReputation RepNVPrimm 1 0
Player.AddReputation RepNVTheStrip 1 0
Player.AddReputation RepNVBoomer 1 25
Player.AddReputation RepNVGreatKhans 1 25
Player.AddReputation RepNVPowderGanger 1 75
Player.AddReputation RepNVWhiteGloveSociety 1 50
Player.AddReputation RepNVFollowers 1 0
Player.AddReputation RepNVBrotherhood 1 0
Player.AddReputation RepNVNCR 1 0
Player.AddReputation RepNVCaesarsLegion 1 100

Player.AddReputation RepNVFreeside 0 100
Player.AddReputation RepNVGoodsprings 0 100
Player.AddReputation RepNVNovac 0 100
Player.AddReputation RepNVPrimm 0 100
Player.AddReputation RepNVTheStrip 0 100
Player.AddReputation RepNVBoomer 0 25
Player.AddReputation RepNVGreatKhans 0 25
Player.AddReputation RepNVPowderGanger 0 0
Player.AddReputation RepNVWhiteGloveSociety 0 25
Player.AddReputation RepNVFollowers 0 50
Player.AddReputation RepNVBrotherhood 0 50
Player.AddReputation RepNVNCR 0 75
Player.AddReputation RepNVCaesarsLegion 0 -100

set DoOnce to 2

ShowMessage AXL2

endif
endif

END


BEGIN OnUnequip Player

set DoOnce to 0

END

 

 

Any ideas why reputation won't budge a smegging inch? Or why Message 1 will show up with good karma, but when karma drops below -250, I have to unequip and re-equip the armour in order to get Message 2? It works like that both ways, if I have bad karma it will show Message 2, but not Message 1 until re-equipped.

Link to comment
Share on other sites

See this page. When using AddReputation, you need to use values from 1 to 5 as the amount. For exact values, use AddReputationExact. For negative values, use RemoveReputation or RemoveReputationExact.

Moreover, there is no need to specify a calling reference in any of the above.

Link to comment
Share on other sites

I still have the problem whereby reputation only alters upon unequipping and re-equipping the armour.

 

What happens is, I wear the armour with Karma = 0. I then raise my Karma to 250, but nothing changes. If I then take off the armour and put it back on, suddenly reputation changes. Every time I want reputation to change, it involves taking off and putting back on the outfit.

 

I thought the script would make the change immediately on detection of the Karma level, but it apparently requires DoOnce to be reset to 0. I'm not sure why, any ideas?

Link to comment
Share on other sites

Just as their names suggest, the OnEquip and OnUnequip blocks only run once, when the scripted object is equipped/unequipped.

If you want the script to continuously monitor the player's karma while the armour is equipped, you will need to use a GameMode block:




scn RepScript

short DoOnce

begin GameMode

if GetContainer != player
elseif player.GetEquipped ArmorEditorID
(The rest of the script goes here)
endif

end

Link to comment
Share on other sites

One last question, is there any way to modify reputation without the message coming up? Usually, it's just a case of sticking a 0 in the script line, such as "Player.AddItem AnItem 1 0". However "AddReputationExact RepNVFreeside 1 25 0" does not save, so clearly that's not it.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...