Jump to content

Mod in progress: Atmospheric Water Condenser


FrankManic

Recommended Posts

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

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

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

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...