Danneyo Posted November 7, 2018 Share Posted November 7, 2018 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 More sharing options...
dubiousintent Posted November 7, 2018 Share Posted November 7, 2018 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 More sharing options...
Danneyo Posted November 7, 2018 Author Share Posted November 7, 2018 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 More sharing options...
miguick Posted November 7, 2018 Share Posted November 7, 2018 Actually there's a vanilla function for that, GetPlayerTeammateCount. Link to comment Share on other sites More sharing options...
Danneyo Posted November 7, 2018 Author Share Posted November 7, 2018 Actually there's a vanilla function for that, GetPlayerTeammateCount.I wonder how that's functionally different from the "GetFollowers" function. I mean, if it was available in the vanilla code, then why would an equivalent be programmed into LN? Link to comment Share on other sites More sharing options...
miguick Posted November 7, 2018 Share Posted November 7, 2018 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 More sharing options...
Danneyo Posted November 7, 2018 Author Share Posted November 7, 2018 (edited) 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 November 7, 2018 by Danneyo Link to comment Share on other sites More sharing options...
Danneyo Posted November 10, 2018 Author Share Posted November 10, 2018 (edited) 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 November 10, 2018 by Danneyo Link to comment Share on other sites More sharing options...
dubiousintent Posted November 10, 2018 Share Posted November 10, 2018 Nothing jumps out at me. Have you tried debug prints after each line to see if the expected values are being obtained? See 'TIP: Debugging data to file' in the "Scripting" section of the wiki "Getting started creating mods using GECK" article. -Dubious- Link to comment Share on other sites More sharing options...
Mktavish Posted November 10, 2018 Share Posted November 10, 2018 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 More sharing options...
Recommended Posts