Jump to content

Making Companion draw his weapon when I do?


Syeeb

Recommended Posts

This is what I have in his "Result Script (Begin)" for the Hire Dialog

 

Set mdrDeiselREF.Waiting to 0

Set mdrDeiselREF.Relax to 0

Set mdrDeiselREF.IsFollowingDefault to 1

Set mdrDeiselREF.IsFollowingLong to 0

Set mdrDeiselREF.CombatStyleRanged to 1

Set mdrDeiselREF.CombatStyleMelee to 0

Set mdrDeiselREF.HasBeenHired to 1

SetPlayerTeammate 1

SetIgnoreFriendlyHits 1

mdrDeiselREF.evp

 

Now my understanding was that the line: "SetPlayerTeammate 1" would make him draw his weapon when I do, but he won't, he will sneak when I sneak but not ready his weapon. Any idea what I am doing wrong?

Link to comment
Share on other sites

You have to use a script for this, it's not part of teammate behavior. Script is attached to the companion.

 

scn CompanionWeaponScript

 

ref me

 

Begin GameMode

 

set me to getself

 

If player.isweaponout && me.isweaponout == 0

me.setalert 1

elseif Player.isweaponout == 0 && me.isweaponout

me.setalert 0

endif

 

End

 

Probably a more efficient way to do it, but I have a bad headache and can't think straight right now.

Link to comment
Share on other sites

couldn't he just add to his companion main script?

	if ( Player.isweaponout == 1 )
			Setalert 1
	elseif ( Player.isweaponout == 0 && IsInCombat == 0 )
			Setalert 0
	endif

Link to comment
Share on other sites

Might get some strange behavior like that as it is setting alert or not alert every frame.

 

In mine you could set the "set me to getself" in an onload block but you would need to change areas the first time you load the mod to make the onload fire. It doesn't run when loading a save game, but once it runs the first time it will work from then on.

Link to comment
Share on other sites

You have to use a script for this, it's not part of teammate behavior. Script is attached to the companion.

 

scn CompanionWeaponScript

 

ref me

 

Begin GameMode

 

set me to getself

 

If player.isweaponout && me.isweaponout == 0

me.setalert 1

elseif Player.isweaponout == 0 && me.isweaponout

me.setalert 0

endif

 

End

 

Probably a more efficient way to do it, but I have a bad headache and can't think straight right now.

 

How do I attach this script to my companion? Also, do I use what you typed exactly, or do I change something in it to my companions Ref (mdrDeiselREF) ?

Link to comment
Share on other sites

I added it to my companion script seems to work

scn CKSSCRIPT


short	Hired
short	Fired
short 	HasBeenHired
short	WeaponOut
short   CombatStyleRanged
short   CombatStyleMelee
short   IsFollowingDefault
short   IsFollowingShort
short   IsFollowingLong
short FollowerSwitchAggressive                  ; 0 = Passive (wait for player), 1 = Aggressive (attack when see enemy)
short   Waiting
short JFlashlightOn
short HealPercent
short RunSpeed
short Home
short Relax
short L38
short DoOnce
short MetHawk

BEGIN GameMode

If ( GetPlayerTeammate == 1 && Waiting == 0 && IsInCombat == 0 && GetKnockedState == 0 )
	if ( GetDistance Player > 2000 )
		Evp
		MoveTo Player 75 25 5
	endif
Endif

If ( DoOnce == 0 )
	if ( GetDistance Player <= 1400 )
		set DoOnce to 1
		Evp
	endif
Endif

  if ( Player.isweaponout == 1 )
                               Setalert 1
               elseif ( Player.isweaponout == 0 && IsInCombat == 0 )
                               Setalert 0
               endif

	
END
____________________________________________________________________

Begin OnCombatEND
;_______________________________________________________
;Message User if Health is Critical!
	If ( HealPercent== 0 && GetHealthPercentage <= 0.20 && Hired == 1 )
		ShowMessage 01MessageHealthCritical
	EndIf
;_______________________________________________________
;Message User if ATH has no Stimpaks left
	If ( HealPercent == 1 && GetHealthPercentage <= 0.30 && GetItemCount Stimpak < 2 && Hired == 1 )
		ShowMessage 01MessageNoStimpaks
	EndIF



If ( GetItemCount Stimpak >=2 && GetHealthPercentage <= 0.30 && HealPercent == 1 && Hired == 1 )
		Showmessage 01FollowerMessageHeal
		PlayIdle 3rdPSpecialIdleStimpak
		ResetHealth
		restoreAV EnduranceCondition 40
		restoreAV PerceptionCondition 40
		restoreAV LeftAttackCondition 40
		restoreAV RightAttackCondition 40
		restoreAV LeftMobilityCondition 40
		restoreAV RightMobilityCondition 40
		removeitem stimpak 2
		PlayIdle 3rdPSpecialIdleStimpak
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 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 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 01MessageRestHeal
	EndIf
EndIf

END


BEGIN OnDeath
;Show Death message when they dies.
	if ( Hired == 1  )
		set Hired to 0
		ShowMessage 01FollowerMessageDead
	endif

END

Link to comment
Share on other sites

All of your responses have been very helpful. Combining all the answers has gotten me where I wanted to be for now with no obvious conflicts so hopefully its done now :) thanks everyone.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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