Jump to content

Companion Firing Script Not Working?


bananakillerBRO

Recommended Posts

So, this is my second time making a companion mod. For some reason my new companion's firing script just won't work, despite everything seeming to be where it needs to be. The package conditions are in the right place, with the right variables, and the scripts match the previous companion's. I can't really pinpoint what's going wrong, can someone help?

 

I'll post his scripts to be safe.

 

Set Companion1REF.Waiting to 0
Set Companion1REF.HasBeenHired to 0
Set Companion1REF.L38 to 0
Set Companion1REF.IsFollowingDefault to 0
Set Companion1REF.IsFollowingLong to 0
Companion1REF.SetPlayerTeammate 0
Companion1REF.evp
scn Companion1Script
short HasBeenHired
short L38
short DoOnce
int CombatStyleRanged
int CombatStyleMelee
int IsFollowingDefault
int IsFollowingLong
int FollowerSwitchAggressive
int Waiting
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
End
scn Companion1QuestScript
short bCompanion1Hireable
short bCompanion1DoOnce
Begin GameMode
if (bCompanion1DoOnce != 1)
Set bCompanion1Hireable to 1
Set bCompanion1DoOnce to 1
EndIf
End

 

Link to comment
Share on other sites

Your scripts aren't exactly like the vanilla companions but that doesn't mean they're wrong. My guess is you need to double-check your packages again. You're missing some class of a Fired variable, but that doesn't necessarily mean you haven't fulfilled its function in some other way.

 

If you don't find anything wrong with the packages, try testing in-game and using the console to check your variables when they should change. SQV for quests, and SV for actors and objects.

Link to comment
Share on other sites

Your scripts aren't exactly like the vanilla companions but that doesn't mean they're wrong. My guess is you need to double-check your packages again. You're missing some class of a Fired variable, but that doesn't necessarily mean you haven't fulfilled its function in some other way.

 

If you don't find anything wrong with the packages, try testing in-game and using the console to check your variables when they should change. SQV for quests, and SV for actors and objects.

I took a few screenshots, they look fine to me. They just won't trigger. Everything look okay from your end?

 

https://imgur.com/yAKRbu5

https://imgur.com/yMA2Khz

https://imgur.com/K81vXcx

Link to comment
Share on other sites

I would need a bit more than that. Can you screenshot all his AI packages and all their conditions? May be best if you just expand the columns fully.

 

What is not working about this? He does get this dialogue, correct? He just doesn't stop following you? Does the companion wheel keep working after you say that dialogue that's meant to fire him?

 

If you mean that he doesn't get that dialogue option, then it's not the packages.

 

If he does get that dialogue option, open the console after the conversation is done, and click on him and enter SV. This will show you his script variables. Are they all what they should be after firing him?

 

Also, GetCurrentPackage is a good console command to run on him. Check the GECK for the ID of it. Remember that the first two digits are your mod index, which is different in the GECK, so you're looking to match just the rest of the number, unless the mod index is 00 or ff, indicating either a vanilla package or a dynamically generated one, respectively.

 

If you have JIP, GetCurrentStablePackage should be run as well. It may or may not return an identical ID.

Edited by EPDGaffney
Link to comment
Share on other sites

I'm just wondering about the script you posted ... this part ...

 

Set Companion1REF.Waiting to 0
Set Companion1REF.HasBeenHired to 0
Set Companion1REF.L38 to 0
Set Companion1REF.IsFollowingDefault to 0
Set Companion1REF.IsFollowingLong to 0
Companion1REF.SetPlayerTeammate 0
Companion1REF.evp
~~~~~~~~~~~~~~~
Is this seriously the start of the script ... then after is the scn ?
Link to comment
Share on other sites

bCompanion1Hireable gets set to 1 initially by the NPC's script but it's not used for the firing script. I assume this gets set to 0 when the companion gets hired? Depending on how this is used, you may want to set it back to 1 when the companion is fired.

 

What AI package is the NPC running when not hired? Do they have a non-hired AI package? You can make something like a sandbox with a condition of Companion1REF.HasBeenHired == 0.

 

A companion that doesn't have an AI package when they aren't hired will probably just stand there waiting before they are hired, but if they are fired they may end up continuing to follow the player if they can't find any other AI package to run.

 

Edit - I should have looked at the screen shots. Heh.

 

What's the 2nd condition on the Go Home AI package?

Edited by madmongo
Link to comment
Share on other sites

bCompanion1Hireable gets set to 1 initially by the NPC's script but it's not used for the firing script. I assume this gets set to 0 when the companion gets hired? Depending on how this is used, you may want to set it back to 1 when the companion is fired.

 

What AI package is the NPC running when not hired? Do they have a non-hired AI package? You can make something like a sandbox with a condition of Companion1REF.HasBeenHired == 0.

 

A companion that doesn't have an AI package when they aren't hired will probably just stand there waiting before they are hired, but if they are fired they may end up continuing to follow the player if they can't find any other AI package to run.

 

Edit - I should have looked at the screen shots. Heh.

 

What's the 2nd condition on the Go Home AI package?

This is the second package.

 

https://imgur.com/f8gXuhi

Link to comment
Share on other sites

 

I'm just wondering about the script you posted ... this part ...

 

Set Companion1REF.Waiting to 0
Set Companion1REF.HasBeenHired to 0
Set Companion1REF.L38 to 0
Set Companion1REF.IsFollowingDefault to 0
Set Companion1REF.IsFollowingLong to 0
Companion1REF.SetPlayerTeammate 0
Companion1REF.evp
~~~~~~~~~~~~~~~
Is this seriously the start of the script ... then after is the scn ?

 

I mean...it worked for Stimpak.

Link to comment
Share on other sites

Have you tried adding "AddScriptPackage <GoHome>" and an ".evp" command to the "Result Script"? While you have set the "Not Hired" conditions, you seem to be waiting for the default package evaluation interval (up to 10 seconds) to determine when to re-evaluate the packages. At that time it will work down through the list of packages until it finds the first where all the conditions are "true". More than likely that will be an idle package and never get to your "GoHome" package.

 

-Dubious-

Link to comment
Share on other sites

  • Recently Browsing   0 members

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