Need some scripting help

Post » Sun Jun 27, 2010 6:51 pm

Alright, what i'm looking for is a script that will do the following. Check a reputation level and change the friend status based on it. The example being if goodsprings is accepted rep then set the status to neutral. Liked = friends, idolized = allied. i know how to check rep and i know how to set friendship status. i can't make the 2 scripts connect properly. So if anyone could show me how or just throw me the script i'd be much appreciative.
User avatar
Ashley Clifft
 
Posts: 3468
Joined: Thu Jul 26, 2007 5:56 am

Post » Sun Jun 27, 2010 10:53 am

bump, someone has to know how to do this if it's possible.
User avatar
FoReVeR_Me_N
 
Posts: 3556
Joined: Wed Sep 05, 2007 8:25 pm

Post » Sun Jun 27, 2010 2:29 pm

What about:

scn ReputationAllyModifierbegin GameMode	if (GetReputation RepNVGoodsprings # > #)		SetAlly PlayerFaction GoodspringsFaction 0	endif	if (GetReputation RepNVGoodsprings # > #)		SetAlly PlayerFaction GoodspringsFaction 1	endif	if (GetReputation RepNVGoodsprings # < #)		SetEnemy PlayerFaction GoodspringsFaction 0	endif	if (GetReputation RepNVGoodsprings # == #)		SetEnemy PlayerFaction GoodspringsFaction 1	endifend


All you have to do is figure out which # is required to be idolized, accepted, etc.
User avatar
Lloyd Muldowney
 
Posts: 3497
Joined: Wed May 23, 2007 2:08 pm

Post » Sun Jun 27, 2010 10:50 pm

problem there is Getreputation only checks fame/infamy and returns a value of 1 if true or 0 if false. So basically those statements are non functional. What you need is a function to take the return value of 1 from checking fame or infamy and use it to setally/setenemy. I tried using ref to store the return value variable, problem is i don't know the function at that point to say "if ref == 1 then setally". it's more complex then just stating that, which i tried, and geck is like "no you can't save it because there's an error i won't tell you"
What about:

scn ReputationAllyModifierbegin GameMode	if (GetReputation RepNVGoodsprings # > #)		SetAlly PlayerFaction GoodspringsFaction 0	endif	if (GetReputation RepNVGoodsprings # > #)		SetAlly PlayerFaction GoodspringsFaction 1	endif	if (GetReputation RepNVGoodsprings # < #)		SetEnemy PlayerFaction GoodspringsFaction 0	endif	if (GetReputation RepNVGoodsprings # == #)		SetEnemy PlayerFaction GoodspringsFaction 1	endifend


All you have to do is figure out which # is required to be idolized, accepted, etc.

User avatar
chirsty aggas
 
Posts: 3396
Joined: Wed Oct 04, 2006 9:23 am

Post » Sun Jun 27, 2010 8:53 pm

GetReputation actually returns an integer of whatever the current reputation is. You'd use one of the integer variable types to store its information. More important in your situation, however, is GetReputationPct. It returns a float of 0-1 based on current reputation divided by the value in the "Reputation" Form.

The code below should be easy enough to follow and work well enough to get you started. I only did a brief test, but it seems to work fine. I'm not certain how you wanted to handle the faction enemy aspect, so I wrote it as Infamy >= Fame + 2 to be enemy. That can just as well be Fame + 3 if you only want to go enemy on Villified, or removed completely if you don't want them to be enemies at all. Since the ReputationThresholds could possibly be modded, I check current % of reputation against those instead of static values.

Spoiler
short iRepGS0short iRepGS1float fRepPctGS0float fRepPctGS1begin GameMode	if fRepPctGS0 != GetReputationPct RepNVGoodsprings 0 || fRepPctGS1 != GetReputationPct RepNVGoodsprings 1		set fRepPctGS0 to GetReputationPct RepNVGoodsprings 0		set fRepPctGS1 to GetReputationPct RepNVGoodsprings 1		if fRepPctGS0 >= GetGameSetting fReputationThresholdThree			set iRepGS0 to 3		elseif fRepPctGS0 >= GetGameSetting fReputationThresholdTwo			set iRepGS0 to 2		elseif fRepPctGS0 >= GetGameSetting fReputationThresholdOne			set iRepGS0 to 1		elseif iRepGS0			set iRepGS0 to 0		endif		if fRepPctGS1 >= GetGameSetting fReputationThresholdThree			set iRepGS1 to 3		elseif fRepPctGS1 >= GetGameSetting fReputationThresholdTwo			set iRepGS1 to 2		elseif fRepPctGS1 >= GetGameSetting fReputationThresholdOne			set iRepGS1 to 1		elseif iRepGS1			set iRepGS1 to 0		endif		if iRepGS0 + 2 == iRepGS1			SetAlly PlayerFaction GoodspringsFaction 1 1		; Liked/Good Natured = Friend		elseif iRepGS0 + 3 == iRepGS1			SetAlly PlayerFaction GoodspringsFaction		; Admired = Ally		elseif iRepGS0 >= iRepGS1 + 2			SetEnemy PlayerFaction GoodspringsFaction		; Hated/Villified/Merciful Thug = Enemy		else			SetEnemy PlayerFaction GoodspringsFaction 1 1		; All else = Neutral		endif	endifend

User avatar
Monika Fiolek
 
Posts: 3472
Joined: Tue Jun 20, 2006 6:57 pm


Return to Fallout: New Vegas