Jump to content

AI travel package condition / triggering issues


becauseofreasons

Recommended Posts

Having some issues with the AI travel package. Basically I want this companion to leave the player (adopt this package) when the player is sleeping and they've gotten past a certain point in the quest.

Here's the script for the character's quest.

ScriptName MerrittDialogueScript

int bMerrittContinue
int bMerrittHasMet
int bMerrittOutOfTown
float fMerrittFirstJobStart

begin GameMode
	if MerrittREF.HasBeenHired && bMerrittContinue == 0
		if nVPrimmDeputyConv.BeagleCaptured >= 1
			MerrittREF.StartConversation Player vMerrittDialogueMerrittTopic018
			; throw into result script for vMerrittDialogueMerrittTopic018
			set bMerrittContinue to 1
		endif
	endif

	if MerrittREF.HasFirstJob == 0 && IsPCSleeping && bMerrittContinue

		Set MerrittREF.Waiting to 0
		Set MerrittREF.L38 to 0
		Set MerrittREF.IsFollowingDefault to 0
		Set MerrittREF.IsFollowingLong to 0
		Set MerrittREF.HasFirstJob to 1
		MerrittREF.evp

		; Give the player a letter so they don't think I messed up and
		; figure out the day so Merritt can come back the day after.
	
		player.addItem MerrittFirstJobLetter 1
		Set fMerrittFirstJobStart to GameDaysPassed
	
	endif
	if  MerrittREF.HasFirstJob && GameDaysPassed == fMerrittFirstJobStart + 1.0
	
		; Merritt comes back.
		Set MerrittREF.IsFollowingDefault to 1
		set MerrittREF.HasFirstJob to 2
                MerrittREF.evp
	endif
end 

And per GrayFox's tutorial, here's my object script for the character reference. VMerrittTimer is just barks.

scn MerrittScript

short HasBeenHired
short L38
short DoOnce

int CombatStyleRanged
int CombatStyleMelee
int IsFollowingDefault
int IsFollowingLong
int FollowerSwitchAggressive
int Waiting
int HasFirstJob

Begin GameMode
	If (DoOnce != 1)
		Set HasBeenHired to 0
		Set L38 to 0
		Set CombatStyleRanged to 1
		Set CombatStyleMelee to 0
		Set IsFollowingDefault to 0
		Set IsFollowingLong to 0
		Set FollowerSwitchAggressive to 0
		Set Waiting to 0
		Set HasFirstJob to 0
		Set DoOnce to 1
	EndIf
	If HasBeenHired
		StartQuest VMerrittTimer
	Endif
End

Begin OnDeath
	ShowMessage FollowerMessageDeadMerritt
End

For the travel block I have one condition, HasFirstJob == 1.

I would like for when the character is sleeping (IsPCSleeping), the player has asked the character to stick with them (bMerrittContinue), and the character has not yet left (HasFirstJob == 0), for the other character states to be deactivated, and the character to be sent off.

But instead he runs off the moment he joins the party. I've checked the result scripts and nothing touches HasFirstJob and moreover, it's not triggering the AddItem in the companion script. He just gets up and leaves. So either there's something triggering HasFirstJob that I'm unaware of--unlikely, since I just added it and was very conscious of what I did and did not do, but possible--or there's some aspect of package evaluation and conditions that I'm not aware of.

Anyway, would really appreciate any advice.

Edited by becauseofreasons
Link to comment
Share on other sites

  • Recently Browsing   0 members

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