Jump to content

Gender-based Perks for Player help?


DocNewcenstein

Recommended Posts

Ok, so now I'm not having fun.

 

I set up an Activator with a Script on it in the hallway with Gender conditions and even a QuestStageDone condition (set for when you leave the mirror). I console-checked the Player AVs before and after hitting the trigger (player.getAV) and nothing changed, they're still at 1.

 

Next, I rebuilt the mod and attached the script to the You're Special! book in Shaun's room. I click the book and my stats don't change.

 

 

Here's the Script I've got. It's an expanded version (added more ActorValue entries) of the vanilla DefaultSetAVTrigScript

 

I did set all the AVs and Values once the Script is attached. First 7 are the SPECIALS, 8 and 9 are Aim Stability and Speed Multiplier.

 

 

It's the only mod in my Data folder (just to be safe), and it is active.

 

 

 

Scriptname DrN_SetNateAV extends ObjectReference Default
{Default trigger script that can set the Actor Values (AVs) of one (or a chain of) linked actors when a trigger is entered.}

Group Required_Properties
	ActorValue property AV01 Auto Const
	{First Actor Value to set.}
	float property AV01_Value Auto Const
	{First Actor Value's new value.}
EndGroup

Group Optional_Properties
	ActorValue property AV02 Auto Const
	{Second Actor Value to set.}
	float property AV02_Value Auto Const
	{Second Actor Value's new value.}

	ActorValue property AV03 Auto Const
	{Third Actor Value to set.}
	float property AV03_Value Auto Const
	{Third Actor Value's new value.}

	ActorValue property AV04 Auto Const
	{Fourth Actor Value to set.}
	float property AV04_Value Auto Const
	{Fourth Actor Value's new value.}

	ActorValue property AV05 Auto Const
	{Fifth Actor Value to set.}
	float property AV05_Value Auto Const
	{Fifth Actor Value's new value.}
	
	ActorValue property AV06 Auto Const
	{Sixth Actor Value to set.}
	float property AV06_Value Auto Const
	{Sixth Actor Value's new value.}

	ActorValue property AV07 Auto Const
	{Seventh Actor Value to set.}
	float property AV07_Value Auto Const
	{Seventh Actor Value's new value.}
	
	ActorValue property AV08 Auto Const
	{Eighth Actor Value to set.}
	float property AV08_Value Auto Const
	{Eighth Actor Value's new value.}
	
	ActorValue property AV09 Auto Const
	{Ninth Actor Value to set.}
	float property AV09_Value Auto Const
	{Ninth Actor Value's new value.}
		
	bool property onlyPlayer = True Auto Const
	{Default=TRUE. Only accept trigger events from the player?}

	bool property onlyOnce = True Auto Const
	{Default=TRUE. Only set AVs once? If True, disables and deletes the trigger when done.}

	Keyword property linkKeyword Auto Const
	{Link Keyword for the actor (or chain of actors) whose AVs we're going to set.}

	int property maxLinks = 25 Auto Const
	{Maximum number of actors to set AVs on. Acts as a failsafe in case the actors are linked in a loop.}
EndGroup

Group Debug_Properties
	Bool Property ShowTraces = FALSE Auto Const
	{Default = FALSE, Set to TRUE if you want the traces in this script to show up in the log.}
EndGroup

Event OnTriggerEnter(ObjectReference akActionRef)
	if (!onlyPlayer || akActionRef == Game.GetPlayer())
		SetActorValues(Self.GetLinkedRef(linkKeyword) as Actor)
		if (onlyOnce)
			Self.Disable()
			Self.Delete()
		EndIf
	EndIf
EndEvent

;Recursive helper function that sets the AVs for a chain of linked actors.
Function SetActorValues(Actor akActor)
	Actor current = akActor
	int i = 0
	While ((current != None) && (i < maxLinks))
		DefaultScriptFunctions.DefaultScriptTrace("SETAV on " + current, ShowTraces)

		;Set the AVs to their new values.
		if (AV01 != None)
			DefaultScriptFunctions.DefaultScriptTrace("SETAV " + AV01 + " on " + self + " to " + AV01_Value, ShowTraces)
			current.SetValue(AV01, AV01_Value)
		EndIf
		if (AV02 != None)
			DefaultScriptFunctions.DefaultScriptTrace("SETAV " + AV02 + " on " + self + " to " + AV02_Value, ShowTraces)
			current.SetValue(AV02, AV02_Value)
		EndIf
		if (AV03 != None)
			DefaultScriptFunctions.DefaultScriptTrace("SETAV " + AV03 + " on " + self + " to " + AV03_Value, ShowTraces)
			current.SetValue(AV03, AV03_Value)
		EndIf
		if (AV04 != None)
			DefaultScriptFunctions.DefaultScriptTrace("SETAV " + AV04 + " on " + self + " to " + AV04_Value, ShowTraces)
			current.SetValue(AV04, AV04_Value)
		EndIf
		if (AV05 != None)
			DefaultScriptFunctions.DefaultScriptTrace("SETAV " + AV05 + " on " + self + " to " + AV05_Value, ShowTraces)
			current.SetValue(AV05, AV05_Value)
		EndIf
		if (AV06 != None)
			DefaultScriptFunctions.DefaultScriptTrace("SETAV " + AV06 + " on " + self + " to " + AV06_Value, ShowTraces)
			current.SetValue(AV06, AV06_Value)
		EndIf
		if (AV07 != None)
			DefaultScriptFunctions.DefaultScriptTrace("SETAV " + AV07 + " on " + self + " to " + AV07_Value, ShowTraces)
			current.SetValue(AV07, AV07_Value)
		EndIf
		if (AV08 != None)
			DefaultScriptFunctions.DefaultScriptTrace("SETAV " + AV08 + " on " + self + " to " + AV08_Value, ShowTraces)
			current.SetValue(AV08, AV08_Value)
		EndIf
		if (AV09 != None)
			DefaultScriptFunctions.DefaultScriptTrace("SETAV " + AV09 + " on " + self + " to " + AV09_Value, ShowTraces)
			current.SetValue(AV09, AV09_Value)
		EndIf
		;Evaluate package, since this is (often) changed by the new AVs.
		current.EvaluatePackage()

		i = i + 1
		current = current.GetLinkedRef(linkKeyword) as Actor
	EndWhile
	DefaultScriptFunctions.DefaultScriptTrace("SETAV Finished for " + akActor + " with links " + i, ShowTraces)
EndFunction



Link to comment
Share on other sites

I compared this one to DefaultSetAVOnCellLoad and that one says Extends Actor, not ObjectRef. So I changed mine to Actor, recompiled successfully, and still nothing.

 

I also did set the LinkedRef keyword to PlayerKeyword ("whose AVs we're going to set", as it says)

 

Might have to switch to the OnCellLoad script.

Link to comment
Share on other sites

Still no luck getting the actual initial SPECIALs to reflect the modifications at the start, but I think it does have something to do with all the swapping in and out the game does over the next few scenes, particularly once you leave the Cryo Pod. When I get to the elevator and change my Specials, they display correctly.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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