Sarteka Posted January 19, 2009 Share Posted January 19, 2009 I'm working on a small modding project, and I am in need of a piece of a script to remove a certain item from inventory every 10 seconds while a certain condition is met. What time related script functions are in the engine? I have not seen any on the Bethesda websites. (I would most likely also need a "goto" command so it repeats) If your curious about the mod you'll just have to wait until I release it :biggrin: Any assistance would be nice Link to comment Share on other sites More sharing options...
Pelinor Posted January 19, 2009 Share Posted January 19, 2009 GetSecondsPassed would probably be what you want to use for counting time. You'd set it up like... if timer > 0set timer to timer - GetSecondsPassedelseif player.GetItemCount [your item] > 0 && [other condition] == 1player.RemoveItem [your item] 1set timer to 10endif You can work the other condition in a few different ways, so that's just a rough example. You should probably start with the other condition, then let the timer run. Link to comment Share on other sites More sharing options...
steph87 Posted January 19, 2009 Share Posted January 19, 2009 You can also create a quest, and connect it to the script that removes the item.The quest would be "Start Game Enabled" (runs when a game loads), delay 10 sec, priority 60 or more (this priority is standard ). You can put the condition either in the script or on the quest(*). NOTE: If the script is connected to abilities or perks the timer way is probably better. * I usually prefer the script Link to comment Share on other sites More sharing options...
Sarteka Posted January 19, 2009 Author Share Posted January 19, 2009 Its gonna be on an equip able item. And the script will be running while its equipped. Pelinor's way would be the way i would need to use, but its a little unclear what are functions and what are variables in his explanation Link to comment Share on other sites More sharing options...
steph87 Posted January 19, 2009 Share Posted January 19, 2009 It should be something like this: ScriptName myItemScript short timer Begin OnEquip Player set timer to 10 //reset timer on equip End Begin OnUnequip //whatever End Begin GameMode If Player.GetEquipped myItem == 1 //double check to run only when the item is equipped if timer > 0 set timer to timer - GetSecondsPassed //decrease timer each time the script runs // should be around 2s //when the timer runs out do the following lines: elseif player.GetItemCount [item to remove] > 0 && [other condition] == 1 player.RemoveItem [item to remove] 1 set timer to 10 //reset timer EndIf EndIf End note: This one might have minor compile errors, I wrote it in notepad. Link to comment Share on other sites More sharing options...
Sarteka Posted January 19, 2009 Author Share Posted January 19, 2009 Thank you very much for the scripting help. I messed around with the above script to make it work for me. If you want to check out the mod go here http://fallout3nexus.com/downloads/file.php?id=3165 Link to comment Share on other sites More sharing options...
steph87 Posted January 20, 2009 Share Posted January 20, 2009 Thank you very much for the scripting help. I messed around with the above script to make it work for me. If you want to check out the mod go here http://fallout3nexus.com/downloads/file.php?id=3165cool! I'll try it out later. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.