Jump to content

Companion Won't Follow. PLEASE HELP! :(


Guest Messenjah

Recommended Posts

Guest Messenjah

Ok, so I am at my wits end with this project. I have tried to follow each step in the companion tutorial but I can't seem to get it right! So, I have dumbed down my quests and scripts and I'm starting almost completely fresh with JUST the basic hire/fire dialogue. So, the problem is... that after I hire my companion (Vikki), she will NOT follow the player! No matter what I do!

 

 

So, here is my generic script:

 

scn VikkiCompanionSCRIPT


;** Vikki **
short	VikkiCompanionHired
short	VikkiCompanionFired

short 	HasBeenHired
short	WeaponOut
short	CombatStyleRanged
short	CombatStyleMelee
short	IsFollowingDefault
short	IsFollowingShort
short	IsFollowingLong
short	Waiting
short	DoOnce
Short 	Freed
Short 	Button
Short	DoOnce
Float	Timer

BEGIN GameMode
if player.getincell Vault87c && VikkiCompanionHired == 1
set VikkiCompanionHired to 0
set VikkiCompanionFired to 1
VikkiREF.moveto MS11FollowerEscapeHatchInteriorRef
ShowMessage FollowerMessageLeaveVikkiCompanion
endif
END


BEGIN OnCombatEND
if GetPlayerTeammate == 1
resethealth
restoreav perceptioncondition 100
restoreav endurancecondition 100
restoreav leftattackcondition 100
restoreav leftmobilitycondition 100
restoreav rightattackcondition 100
restoreav rightmobilitycondition 100
endif
END

BEGIN OnDeath

if VikkiCompanionHired == 1
set VikkiCompanionHired to 0
ShowMessage FollowerMessageDeadVikkiCompanion
endif

END

 

So, in the hire topic, I set up the result script in the begin box:

set VikkiREF.VikkiCompanionHired to 1
set VikkiREF.VikkiCompanionFired to 0
set VikkiREF.HasBeenHired to 1

 

 

And the fireyes dialogue end result script:

 

set VikkiREF.VikkiCompanionHired to 1

set VikkiREF.VikkiCompanionFired to 0

set VikkiREF.HasBeenHired to 1

 

I set both hire and fire topics as top level so that they would show up after the greeting (I assume this is the only way you can get it to show up after the greeting?

 

The Quest Condition for VikkiQuest is:

 

GetIsID NPC:VikkiCompanion

 

WIthin the Quest Data Tab I don't have any scripts set up. Not sure if I need one?

 

In FollowersVikkiFollowPlayerDEFAULT AI Package, I have the conditions set to:

GetScriptVariable Reference: VikkiREF, VikkiCompanionHired

 

 

Any clue as to what I'm doing wrong? Thanks!

Link to comment
Share on other sites

Ok, so I am at my wits end with this project. I have tried to follow each step in the companion tutorial but I can't seem to get it right! So, I have dumbed down my quests and scripts and I'm starting almost completely fresh with JUST the basic hire/fire dialogue. So, the problem is... that after I hire my companion (Vikki), she will NOT follow the player! No matter what I do!

 

 

Hey mate.

 

I am a little short of time today but I will take a look for you tomorrow. Have you set her packages up already?

 

At first glance the script looks fine but the actual follow is initiated via packages. Look at one of the vanilla follower to see how its done.

 

Start basic and just create hire/fire dialogue just as you have done and get that working. Add no other package other that the follow one.

 

You can look at my companions and rip the code if you like but keep in mind that they are quite complex and could easily loose you so I would stick with Fo3s vanilla companions for now.

 

Look at FO3 default companions script and just adapt that one for your companions as the scripting needs to be nothing fancy.

 

Once you get you confidence up then you can start to add some nice features :)

 

 

I will keep tab of the topic and get back to you tomorrow when i have more time.

 

______________________________________________________________

 

 

Heres the script for Kelsey.

 

 

scn LoxKelseySCRIPT

;** LoxKelsey **
short LoxKelseyHired
short LoxKelseyFired
short HasBeenHired
short CombatStyleRanged
short CombatStyleMelee
short IsFollowingDefault
short IsFollowingShort
short IsFollowingLong
short Waiting
short DoOnce
short KFlashlightOn
short LoxKelseyHealPercent
short LoxKelseyRunSpeed
short LoxKelseyHome
short LoxKelseyChillOut
short LoxKelseyWeaponDrawn
short LoxKelseyFollowDistance
short LoxKelseyShutUpPlease


BEGIN GameMode
; Keep her out of Vault 87 - Kelsey will go back to where you have set her home location to.

if ( player.getincell Vault87c && GetQuestRunning MQ08 && LoxKelseyHired == 1 )
	set LoxKelseyHired to 0
	set LoxKelseyFired to 1
	LoxKelseyREF.moveto KelseyXHomeMarker
	ShowMessage FollowerMessageLeaveLoxKelsey
endif

;_______________________________________________________
;Heals Kelsey if she drops below 30% and Battle heal is selected
	If ( GetItemCount Stimpak >=2 && GetHealthPercentage <= 0.30 &&  LoxKelseyHealPercent == 1 && LoxKelseyHired == 1 )
		LoxKelseyREF.PlayIdle 3rdPSpecialIdleStimpak
		LoxKelseyREF.ResetHealth
		LoxKelseyREF.restoreAV EnduranceCondition 40
		LoxKelseyREF.restoreAV PerceptionCondition 40
		LoxKelseyREF.restoreAV LeftAttackCondition 40
		LoxKelseyREF.restoreAV RightAttackCondition 40
		LoxKelseyREF.restoreAV LeftMobilityCondition 40
		LoxKelseyREF.restoreAV RightMobilityCondition 40
		LoxKelseyREF.removeitem stimpak 2
		LoxKelseyREF.PlayIdle 3rdPSpecialIdleStimpak
EndIF

; **** The following Statements Control Kelsey's Weapons Drawn Function ****
If ( player.isweaponout == 1 ) && LoxKelseyWeaponDrawn == 1 && LoxKelseyREF.Isincombat == 0 && LoxKelseyHired == 1
	LoxKelseyREF.Setalert 1
Endif

;If ( LoxKelseyREF.isweaponout == 1 ) && LoxKelseyHired == 1 && LoxKelseyREF.Isincombat == 0 && issneaking == 0 && LoxKelseyREF.Isrunning == 1
	;LoxKelseyREF.Setalert 0
;Endif

If ( player.isweaponout == 0 ) && LoxKelseyWeaponDrawn == 1 && LoxKelseyREF.Isincombat == 0 && LoxKelseyHired == 1
	LoxKelseyREF.Setalert 0
Endif


END
;____________________________________________________________________

BEGIN MenuMode 1012

If (GetPlayerTeammate == 1)
If ( IsTimePassing == 1 )
ResetHealth
RestoreAv PerceptionCondition 100
RestoreAv EnduranceCondition 100
RestoreAv LeftAttackCondition 100
RestoreAv LeftMobilityCondition 100
RestoreAv RightAttackCondition 100
RestoreAv RightMobilityCondition 100
EndIf
EndIf

END

;BEGIN OnCombatEND
;END


BEGIN OnDeath
; Show on Death of Kelsey
if ( LoxKelseyHired == 1  )
	set LoxKelseyHired to 0
	ShowMessage FollowerMessageDeadLoxKelsey
endif

END

 

 

And for Jessi

 

scn JessiSCRIPT


;** Jessi **
short	JessiHired
short	JessiFired
short 	HasBeenHired
short	WeaponOut
short	CombatStyleRanged
short	CombatStyleMelee
short	IsFollowingDefault
short	IsFollowingShort
short	IsFollowingLong
short	Waiting
short	DoOnce
short JFlashlightOn
short JessiHealPercent
short JessiRunSpeed
short JessiHome
short JessiChilledOut
short JessiDistanceSize


BEGIN GameMode

; Keep her out of Vault 87 - Jessi will crash if not.
if ( player.getincell Vault87c && GetQuestRunning MQ08 && JessiHired == 1 )
	set JessiHired to 0
	set JessiFired to 1
	JessiREF.moveto JessiXMarkerHome
	ShowMessage FollowerMessageLeaveJessi
endif
;_______________________________________________________

;Heals Jessi if she drops below 30% and Battle heal is selected		

If (GetPlayerTeammate == 1) && IsInCombat == 1 && JessiHealPercent == 1 && JessiHired == 1
	If HasMagicEffect RestoreHealthStimpak == 0
 		If GetHealthPercentage <= 0.30
			If GetItemCount Stimpak > 0
				CastImmediateOnSelf Stimpak
				PlayIdle AnimStempax
				RemoveItem Stimpak 1
			EndIf
		EndIf
	EndIf
EndIf

;********** Use Psycho if in Combat **********
	If (GetPlayerTeammate == 1) && IsInCombat == 1
		If HasMagicEffect PsychoMagicEffect == 0
			If GetActorValue Health <= 0.60
				If GetItemCount Psycho > 0
					CastImmediateOnSelf Psycho
					RemoveItem Psycho 1
				EndIf
			EndIf
		EndIf
	EndIf

;********** Use MedX if in Combat **********
	If (GetPlayerTeammate == 1) && IsInCombat == 1
		If HasMagicEffect MorphineEffect == 0
			If GetActorValue Health <= 0.60
				If GetItemCount Morphine > 0
					CastImmediateOnSelf Morphine
					RemoveItem Morphine 1
				EndIf
			EndIf
		EndIf
	EndIf

;******* Use Food When Not In Combat To Restore Health *******
If (GetPlayerTeammate == 1)
	If HasMagicEffect RestoreHealth == 0 && DoOnce == 0
		If GetHealthPercentage < 1.00
			If GetItemCount Apple > 0 
				CastImmediateOnSelf Apple
				RemoveItem Apple 1
EndIf

ElseIf GetItemCount BlamcoMacandCheese > 0
	CastImmediateOnSelf BlamcoMacandCheese
	RemoveItem BlamcoMacandCheese 1
EndIf

ElseIf GetItemcount BrahminSteak > 0
	CastImmediateOnSelf BrahminSteak
	RemoveItem BrahminSteak 1
EndIf

ElseIf GetItemCount Carrot > 0
	CastImmediateOnSelf Carrot
	RemoveItem Carrot 1
EndIf

ElseIf GetItemCount Cram > 0
	CastImmediateOnSelf Cram
	RemoveItem Cram 1
EndIF

ElseIf GetItemCount DandyBoyApples > 0
	CastImmediateOnSelf DandyBoyApples
	RemoveItem DandyBoyApples 1
EndIf

ElseIf GetItemCount FancyLadsSnackCakes > 0
	CastImmediateOnSelf FancyLadsSnackCakes
	RemoveItem FancyLadsSnackCakes 1
EndIf

ElseIf GetItemCount IguanaBits > 0
	CastImmediateOnSelf IguanaBits
	RemoveItem IguanaBits 1
EndIf

ElseIf GetItemCount IguanaOnAStick > 0
	CastImmediateOnSelf IguanaOnAStick 
	RemoveItem IguanaOnAStick 1
EndIf

ElseIf GetItemCount InstaMash > 0
	CastImmediateOnSelf InstaMash
	RemoveItem InstaMash 1
EndIf

ElseIf GetItemCount JunkFood > 0
	CastImmediateOnSelf JunkFood
	RemoveItem JunkFood 1
EndIf

ElseIf GetItemCount MirelurkCakes > 0
	CastImmediateOnSelf MirelurkCakes
	RemoveItem MirelurkCakes 1
EndIf
ElseIf GetItemCount Mutfruit1 > 0
	CastImmediateOnSelf Mutfruit1
	RemoveItem Mutfruit1 1
EndIf

ElseIf GetItemCount Mutfruit2 > 0
CastImmediateOnSelf Mutfruit2
RemoveItem Mutfruit2 1
EndIf
ElseIf GetItemCount Noodles > 0
CastImmediateOnSelf Noodles
RemoveItem Noodles 1
EndIf
ElseIf GetItemCount Pear > 0
CastImmediateOnSelf Pear
RemoveItem Pear 1
EndIf
ElseIf GetItemCount NukaCola > 0
CastImmediateOnSelf NukaCola
RemoveItem NukaCola 1
AddItem Caps001 1
EndIf
ElseIf GetItemCount MS05IceNukaCola > 0
CastImmediateOnSelf MS05IceNukaCola
RemoveItem MS05IceNukaCola 1
AddItem Caps001 1
EndIf
ElseIf GetItemCount PorkNBeans > 0
CastImmediateOnSelf PorkNBeans
RemoveItem PorkNBeans 1
EndIf
ElseIf GetItemCount Potato > 0
CastImmediateOnSelf Potato
RemoveItem Potato 1
EndIf
ElseIf GetItemCount PotatoCrisps > 0
CastImmediateOnSelf PotatoCrisps
RemoveItem PotatoCrisps 1
EndIf
ElseIf GetItemCount SalisburySteak > 0
CastImmediateOnSelf SalisburySteak
RemoveItem SalisburySteak 1
EndIf
ElseIf GetItemCount StrangeMeatPie > 0
CastImmediateOnSelf StrangeMeatPie
RemoveItem StrangeMeatPie 1
EndIf
ElseIf GetItemCount SquirrelBits > 0
CastImmediateOnSelf SquirrelBits
RemoveItem SquirrelBits 1
EndIf
ElseIf GetItemCount SquirrelOnAStick > 0
CastImmediateOnSelf SquirrelOnAStick
RemoveItem SquirrelOnAStick 1
EndIf
ElseIf GetItemCount SquirrelStew > 0
CastImmediateOnSelf SquirrelStew
RemoveItem SquirrelStew 1
EndIf
ElseIf GetItemCount SugarBombs01 > 0
CastImmediateOnSelf SugarBombs01
RemoveItem SugarBombs01 1
EndIf
ElseIf GetItemCount WaterPurified > 0
CastImmediateOnSelf WaterPurified
RemoveItem WaterPurified 1
EndIf
ElseIf GetItemCount WaterUnpurified > 0
CastImmediateOnSelf WaterUnpurified
RemoveItem WaterUnpurified 1
EndIf
ElseIf GetItemCount YumYumDeviledEggs > 0
CastImmediateOnSelf YumYumDeviledEggs
RemoveItem YumYumDeviledEggs 1
EndIf
ElseIf GetItemCount AntMeat > 0 
CastImmediateOnSelf AntMeat
RemoveItem AntMeat 1
EndIf
ElseIf GetItemCount BloatflyMeat > 0 
CastImmediateOnSelf BloatflyMeat
RemoveItem BloatflyMeat 1
EndIf
ElseIf GetItemCount BrahminSteak > 0 
CastImmediateOnSelf BrahminSteak
RemoveItem BrahminSteak 1
EndIf
ElseIf GetItemCount DogMeat > 0 
CastImmediateOnSelf DogMeat
RemoveItem DogMeat 1
EndIf
ElseIf GetItemCount HumanFlesh > 0 
CastImmediateOnSelf HumanFlesh
RemoveItem HumanFlesh 1
EndIf
ElseIf GetItemCount MirelurkMeat > 0 
CastImmediateOnSelf MirelurkMeat
RemoveItem MirelurkMeat 1
EndIf
ElseIf GetItemCount MirelurkMeatHatchling > 0 
CastImmediateOnSelf MirelurkMeatHatchling
RemoveItem MirelurkMeatHatchling 1
EndIf
ElseIf GetItemCount MirelurkMeatSoftshell > 0 
CastImmediateOnSelf MirelurkMeatSoftshell
RemoveItem MirelurkMeatSoftshell 1
EndIf
ElseIf GetItemCount MoleRatMeat > 0 
CastImmediateOnSelf MoleRatMeat
RemoveItem MoleRatMeat 1
EndIf
ElseIf GetItemCount MoleRatWonderMeat > 0 
CastImmediateOnSelf MoleRatWonderMeat
RemoveItem MoleRatWonderMeat 1
EndIf
ElseIf GetItemCount MS05NukalurkMeat > 0 
CastImmediateOnSelf MS05NukalurkMeat
RemoveItem MS05NukalurkMeat 1
EndIf
ElseIf GetItemCount RadroachMeat > 0 
CastImmediateOnSelf RadroachMeat
RemoveItem RadroachMeat 1
EndIf
ElseIf GetItemCount StrangeMeat > 0 
CastImmediateOnSelf StrangeMeat
RemoveItem StrangeMeat 1
EndIf
ElseIf GetItemCount YaoGuaiMeat > 0 
CastImmediateOnSelf YaoGuaiMeat
RemoveItem YaoGuaiMeat 1
EndIf
EndIf
EndIf
EndIf

END

BEGIN MenuMode 1012

;***** Heal When Sleeping *****
If (GetPlayerTeammate == 1)
	If ( IsTimePassing == 1 )
		ResetHealth
		RestoreAv PerceptionCondition 100
		RestoreAv EnduranceCondition 100
		RestoreAv LeftAttackCondition 100
		RestoreAv LeftMobilityCondition 100
		RestoreAv RightAttackCondition 100
		RestoreAv RightMobilityCondition 100
		ShowMessage JessiMessageRestHeal
	EndIf
EndIf

END


;************ Combat Ends *************

Begin OnCombatEND
;__________________________

;Message User if Jessi Health is Critical!
	If ( JessiHealPercent == 0 && GetHealthPercentage <= 0.20 && JessiHired == 1 )
		ShowMessage JessiHealthCritical01
	EndIf
;__________________________

;Message User if Jessi has no Stimpaks left
	If ( JessiHealPercent == 1 && GetHealthPercentage <= 0.30 && GetItemCount Stimpak < 2 && JessiHired == 1 )
		ShowMessage JessiNoStimpaks
	EndIF

; ********** Heals Jessi after Combat ************
;If (GetPlayerTeammate == 1)
;	If HasMagicEffect RestoreHealthStimpak == 0
	;	If GetActorValue Health <= 0.70
		;	If GetItemCount Stimpak > 0
	;			CastImmediateOnSelf Stimpak
		;		PlayIdle AnimStempax
	;			RemoveItem Stimpak 1
	;		EndIf
	;	EndIf
	;EndIf
;EndIf

END

;__________________________

BEGIN OnDeath
;Show Death message when she dies.
	if ( JessiHired == 1  )
		set JessiHired to 0
		ShowMessage FollowerMessageDeadJessi
	endif
END

 

 

 

Ofc half of this is not needed for a basic companion.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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