FrankManic Posted November 15, 2010 Share Posted November 15, 2010 The idea is pretty simple. I want to modify Wadsworth's water giving scripts to apply to a static object near my house in the wasteland. I'm not entirely sure how to do that, but I figure it all hinges on making a switch or button or activator or something that runs the player.giveitem.purified water command when you use it. I was hoping someone could point me at a good tutorial or something of the sort that would give me an idea where to start. I haven't done much with scripting and dialogues yet. Thanks for any help. Link to comment Share on other sites More sharing options...
FrankManic Posted November 17, 2010 Author Share Posted November 17, 2010 Woo! progress! Bow before my l337 haxx04 coding skillz! SCN FMWaterCondensorScript Begin OnActivate player player.additem WaterPurified 1 end Okay, so it's really only a hair more complicated than "Hello World", if even that. Next step is to excise bits of Wadsworths 'How much water have I given the player this week' counter so that the machine only gives the player water once every 23 hours, and displays an error message otherwise. Link to comment Share on other sites More sharing options...
FrankManic Posted November 17, 2010 Author Share Posted November 17, 2010 Here is the current state of my script. It's still giving me water, but the latter portion, which is supposed to check that a day has passed since the activator was last used, doesn't seem to be working. Could you folks kindly look this over and tell me what I may have missed or done wrong? What I was trying to do is set things up so that the script would check if FMWaterReady0 == 0. If that returned true, it was to give the player water, set FMWaterReady0 to 1, and store the GameDaysPassed as FMWaterTime0. Then, when the button is next used, I want it to check FMWaterTime0 against the current days passed and display a message if 1 day has not yet passed. Currently it just keeps giving me water. Which is cool, but not what I'm aiming for. Any help greatly appreciated. SCN FMWaterTestScript2 short FMWaterReady0 float FMWaterTime0 Begin OnActivate if IsActionRef player == 1 if (FMWaterReady0 == 1) ShowMessage X elseif (FMWaterReady0 == 0) player.additem WaterPurified 1 set FMWaterReady0 to 1 set FMWaterTime0 GameDaysPassed endif endif end Begin gamemode if (FMWaterReady0 == 1) if (GameDaysPassed - FMWaterReady0 >=1) Set FMWaterReady0 to 0 endif endif end Link to comment Share on other sites More sharing options...
LadyMilla Posted November 17, 2010 Share Posted November 17, 2010 if (GameDaysPassed - FMWaterReady0 >=1) should be if (GameDaysPassed - FMWaterTime0 >=1) And there is a typo: set FMWaterTime0 GameDaysPassed (missing 'to') Link to comment Share on other sites More sharing options...
FrankManic Posted November 18, 2010 Author Share Posted November 18, 2010 Thank you very much! I'll correct those things and give it another go! COMPLETE SUCCESS! Everything has gone better than expected. Now to get to work on the Turbo-Pupinator-9000, which fires irradiated dobermans that bite people then explode. Link to comment Share on other sites More sharing options...
Recommended Posts