Jump to content

Requesting a script please.


TrueSaiko

Recommended Posts

so. i edited fee510's realistic portable tent... i furnished it the way i want... and it has inspired me. i now have an urge to make it even better... so if there happens to be anybody out there who knows how to script, and would not mind helping me with a couple items, i would greatly appreciate it.

 

first item is a "still" .... capable of distilling water, much like in the original portable tent, but... different.

 

holds ten charges. options to drink, fill bottles, or distill water.

 

if you drink, it acts as normal water (hp 2 and reduce thirst) and takes away a "charge"

 

filling bottles will take away one charge per bottle, and swap empty soda, sarsparilla, or nuka-cola bottles for purified water.

 

distill water will take dirty water from inventory, take some time, and then charge the still with one charge per bottle.

 

takes 2 hours per bottle you are distilling.

 

different than the original because there is no "auto" option, shorter distill time, more base charges, and i would like it to start off empty.

 

appreciation and thanks in advance for anybody willing to help...

 

more requests as i have them in this thread... if i get help on first request.

Link to comment
Share on other sites

Mmm, I started on this, then I realized I was looking at two days or so of work (Not 48 hours, but two days worth of time spent modding).

 

I'll give you a hint though.

 

Start by making a message form. You need to add buttons for Drink, etc.

 

The script itself should look something like this:

 

scn DummyModStillScript

short sCharges
short sMyButton
short sDistilling
float fDistillStartTime
float fTime


begin onActivate

ShowMessage DummyStillMessage

end

begin GameMode

if sDistilling > 0
	Set fTime to GameDaysPassed
	if fTime >= (fDistillStartTime + 0.042)
		Set sCharges to sCharges + 1
		Set sDistilling to sDistilling - 1
		if sDistilling > 0
			Set fDistillStartTime to fDistillStartTime + 0.42
		else
			Set fDistillStartTime to -1
		endIf
	endIf
endIf

end

begin MenuMode 1001

Set sMyButton to GetButtonPressed

if (sMyButton == 0) ;Add a DistillingCharge
	player.removeItem WaterUnpurified 1
	if fDistillStartTime == -1
		Set fDistillStartTime to GameDaysPassed
	endIf
	Set sDistilling to sDistilling + 1
elseIf (sMyButton == 1) ;Take a Drink
	if sCharges > 0
		player.castimmediateonself WaterHeal1Purified
		Set sCharges to sCharges - 1
	endIf
elseIf (sMyButton == 2) ;Get Purified Water
	if sCharges > 0
		player.additem waterpurified 1
		player.removeitem Bottle 1 ;obviously you need to specify which bottle.
		Set sCharges to sCharges - 1
	endIf
endIf

end

 

Obviously you'll need some way to check for empty bottles, dirty water, etc in the player's inventory.

 

But that should give you a template to work from, most of the important logic is in there. Good Luck

Link to comment
Share on other sites

Mmm, I started on this, then I realized I was looking at two days or so of work (Not 48 hours, but two days worth of time spent modding).

 

I'll give you a hint though.

 

Start by making a message form. You need to add buttons for Drink, etc.

 

The script itself should look something like this:

 

scn DummyModStillScript

short sCharges
short sMyButton
short sDistilling
float fDistillStartTime
float fTime


begin onActivate

ShowMessage DummyStillMessage

end

begin GameMode

if sDistilling > 0
	Set fTime to GameDaysPassed
	if fTime >= (fDistillStartTime + 0.042)
		Set sCharges to sCharges + 1
		Set sDistilling to sDistilling - 1
		if sDistilling > 0
			Set fDistillStartTime to fDistillStartTime + 0.42
		else
			Set fDistillStartTime to -1
		endIf
	endIf
endIf

end

begin MenuMode 1001

Set sMyButton to GetButtonPressed

if (sMyButton == 0) ;Add a DistillingCharge
	player.removeItem WaterUnpurified 1
	if fDistillStartTime == -1
		Set fDistillStartTime to GameDaysPassed
	endIf
	Set sDistilling to sDistilling + 1
elseIf (sMyButton == 1) ;Take a Drink
	if sCharges > 0
		player.castimmediateonself WaterHeal1Purified
		Set sCharges to sCharges - 1
	endIf
elseIf (sMyButton == 2) ;Get Purified Water
	if sCharges > 0
		player.additem waterpurified 1
		player.removeitem Bottle 1 ;obviously you need to specify which bottle.
		Set sCharges to sCharges - 1
	endIf
endIf

end

 

Obviously you'll need some way to check for empty bottles, dirty water, etc in the player's inventory.

 

But that should give you a template to work from, most of the important logic is in there. Good Luck

 

thanks for the help.... i will read through and fiddle a bit.... my scripting knowledge is likely a 1 or 0.5 on a scale of ten.... but i truly appreciate the help nonetheless... i shall see if i can learn enough to make that work.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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