Jump to content

Custom Companion Script


RBRoAB

Recommended Posts

Yeah that was my bad. Problem is though, I don't think it has anything to do with scripts. Maybe it does though.

 

Here's his quest script. He talks when he is down to half health, quarter health, but even after recovering, he still won't shut up.

Also, there are topics for things like "OnFire" and "KnockedDown" but he never says them.

scn ProtectronQuestScript

short bProtectronHireable
short bProtectronDoOnce

Begin GameMode
    if (bProtectronDoOnce != 1)
         Set bProtectronHireable to 1
         Set bProtectronDoOnce to 1
    EndIf
End

Link to comment
Share on other sites

I ran into that issue with my Wendy Gilbert mod. It's supposed to only be said during combat but she was saying it afterward if her health was low. Not sure why it would be said with full health, but I put a condition on the healthHalf and heathquarter infos:

subject, IsInCombat == 1

and the problem went away.

Link to comment
Share on other sites

Alright, I can manage that.

 

Anyone have an answer for the "OnFire" "KnockedBack" and "KnockedOut" topics being said?

 

AND I have a script that tells my companion to move behind the player if he gets too far behind, but that doesn't work while waiting. If I tell him to wait, he still teleports to me when I get to faraway, but he will stand still.

 

scn ProtectronScript

short HasBeenHired
short L38
short DoOnce

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

float fPlayerAng
float fX
float fY

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 DoOnce to 1
EndIf

If GetDead == 0 && GetUnconscious == 0
       if ProtectronREF.getdistance player > 3000
               Set fPlayerAng to player.getAngle X
               Set fX to -128 * (sin fPlayerAng)
               Set fY to -128 * (cos fPLayerAng)
               ProtectronREF.Moveto player fX fY 32 ;A height boost in case the player's moving downhill.
               ProtectronREF.SetAngle X fPlayerAng
       endif
Endif

End

 

I have the tabs in all the right places, unfortunately, this message system isn't a fan of the tab button...but whoever reads this I'm sure will understand script.

Link to comment
Share on other sites

Also, if those infos still give you problems, you can add the condition:

Subject - GetHealthPercentage < 0.50

Subject - GetHealthPercentage < 0.25

 

Not sure what those other topics trigger on. Haven't used them.

 

On the teleport section, You have to check the waiting variable

Also, use GetKnockedState to check if it's been knocked unconscious.

 

 

scn ProtectronScript

short HasBeenHired
short L38
short DoOnce

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

float fPlayerAng
float fX
float fY

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 DoOnce to 1
EndIf

If GetDead == 0 && GetKnockedState == 0 && Waiting == 0
	if ProtectronREF.getdistance player > 3000
		Set fPlayerAng to player.getAngle X
		Set fX to -128 * (sin fPlayerAng)
		Set fY to -128 * (cos fPLayerAng)
		ProtectronREF.Moveto player fX fY 32 ;A height boost in case the player's moving downhill.
		ProtectronREF.SetAngle X fPlayerAng
	endif
Endif

End

Link to comment
Share on other sites

  • Recently Browsing   0 members

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