Need help with a basic script (Windmill Script)

Post » Thu Jun 26, 2014 1:11 am

Hello there, Sami here. So im currently working on a mod that allows the dragonborn to build they're own farm via crafting bench. So what im trying to do is make a mill that when you approach it and click on it via activator, it will use a script that checks the players inventory for wheat, add's the same amount of flour as wheat found, then removes wheat. Its that simple, however, im a complete scrub at coding. I have tried hours upon hours on the CK wiki trying to work this out just for the life of me i cant. Any help? (I will give credit to everyone who helped in mods release)

User avatar
Nick Tyler
 
Posts: 3437
Joined: Thu Aug 30, 2007 8:57 am

Post » Wed Jun 25, 2014 12:07 pm

Ingredient Property Flour auto ; Flour is an ingredient, right?Ingredient Property Wheat auto ; wheat is an ingredient, right?int WheatAmount = 0Event OnActivate((ObjectReference akActionRef)If akActionRef == Game.GetPlayer() ; only the player can activate this script  WheatAmount = akActionRef.GetItemCount(Wheat)  utility.wait(0.1) ; to make sure WheatAmount has been counted before doing the next step  akActionRef.RemoveItem(Wheat, WheatAmount)  akActionRef.AddItem(Flour, WheatAmount)endifEndEvent

Try the above.

User avatar
victoria johnstone
 
Posts: 3424
Joined: Sat Oct 14, 2006 9:56 am

Post » Wed Jun 25, 2014 2:27 pm

Everything works fine except the flour property is wrong. It's not an ingredient, and i have tried so many other things but for the life of me i cannot find "BYOHFoodFlour"

User avatar
Ilona Neumann
 
Posts: 3308
Joined: Sat Aug 19, 2006 3:30 am


Return to V - Skyrim