I'm scripting a compound splitter for my science lab mod for TES IV.
Here's my problem in a nutshell:
I made it so certain compounds needed different engine temperatures to be split. To raise the temperature, I made it so you need to bring Dark Matter to the engine. To lower the temperature, you need to bring liquid nitrogen coolant to the engine. Here's my script:
scn ScienceLabCompoundSplitterEngineref tempBegin OnActivate if player.GetItemCount ScienceLabDarkMatter== 1 player.RemoveItem ScienceLabDarkMatter 1 Message "The engine temperature has increased by 300 degrees. The previous temperature was %.0f", temp, 7 set temp to +300 endif if player.GetItemCount ScienceLabLiquidNitrogenCoolant== 1 player.RemoveItem ScienceLabLiquidNitrogenCoolant 1 Message "The engine temperature has decreased by 200 degrees. The previous temperature was %.0f", temp 7 set temp to -200 endif if player.GetItemCount ScienceLabDarkMatter== 0 && player.GetItemCount ScienceLabLiquidNitrogenCoolant== 1 MessageBox "You need to either place Dark Matter or liquid nitrogen coolant in the engine to alter the temperature." endifend
I added a barrel of Dark Matter, with the following script:
scn ScienceLabDarkMatterDispenserScriptBegin OnActivate if player.GetItemCount ScienceLabDarkMatter== 1 && player.GetItemCount ScienceLabLiquidNitrogenCoolant== 0 Messagebox "Dark Matter is too heavy to carry more than one at a time." endif if player.GetItemCount ScienceLabDarkMatter== 0 && player.GetItemCount ScienceLabLiquidNitrogenCoolant== 1 MessageBox "Holding Dark Matter and liquid nitrogen coolant at the same time caused an explosion!" player.kill endif if player.GetItemCount ScienceLabDarkMatter== 0 && player.GetItemCount ScienceLabLiquidNitrogenCoolant== 0 Message "You collect some dark matter from the barrel." 4 player.additem ScienceLabDarkMatter 1 endifend
When I tested it, I took Dark Matter out of the barrel, brought it to the engine, activated the engine, and everything worked fine. However, I went to get a second Dark Matter, but when I brought it to the engine, I activated the engine, and nothing happened! I removed the dark matter from my inventory and got some more, but the same thing happened! The same thing happens with liquid nitrogen coolant. It will work once, but not twice! I dont get it. Can somebody please help me?