romeck Posted May 5, 2011 Share Posted May 5, 2011 is there a list of teammate reference ? i like to know if my companions kill creature by using iskiller function but i do not know how to obtain teammate refs or is it other way to tell if crature was killed by companion ? i could do refwalking with nvse but do not know a name or number of teammate list just like there is a list for all actor ( 200: Actor (for ref walking only) in fose docs) Link to comment Share on other sites More sharing options...
rickerhk Posted May 5, 2011 Share Posted May 5, 2011 If you are ref-walking actors, you just check:If (rActorREF.GetPlayerTeamMate == 1) ;do thingsendif Link to comment Share on other sites More sharing options...
majinshinsa Posted May 5, 2011 Share Posted May 5, 2011 what does ref walking mean? Link to comment Share on other sites More sharing options...
rickerhk Posted May 6, 2011 Share Posted May 6, 2011 what does ref walking mean? You can set up a loop to get the references for specific object types in a cell. Once you have the reference to a object, you can do pretty much anything you want with it. http://www.cipscis.com/fallout/tutorials/loops.aspx These are the types you can get references for (the ones that can be placed in the editor, of course). http://fose.silverlock.org/fose_command_doc.html#Form_Type_IDs Link to comment Share on other sites More sharing options...
romeck Posted May 8, 2011 Author Share Posted May 8, 2011 i use refwalking but walk through list of all actors is just too much i think for 1sec script that also do many other things so i thought that maybe there is a smaller list than 200 like teammates list . ( there is also 42 list of NPC which is smaller than 200 but still maybe there is something smaller than that) Link to comment Share on other sites More sharing options...
tunaisafish Posted May 9, 2011 Share Posted May 9, 2011 I've not tested, but I think the 200 will pick up the 42 (NPC's) and the CREAtures too. If you want to check a vanilla follow is found in the walk then this should work...if ref.IsInList NPCFollowersLIST I totally agree with you about not refwalking too frequently.I've been programming for 30 years now and still have it in my head that CPU cycles and RAM are precious things :) Link to comment Share on other sites More sharing options...
rickerhk Posted May 9, 2011 Share Posted May 9, 2011 You can't write a script that will have any impact at all on performance. This type of thing has been tested. Having said that, if you do something dumb in the script like spawn umpteen actors every frame or apply image mods or anything that needs to be rendered in the game world, that's different. It's AI and graphics that has the performance hits. The scripting engine runs in one thread. All scripts are run sequentially. You can do a ref walk every frame without an impact, but it really isn't required. Once every second is perfectly reasonable. The thing I would not do is go too deep in exterior cells - just the current cell and 8 surrounding cells (one cell deep). I prefer to use GetPlayerTeamMate to check for followers in a ref walk, unless you only care about specific ones. I've always had bad luck trying to use IsInList except if it's in a condition (like a perk or dialog), so I've used ListGetFormIndex instead. scn RHKBrisaTeamHealQuestScript ref rTarget short iEnableHeal BEGIN GameMode if (iEnableHeal) set rTarget to GetFirstRef 200 0 ;Actors current cell Label 10 if (rTarget) if (rTarget.GetDead) else if (rTarget.GetPlayerTeamMate) rTarget.ResetHealth endif endif set rTarget to Pencil01 set rTarget to GetNextRef Goto 10 endif set iEnableHeal to 1 StopQuest RHKBrisaTeamHeal endif END Link to comment Share on other sites More sharing options...
Recommended Posts