Jump to content

Recommended Posts

Posted

Anyone know a script method that will give a return value of of a game setting?

 

 

 

I'm trying to get a return value. ( fBarterBuyBase ) , ( fBarterBuyMult )

 

--------------------------------

 

Im trying to get an object to revil what it would cost if you bought it from a vendor. So looking at it would show the actual cost you would incur.

 

 

The barter system formula is :

Buying price = (Item Value * fBarterBuyBase) + (Item Value * Skill * fBarterBuyMult / 100)

-----------------------------------------------

 

 

I can set varibles to get the item value with fose, and implement variables in place of the game settings so I'll be able to

 

mimic the barter system formula. I just need to implement the actual values of the game settings for it to work, and these change as you play.

 

 

 

Example of what I've come up with so far:

 

Ref ThisItem

Int ThisItemPicked
Int MyValue
Int CalculatingBarterValue
Int BarterBuyBase
Int BSkill
Int BuyMult

if ThisItemPicked == 0
Set ThisItem to GetBaseObject
Set ThisItemPicked to 2
endif

if MyValue == 0
Set MyValue to Getvalue
Set BarterBuyBase to player.GetBaseActorValue Barter
Set BSkill to player.GetActorValue Barter ;???
; Set BuyMult to
endif


if CalculatingBarterValue == 0
; Buying price = (Item Value * fBarterBuyBase) + (Item Value * Skill * fBarterBuyMult / 100)
; Set MyValue to (MyValue * fBarterBuyBase) + (MyValue * Skill * fBarterBuyMult / 100)

 

Set MyValue to (MyValue * BarterBuyBase) + (MyValue * BSkill * BuyMult / 100)

Set CalculatingBarterValue to 1
endif

-----------------------------

 

 

 

Posted

You can call GetGameSetting like so:

FLOAT MyBase
FLOAT MyMult

set MyBase to GetGameSetting fBarterBuyBase
set MyMult to GetGameSetting fBarterBuyMult

Then use MyBase and MyMult in your calculations as you described.

  • Recently Browsing   0 members

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