EnterSevenSeven Posted July 29, 2010 Share Posted July 29, 2010 I'm trying to make an NPC carry a torch at all times, at least until they go to sleep. I've tried looking at other NPC scripts, such as the Adoring Fan and the IC Guard Night-Shift but couldn't figure out what forces them to carry torches almost permanently. This is what I've tried so far:1) Put Torch02 in the new NPC's inventory.2) Attached a script to the NPC to force them to equip it using different methods (using EquipItem):Equip a torch when they start their Wander packageEquip a torch as long as they weren't sleeping (using GetSleeping)Equip a torch based on the value returned by IsTorchOut No matter what I tried, the NPC would still repeatedly try to equip the torch resulting in flickering. I'm sure that I'm making this a lot more complicated than it's supposed to be. Any help? Link to comment Share on other sites More sharing options...
David Brasher Posted July 30, 2010 Share Posted July 30, 2010 This is not precisely what you are after, because this character just has a bunch of wander packages taking him on patrol, but it is a script used in one of my mods: SCN AAWImperialLegionSoldierSCRIPT ; If he is patrolling a cave, he ought to have a torch. Begin Gamemode_____If GetEquipped Torch02 == 0__________EquipItem Torch02_____EndIfEnd What does your script look like? Maybe if you posted it someone would have a brilliant idea come to them. It kind of sounds like your script needs a DoOnce of some sort to let the code only execute once at a given time rather than eternally. Link to comment Share on other sites More sharing options...
EnterSevenSeven Posted July 30, 2010 Author Share Posted July 30, 2010 That was the one I tried. I also had a variation of it that would only run once, but still no luck.scn DAOwnerSCRIPT short tflag Begin GameMode___if (GetEquipped Torch02 == 0) && (tflag == 0)______EquipItem Torch02______Set tflag to 1___endifEnd This should cause the if statement to run only once, but I can still see a brief instance of where the NPC seems to reequip the already lit torch, causing a flicker. I also tried using a global variable, but still got the same problem. Link to comment Share on other sites More sharing options...
Recommended Posts