Jump to content

Script not working


Deleted81892User

Recommended Posts

i am having trouble with how to do a script, theoretically it should make a vampire player get weak when outside between 6am and 8pm, but i don't know what is wrong with it. any help will be appreciated.

here is my (terrible) non-functional script ;

 

 

scn VTWEAKvampdayweakscript

 

begin gamemode

 

If ( PCVampire >= 1 ) && ( player.isininterior == 0 ) && ( GameHour >= 6 ) && ( Gamehour < 20 )

Player.AddSpell VTWEAKvampdayweakness

ElseIf ( GameHour >= 20 ) || ( GameHour < 6 )

Player.removeSpell VTWEAKvampdayweakness

ElseIf ( player.isininterior == 1 )

Player.removeSpell VTWEAKvampdayweakness

endif

 

end

Link to comment
Share on other sites

This would be the same version, but a bit cleaner:

scn VTWEAKvampdayweakscript

Begin Gamemode
If PCVampire < 1
return
ElseIf PCVampire >= 1
if player.IsInInterior == 0
	if GameHour >= 20
		Player.removeSpell VTWEAKvampdayweakness
	elseif GameHour < 6
		Player.removeSpell VTWEAKvampdayweakness
	else
		Player.AddSpell VTWEAKvampdayweakness 
	endif
elseif player.IsInInterior == 1
	Player.removeSpell VTWEAKvampdayweakness 
endif
endif
End

 

This one ensures it'll not get removed/added while it's already done:

scn VTWEAKvampdayweakscript

short cleared

Begin Gamemode
If PCVampire < 1
return
ElseIf PCVampire >= 1
if player.IsInInterior == 0
	if GameHour >= 20
		if cleared == 1
			Player.removeSpell VTWEAKvampdayweakness
			set cleared to 
		endif
	elseif GameHour < 6
		if cleared == 1
			Player.removeSpell VTWEAKvampdayweakness
			set cleared to 0
		endif
	else
		if cleared == 0
			Player.AddSpell VTWEAKvampdayweakness 
			set cleared to 1
		endif
	endif
elseif player.IsInInterior == 1
	if cleared == 1
		Player.removeSpell VTWEAKvampdayweakness 
		set cleared to 0
	endif
endif
endif
End

Link to comment
Share on other sites

thanks, ill try out those scripts :)

 

EDIT: well, assuming those scripts work, i cant get either to activate, i tried them as script types object/quest/magic effect, none worked. it must be someting else i am doing wrong. i am just reloading a savegame to try it out, and some other scripts i added work fine.

the spell added is an ability that does weakness to poison and damage fatigue. it had burden on but removing that changed nothing.

 

what could possibly make the script not activate? im baffled

Link to comment
Share on other sites

Installing the latest patch?

 

I just saw that I totally forgot the Vampire-part btw..Fixed that one.

 

-Quest need to have Start-Game-Enabled Checked.

-Magic effects would require all to be put into an ability and set in the ScriptEfffectUpdate block.

-Objects wouldn't need anything else...

 

I can't check it out now, I'll tomorrow.

Link to comment
Share on other sites

aha, got it to work, i just tacked your first fixed script to the end of vampirescript (im using the UOP fixed one) takes about 7 seconds to get applied or removed, but it would take a vamp a bit to warm up anyhow :)

 

wierd the script doesn't work on its own. i do have the latest official patch- 120416 and the unofficial- 3.2.0 and MMM, OOO. my mod is loaded last.

 

thanks anyway :thanks:

 

 

EDIT: ...after some more testing it seems that actually the effect is not being updated properly, going outdoors may apply it or not, until opening and closing the journal which sorts it. going back indoors is a similar thing. i tried out the other script, which does the exact same wierdness.... aagh

Link to comment
Share on other sites

  • Recently Browsing   0 members

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