tf? why does this set the wrong vlaue

Discussion in 'Fallout General Modding' started by Nirran, Oct 2, 2018.

  1. Nirran

    Nirran Vault Senior Citizen
    Modder

    Apr 15, 2007
    this is the entry in ini :
    Code:
    DudeOfferedValue=0.20
    and this is the code saeting an checkngif it is correct
    Code:
    set_sfall_global("barter_8", get_ini_string("Barter.ini|MISC|DudeOfferedValue"));
             display_msg("DudeOfferedValue " + get_sfall_global_int("barter_8"));
    currently display si 'DudeOfferedValue 4'

    what gives?

    edit : tried dif ini fiel and same result,renamed ini entry,tried bypassing sfall global,tried atof and it returns -1,im stumpted

    edit 2: checked another mod's ini settings,and seems ot be fine,donno wtf is causing this
     
    Last edited: Oct 2, 2018
  2. NovaRain

    NovaRain Casual Modder Modder

    Mar 10, 2007
    You should use atof to convert string to float first.
    And I don't know why you try to get a float value with get_sfall_global_int instead of get_sfall_global_float.
    This prints "DudeOfferedValue 0.20000".
    Code:
    set_sfall_global("barter_8", atof(get_ini_string("Barter.ini|MISC|DudeOfferedValue")));
    display_msg("DudeOfferedValue " + get_sfall_global_float("barter_8"));
     
    Last edited: Oct 2, 2018
  3. Nirran

    Nirran Vault Senior Citizen
    Modder

    Apr 15, 2007
    hehe sometimes i can be dumb,thzn man that did exactly what i wanted
     
  4. Nirran

    Nirran Vault Senior Citizen
    Modder

    Apr 15, 2007
    on a related note,what would ppl recommend as the math for dudes side of the table?currently i have it as straight 20% of proto entries minus caps,but i want the formula to slightly add more to dudes value based on skill etc etc

    edit : solved it with new impact multi ini setting,multi all formula aspects by percentage ini setting,seems ok,lvl 1 no perks or anything,item proto value is 700,it sells for 176 caps
     
    Last edited: Oct 3, 2018
  5. burn

    burn Where'd That 6th Toe Come From?
    Modder

    Apr 22, 2012
    Take a look at EcCo, it has all kinds of crazy calculations for barter. Skill level, charisma, reputation, karma, etc.