Jump to content

Script not functioning


Seattleite

Recommended Posts

SCN EnduranceResistanceScript

 

ref currentactor

ref numactors

 

begin gamemode

 

set numactors to getnumrefs 200 1 0

if(numactors > 0)

set currentactor to getfirstref 200 1 0

label 10

if(currentactor)

if(currentactor.hasmagiceffect PlayerDamageResistance == 0)

currentactor.addspell PlayerDamageResistance

currentactor.addspell PlayerDamageThreshold

currentactor.addspell PlayerEnergyResistance

currentactor.addspell PlayerFireResistance

currentactor.addperk BludgeonIgnoresArmour

currentactor.addperk NaturalRegenPerk

endif

set currentactor to Pencil01

set currentactor to getnextref

set numactors to numactors - 1

if(numactors > 0)

goto 10

endif

endif

endif

 

end ; gamemode

 

EDIT: I have proper indentation, but the site just isn't showing it. I don't quite get why.

Edited by Seattleite
Link to comment
Share on other sites

If you want to post a script, use code tags and copy/paste it into the reply box to preserve the indentation.

 

[ code ]

some script

[ /code ]

 

I fixed a few things in your script. You had a ref variable used to store an integer value, and the HasMagicEffect doesn't work with effects that have no duration.

I changed those two things and posted it below:

 

 

 

ref currentactor
short numactors

begin gamemode

set numactors to getnumrefs 200 1 0
if(numactors > 0)
set currentactor to getfirstref 200 1 0
label 10
if(currentactor)
	if(currentactor.isspelltarget PlayerDamageResistance)
	else
		currentactor.addspell PlayerDamageResistance
		currentactor.addspell PlayerDamageThreshold
		currentactor.addspell PlayerEnergyResistance
		currentactor.addspell PlayerFireResistance
		currentactor.addperk BludgeonIgnoresArmour
		currentactor.addperk NaturalRegenPerk
	endif
	set currentactor to Pencil01
	set currentactor to getnextref
	set numactors to numactors - 1
	if(numactors > 0)
		goto 10
	endif
endif
endif

end ; gamemode

 

 

 

I don't know if that will make it work, but make sure that the effects you're referencing already exist in the Editor. If this is your first NVSE-functioning script, make sure that you've loaded the GECK with NVSE.

Edited by luthienanarion
Link to comment
Share on other sites

If you want to post a script, use code tags and copy/paste it into the reply box to preserve the indentation.

 

[ code ]

some script

[ /code ]

 

I fixed a few things in your script. You had a ref variable used to store an integer value, and the HasMagicEffect doesn't work with effects that have no duration.

I changed those two things and posted it below:

 

 

 

ref currentactor
short numactors

begin gamemode

set numactors to getnumrefs 200 1 0
if(numactors > 0)
set currentactor to getfirstref 200 1 0
label 10
if(currentactor)
	if(currentactor.isspelltarget PlayerDamageResistance)
	else
		currentactor.addspell PlayerDamageResistance
		currentactor.addspell PlayerDamageThreshold
		currentactor.addspell PlayerEnergyResistance
		currentactor.addspell PlayerFireResistance
		currentactor.addperk BludgeonIgnoresArmour
		currentactor.addperk NaturalRegenPerk
	endif
	set currentactor to Pencil01
	set currentactor to getnextref
	set numactors to numactors - 1
	if(numactors > 0)
		goto 10
	endif
endif
endif

end ; gamemode

 

 

 

I don't know if that will make it work, but make sure that the effects you're referencing already exist in the Editor. If this is your first NVSE-functioning script, make sure that you've loaded the GECK with NVSE.

 

The script (which is actually not my first, by the way) is working now, but it turns out my issue isn't just with it. All abilities that give creatures DR count twice for some reason. No idea why, but it's a problem.

Edited by Seattleite
Link to comment
Share on other sites

The script (which is actually not my first, by the way) is working now, but it turns out my issue isn't just with it. All abilities that give creatures DR count twice for some reason. No idea why, but it's a problem.

 

Known issue with Fallout NV and Fallout 3. An engine bug.

Link to comment
Share on other sites

AFAIK, the only fix is to halve your DR/DT for creatures. But you might be able to learn more from google.

 

Realised the moment I said it. And it's only DR that's impacted, I checked. I'm halving it right now, and putting in some new values and conditions in the endurance-based DR ability for that effect.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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