Deleted2746547User Posted May 26, 2012 Share Posted May 26, 2012 (edited) I have a mod where I have maybe 10 or so NPC's that have AI packages: they go one place to work at a certain time, and then to eat, and then to "play" and then to sleep. I have low level processing ON (so they don't get stuck in a room when I'm not in the cell????). Two quick questions - is this the best way to do it (or could it be causing crashes for some weird reason - I've run into crashes but not sure if its this script or my power/lighting one or something else). Also, what ai package/setting would you need to add to have a NPC follower mimic your combat... (when you crouch, crouch, etc.) Scripting is NOT my forte and it makes mt head hurt. Many thanks for the advice! :thumbsup: Edited May 26, 2012 by Guest Link to comment Share on other sites More sharing options...
rickerhk Posted May 26, 2012 Share Posted May 26, 2012 Purge cell buffer mods can cause crashes when AI is low level processing in another cell. Navmesh problems can also cause crashes if it's not finalized on both sides of a portal that they need to go through - in other words - if there is no navmesh path to get to their package destination.I don't think they mimic your combat unless they are set as playerteammate and in a follow package. Link to comment Share on other sites More sharing options...
Deleted2746547User Posted May 26, 2012 Author Share Posted May 26, 2012 Purge cell buffer mods can cause crashes when AI is low level processing in another cell. Navmesh problems can also cause crashes if it's not finalized on both sides of a portal that they need to go through - in other words - if there is no navmesh path to get to their package destination.I don't think they mimic your combat unless they are set as playerteammate and in a follow package. THanks so much for the response. Question, I think my navmeshing is ok and I'm not running any purge cell buffer mods... to my knowledge. What is the best way to make an NPC as a playerteammate? Right now the script just has the (4) team members (part of a mission/quest) as following. It's weird on the crashing... just started. can't figure whether its part of my power/lighting quest script or ? arghhH!!! Link to comment Share on other sites More sharing options...
rickerhk Posted May 27, 2012 Share Posted May 27, 2012 You can just do:MynpcREF.SetPlayerTeamMate 1in a dialog result script, or in a 'doOnce' section of a quest script, or thier object script. The thing is, when you do this, you will get the wheel. If you don't want that, you can just make an object script for your NPCs that force them to sneak if they are following: scn MyNpcScript BEGIN GAMEMode if (MyQuest.iMyNpcFollowPackageVariable) if (IsInCombat) if (GetForceSneak) SetForceSneak 0 endif else if (Player.IsSneaking) if (GetForceSneak) else SetForceSneak 1 endif else if (GetForceSneak) SetForceSneak 0 endif endif endif else if (GetForceSneak) SetForceSneak 0 endif endif END Post the script that you think might be crashing. Link to comment Share on other sites More sharing options...
Deleted2746547User Posted May 27, 2012 Author Share Posted May 27, 2012 MANY thanks for the reply and the script. Again, I would have never figured that out. Question - if you had (4) MEMBERS OF THE "team" would you just change the teammate ref # each script (1,2,3,4?) And def. want the wheel! Here's the (3) scripts that are tied to the lighting/power system. Right now I believe it is checking fuel supplies every 5 seconds for ALL of the light markers on). If there is a better way to do it (and check less often) - I would love the advice. It's weird - the crashes don't always happen but when they do, it seems to occur whenI'm exiting/entering tents/buildings at the NCRCF. And when they come (the crashes) it seems to follow back to back. (That is crash. restart NV, a few minutes into game crash.) But again, doesn't always happen. So I don't know if its NPC's, navmesh, the power... arghh! That was working before but now in the mod.. it seems the tank just "takes" all your batteries (b/c nothing is left in your inventory once you "activate" it.) Not sure what I'm missing... THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! POWER BASE SCRIPT {RAN AS PART OF THE BASE QUEST}---scn BlackbriarPowerBaseQuestScript int Fuel ; This is the total fuel units in stockint FuelRqd ; This is the calculated amount that will be used in a single 5 second period Begin GameModeIf FuelElsereturnEndif set FuelRqd to 0 ;Lghts1 uses 3 unit of Fuel/5secIf BlackbriarLgts1.GetDisabledElseset FuelRqd to FuelRqd + 3Endif ;Lghts2 uses 1 unit of Fuel/5secIf BlackbriarLgts2.GetDisabledElseset FuelRqd to FuelRqd + 1Endif ;Lghts3 uses 2 unit of Fuel/5secIf BlackbriarLgts3.GetDisabledElseset FuelRqd to FuelRqd + 2Endif ;Lghts4 uses 1 unit of Fuel/5secIf BlackbriarLgts4.GetDisabledElseset FuelRqd to FuelRqd + 1Endif ;Lghts5 uses 1 unit of Fuel/5secIf BlackbriarLgts5.GetDisabledElseset FuelRqd to FuelRqd + 1Endif ;Lghts6 uses 1 unit of Fuel/5secIf BlackbriarLgts6.GetDisabledElseset FuelRqd to FuelRqd + 1Endif ;Lghts7 uses 1 unit of Fuel/5secIf BlackbriarLgts7.GetDisabledElseset FuelRqd to FuelRqd + 3Endif ;Lghts8 uses 1 unit of Fuel/5secIf BlackbriarLgts8.GetDisabledElseset FuelRqd to FuelRqd + 1Endif ;Lghts9a uses 1 unit of Fuel/5secIf BlackbriarLgts9a.GetDisabledElseset FuelRqd to FuelRqd + 1Endif ;Lghts10a uses 1 unit of Fuel/5secIf BlackbriarLgts10a.GetDisabledElseset FuelRqd to FuelRqd + 1Endif ;Lghts11 uses 1 unit of Fuel/5secIf BlackbriarLgts11.GetDisabledElseset FuelRqd to FuelRqd + 1Endif ;Lghts12 uses 1 unit of Fuel/5secIf BlackbriarLgts12.GetDisabledElseset FuelRqd to FuelRqd + 1Endif ;Subtract the fuel usedset Fuel to Fuel - FuelRqd ;Turn off all power users when Fuel runs out.If Fuel < 1set Fuel to 0BlackbriarLgts1.DisableBlackbriarLgts2.DisableBlackbriarLgts3.DisableBlackbriarLgts4.DisableBlackbriarLgts5.DisableBlackbriarLgts6.DisableBlackbriarLgts7.DisableBlackbriarLgts8.DisableBlackbriarLgts9a.DisableBlackbriarLgts10a.DisableBlackbriarLgts11.DisableBlackbriarLgts12.Disable Endif End $$$$$$$$$$$$$$$$$$$$ NEXT SCRIPT$$$$$$$$$$$$$$$$$$$$$ Fuel Tank Script scn BlackbriarFuelTankBegin onActivateIf GetQuestRunning BlackbriarPowerBaseQuestElseStartQuest BlackbriarPowerBaseQuestEndif If player.GetItemCount FissionBatteryplayer.removeItem FissionBattery 1set BlackbriarPowerBaseQuest.Fuel to BlackbriarPowerBaseQuest.Fuel + 1500Else; ShowMessage BlackbriarPowerNoBatteries ; Uncomment when/if you want to display a msg.EndifEnd $$$$$$$$$$$$$$$$$$$NEXT SCRIPT$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ Power light script ScriptName BlackbriarPowerLightScript ref light Begin OnActivateif BlackbriarPowerBaseQuest.Fuel == 0returnEndifif light == 0set light to GetLinkedRefendif if light.GetDisabledlight.Enableelselight.DisableendifActivateEnd You can just do:MynpcREF.SetPlayerTeamMate 1in a dialog result script, or in a 'doOnce' section of a quest script, or thier object script. The thing is, when you do this, you will get the wheel. If you don't want that, you can just make an object script for your NPCs that force them to sneak if they are following: scn MyNpcScript BEGIN GAMEMode if (MyQuest.iMyNpcFollowPackageVariable) if (IsInCombat) if (GetForceSneak) SetForceSneak 0 endif else if (Player.IsSneaking) if (GetForceSneak) else SetForceSneak 1 endif else if (GetForceSneak) SetForceSneak 0 endif endif endif else if (GetForceSneak) SetForceSneak 0 endif endif END Post the script that you think might be crashing. Link to comment Share on other sites More sharing options...
rickerhk Posted May 27, 2012 Share Posted May 27, 2012 The only thing I can see that might possibly cause a crash is this:1. If one or more objects that you have placed in the editor does not have the 'persistent reference' box ticked.This check box guarantees that the reference will always be loaded into memory and available for your quest script. If it's not checked, your quest script may be intermittently performing a function on a null reference, which can cause a script halt or crash. If you are not using the Geck powerup, its possible that the Geck let you save a script even though one of the boxes wan't checked on a reference. http://newvegas.nexusmods.com/mods/41642 Link to comment Share on other sites More sharing options...
Deleted2746547User Posted May 27, 2012 Author Share Posted May 27, 2012 (edited) The only thing I can see that might possibly cause a crash is this:1. If one or more objects that you have placed in the editor does not have the 'persistent reference' box ticked.This check box guarantees that the reference will always be loaded into memory and available for your quest script. If it's not checked, your quest script may be intermittently performing a function on a null reference, which can cause a script halt or crash. If you are not using the Geck powerup, its possible that the Geck let you save a script even though one of the boxes wan't checked on a reference. http://newvegas.nexusmods.com/mods/41642 Would that be related to "lighting". That is, would the persistent ref. tick in this case refer to the lighting, markers, etc.? Just so I'm clear where to look. I haven't used the geck powerup but will def. check it out. If you ever get time, would love to get your feedback on the mod so far. Still a long way to go - but if you ever find time to do a little playtesting, would love feedback. THANK YOU :thumbsup: for your help! Also, on the "teammate" script - would that teammate number change for each team members script? I'm just a little confused about where I place this script and call it up. Let's say the Quest enables the team of (4) npc's to join you. where exactly would I place this. In the script that enables them? If so, how to apply it to all four. Sorry for the questions - I'm just trying to cut down on me restarting/stopping a 1,000 times trying to make something simple (for you:) to work for me! Edited May 27, 2012 by Guest Link to comment Share on other sites More sharing options...
Deleted2746547User Posted May 27, 2012 Author Share Posted May 27, 2012 By the way, just loaded up powerup.. not sure whether to thank you or find some not so nice names.... :P It gave me a ton of warnings that I didn't know to look for. Weird, no warning with the lights (?) but a handful of NPC ones (masterfile ref XXXXX to base obj. XXXNPC in cell..... should be persistent but not... Could that be it? Also, a ref attached to wrong cell for its location refr form XXXX to stat form nvnrockcanyon XXXX in cell wildenerness.. I will look and see if I moved something inadvertently... A few furniture markers not selected for items errors... A faction relations error (not set the same between factions) And a flag error with my npc teammate package... Wow... tons of things to fix.. Happy though it gives me things to look at... and maybe I now also know why NPC's weren't sitting on chairs, etc. in different buildings. And seems you were absolutely right on the persistent ref. thing. Strange though that it only happened sporadically when exiting/entering buildings. THANKS again! Link to comment Share on other sites More sharing options...
Recommended Posts