Dbrock1980 Posted February 5, 2016 Share Posted February 5, 2016 Hi folks, In my house mod i have a lever that turns on water and id like to make an ai package where the npc that tends the garden will turn it on then turn it off. What template do i need to look at for them to activate it like this? Link to comment Share on other sites More sharing options...
GrandBulwark Posted February 5, 2016 Share Posted February 5, 2016 (edited) Hmmm maybe look at the bandit in bleak falls burrow who pulls the trap lever, though that may be a scripted interaction. Edited February 5, 2016 by GrandBulwark Link to comment Share on other sites More sharing options...
NorthHare Posted February 6, 2016 Share Posted February 6, 2016 There is an activate package procedure or you could use a script fragment to make your NPC activate the lever at the beginning/end of any package. Link to comment Share on other sites More sharing options...
Dbrock1980 Posted February 6, 2016 Author Share Posted February 6, 2016 There is an activate package procedure or you could use a script fragment to make your NPC activate the lever at the beginning/end of any package. Unfortunately I'm not sure how to use script fragments or what it needs to look like. Not very good at scripting Link to comment Share on other sites More sharing options...
NorthHare Posted February 7, 2016 Share Posted February 7, 2016 If the Activate procedure doesn't work as intended, adding a script fragment is pretty simple. Assuming that your package ended with your NPC in the right place (i.e. next to the lever), you would:Open the Begin/End/Change tab on your package Type a semicolon in the text box under On End Click Compile to create a new script Replace the semicolon with something like WaterLever.Activate(akActor) ; Turn the water on Utility.Wait(3.0) ; Wait 3 seconds WaterLever.Activate(akActor) ; Turn the water off Click Compile again Select your new script in Attached Scripts and click Properties (I can't remember if you need to close the package and then reopen it to make Properties selectable) Set the WaterLever property to your lever reference. Link to comment Share on other sites More sharing options...
Dbrock1980 Posted February 7, 2016 Author Share Posted February 7, 2016 If the Activate procedure doesn't work as intended, adding a script fragment is pretty simple. Assuming that your package ended with your NPC in the right place (i.e. next to the lever), you would:Open the Begin/End/Change tab on your packageType a semicolon in the text box under On EndClick Compile to create a new scriptReplace the semicolon with something like WaterLever.Activate(akActor) ; Turn the water on Utility.Wait(3.0) ; Wait 3 seconds WaterLever.Activate(akActor) ; Turn the water offClick Compile againSelect your new script in Attached Scripts and click Properties (I can't remember if you need to close the package and then reopen it to make Properties selectable)Set the WaterLever property to your lever reference. Awesome! Thanks so much! I was able to get it with the activate package. I just made two (one for on and one for off) a few mins apart and a .25 duration. I've tested it once and it seemed to work. I'll check it again and if nothing happens I'll definitely do this. Fantastic! Link to comment Share on other sites More sharing options...
Recommended Posts