Jump to content

Any way to determine how many companions the player has?


Danneyo

Recommended Posts

So, currently, i'm working on a Bounty Hunter mod based out of a terminal with a payout determined by how many companions the player has. (More companions = less payout). I know JIPP does something like this with their companion controls, but I don't want to have to use NVSE if it's not required. Is there any way to do this with the game's base scripting?

Link to comment
Share on other sites

I don't pretend to know all the functions even in the vanilla game, but I don't think you can do what you want without NVSE, and even then I think you will need the "JIP LN NVSE" plugin. A look through the "JIP Functions" category list turns up "GetFollowers". Such don't get developed unless there is a need.

 

Otherwise you would have to check every "GetDetected" Actor individually (JIP function "GetDetectedActors" returns an array of such), and determine if they are a member of the "PlayerFaction" using "GetFactionRank".

 

Trying to avoid use of NVSE is (IMHO) a waste of time and effort. There are so many popular mods the require NVSE, and no real reason to avoid it, that you are going to be hard pressed to find anyone who doesn't have it installed. And the "Script Extenders" for ALL the Bethesda games grew out of the need for functionality that the developers just never got around to providing. Creating a mod is hard enough. Cutting yourself off from the tools that make it easier is just masochism. But that's my opinion (shared by most mod creators here).

 

-Dubious-

Link to comment
Share on other sites

I don't pretend to know all the functions even in the vanilla game, but I don't think you can do what you want without NVSE, and even then I think you will need the "JIP LN NVSE" plugin. A look through the "JIP Functions" category list turns up "GetFollowers". Such don't get developed unless there is a need.

 

Otherwise you would have to check every "GetDetected" Actor individually (JIP function "GetDetectedActors" returns an array of such), and determine if they are a member of the "PlayerFaction" using "GetFactionRank".

 

Trying to avoid use of NVSE is (IMHO) a waste of time and effort. There are so many popular mods the require NVSE, and no real reason to avoid it, that you are going to be hard pressed to find anyone who doesn't have it installed. And the "Script Extenders" for ALL the Bethesda games grew out of the need for functionality that the developers just never got around to providing. Creating a mod is hard enough. Cutting yourself off from the tools that make it easier is just masochism. But that's my opinion (shared by most mod creators here).

 

-Dubious-

 

Hmm. Alright then. I guess there's no real harm in utilizing NVSE. And if it's the easiest, and most reliable, way to do what I'm looking for, then I guess that's what i'll be attempting. Thanks for bringing this to my attention.

Link to comment
Share on other sites

GetFollowers returns any actors following the calling reference for whatever reason, not just teammates, or not necessarily teammates if they are doing anything else than following you. If you want an array of the actors that are actual teammates of the player, you can use GetTeammates. If you only need the number of them, GetPlayerTeammateCount can suffice.

Link to comment
Share on other sites

GetFollowers returns any actors following the calling reference for whatever reason, not just teammates, or not necessarily teammates if they are doing anything else than following you. If you want an array of the actors that are actual teammates of the player, you can use GetTeammates. If you only need the number of them, GetPlayerTeammateCount can suffice.

 

Alright, then I think I'll use GetFollowers, since I want the script to take into account anyone that could have helped the player beat the boss including modded companions and "simple" companions.

Edited by Danneyo
Link to comment
Share on other sites

Welp, this code is really buttering my eggrolls, and not in a good way. Going through the documentation, this should set the number of people in the player's party to a variable in the main quest script by getting an array of everyone following the player, getting the size of the array, setting that to a variable, then adding 1 to it. I'm sure the answer is super obvious, but i've been staring at this code for 2 days and I'm gonna have a stroke if I keep failing to make it work.

scn ABHMRaymondDeathScr

array_var pfollowers

begin OnDeath
	let pfollowers := Ar_Construct "array"
	let pfollowers := player.GetFollowers
	let ABHMmain.tfollowers := Ar_Size pfollowers
	let ABHMmain.tfollowers += 1
	set ABHMmain.BountyPoints to 1
	SetObjectiveCompleted ABHMmain 21 1
	SetObjectiveDisplayed ABHMmain 210 1
	ABHMBossDoor.Unlock
end
Edited by Danneyo
Link to comment
Share on other sites

I would guess you need more than a 1 frame block to pull off that checking and variable assignment.

Could have the OnDeath block collect the first info then activate an activator , to run an OnActivate script, or go for a short lived gamemode block quest script , that the OnDeath turns on.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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