Jump to content

CampFire off during daytime


Agnot2006

Recommended Posts

I am trying to create a script that will turn a fire off during the day.

So it should be disabled after 5 am and before 8pm.

This is all taken from bits I gleaned from other people’s scripts; I don’t do this often and need some help.

The fire stays on all the time at the moment.

This is my script at the moment. What did I do wrong, Can anyone help?

 

scn ArefuSwimPlaceFireScript

short FireToggle
short DoFirefirst

begin gamemode
if DoFirefirst==0
	If gamehour >= 5 && gamehour <=19
	Set FireToggle to 1
	endif
endif
	Set DoFirefirst to 1

end

begin gamemode
if gamehour >= 5 && Gamehour <= 19 && FireToggle==1
	SwimPlaceFireRef.disable
	Set FireToggle to 0
endif
If gamehour <= 5 && Gamehour >= 19 && FireToggle==0
	SwimPlaceFireRef.enable
	Set FireToggle to 1
endif

end

Link to comment
Share on other sites

It seems you have a lot of unnecessary things.

 

See if this works:

 

scn ArefuSwimPlaceFireScript

begin gamemode

If gamehour >= 5 || gamehour <=19
	disable 0
else
	enable 0
endif

end

 

There should only be one GameMode block.

 

'||' would probably work better than '&&'.

Place this script on the actual campfire.

Link to comment
Share on other sites

It seems you have a lot of unnecessary things.

 

See if this works:

 

scn ArefuSwimPlaceFireScript

begin gamemode

If gamehour >= 5 || gamehour <=19
	disable 0
else
	enable 0
endif

end

 

There should only be one GameMode block.

 

'||' would probably work better than '&&'.

Place this script on the actual campfire.

 

Thank You, I will give it a go as soon as I get home

Link to comment
Share on other sites

You definitely don't want to use "||" there - it would cause your condition to always be true so the fire would stay disabled. Try this instead:

Begin GameMode

if GetDisabled
	if GameHour < 5 || GameHour > 20
		Enable 1
	endif
elseif GameHour > 5
	if GameHour < 20
		Disable 1
	endif
endif

End

Cipscis

Link to comment
Share on other sites

You definitely don't want to use "||" there - it would cause your condition to always be true so the fire would stay disabled. Try this instead:
Begin GameMode

if GetDisabled
	if GameHour < 5 || GameHour > 20
		Enable 1
	endif
elseif GameHour > 5
	if GameHour < 20
		Disable 1
	endif
endif

End

Cipscis

 

Thank You Cipscis Once again I will give it a try once I get home.

 

Just to avoid any other possible problems

I place the script directly into the Fire barrel which I have made as unique base Object.

The Persistent Reference is ticked.

There are two other tick boxes in the reference box Turn Off Fire and Initially Disabled do I need any of these checked as well?

Link to comment
Share on other sites

No.

 

You should know that the whole object will disappear, not just the fire, so you might just want to put static barrel there and then fire with the script inside of it.

 

I’m only using the fire; the barrel is all below ground.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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