I'm trying to figure out how the companion system works. I've been perusing the companion and roster scripts, as well as the scripts the OC uses for handling companions, and I have a question about something.
In the mod load script, "k_mod_load" there is a line which reads AddCompanionsToRoster(). I can't find this exact function in the list. There is a function AddCompanionToRoster() (note the difference). My question is does the AddCompanionsToRoster() function automatically add all creature blueprints in the Companions category to the roster? Could I use this function for my custom companions, or would I be better off using the InitializeCompanion() function for each one?
AddCompanionsToRoster() or InitializeCompanion()
Débuté par
Jezla
, déc. 03 2011 03:16
#1
Posté 03 décembre 2011 - 03:16
#2
Posté 03 décembre 2011 - 03:51
I think it is a matter of preference - try it out either way and make a note of the difference in the way the engine handles the add companion event - or it may be a difference in how complex the whole script will end up being.
Experiment
Experiment
#3
Posté 03 décembre 2011 - 11:40
- been looking into this too.
( note that at the top of this #include there Obsidian gives a rundown of how they like the companion-system to work )
( it sets each as a "CampaignNPC" meaning they are not visible in the player's RosterList but they are in fact there )
An involved system but it seems well done and well described. (sry if I got something wrong, just learnin
AddCompanionToRoster()is in 'ginc_companion' and adds a creature-blueprint/creature-instance to the Roster, ready to be selected by player.
( note that at the top of this #include there Obsidian gives a rundown of how they like the companion-system to work )
AddCompanionsToRoster()is in 'kinc_companion' (OC Campaign #include) and iterates only the OC Companions, using AddCompanionToRoster().
( it sets each as a "CampaignNPC" meaning they are not visible in the player's RosterList but they are in fact there )
InitializeCompanion()is in 'ginc_companion' and uses AddCompanionToRoster(), then sets the "CampaignNPC" switch, and assigns a "hangout spot"
An involved system but it seems well done and well described. (sry if I got something wrong, just learnin
#4
Posté 04 décembre 2011 - 12:29
Kev, thanks that explains it. I didn't know there was a kinc_companion.





Retour en haut






