Jump to content

Recommended Posts

Posted (edited)

I think I managed to do what I wanted, but I've yet to test it. Here's the script:

scn 01DraconianScales

begin gamemode
	
	if Player.GetRace == Draconian
		Player.AddSpell AbRaceDraconianShield
	endif

	if Player.GetArmorType == 0
		Player.RemoveSpell AbRaceDraconianShield
	endif

	if Player.GetArmortype == 1
		Player.RemoveSpell AbRaceDraconianShield
	endif
end
Edited by lordbevan1
Posted

 

I think I managed to do what I wanted, but I've yet to test it. Here's the script:

scn 01DraconianScales

begin gamemode
	
	if Player.GetRace == Draconian
		Player.AddSpell AbRaceDraconianShield
	endif

	if Player.GetArmorType == 0
		Player.RemoveSpell AbRaceDraconianShield
	endif

	if Player.GetArmortype == 1
		Player.RemoveSpell AbRaceDraconianShield
	endif
end

Glad for you if it works but always start your editor ID's and script names with letters, otherwise your game will be unstable.

Posted (edited)

It didn't work, also thanks for the tip.


EDIT: I think I realized why it didn't work. If it works, I might post my race mod on the nexus

Edited by lordbevan1
Posted

GetArmorType cannot be called on an actor. It needs to be called on a wearable item, preferably an armor, to work.

 

I for one would likely use GetArmorRating rather than running a loop through all items the actor wears via GetEquippedItems and check their armor type then sum it up. But depending on the actual intention the latter might as well be the only feasible way.

  • 3 weeks later...
Posted

Does wearing a shield or not make a problem? Because GetArmorRating sounds like the perfect tool for the job, "but" it will also return a value > 0 when wearing only a shield and a 1-hand weapon.

 

Otherwise, yes, looping through all GetEquippedItems and checking the armor type of each via GetArmorType, provided it's not a weapon or similar, would be the other option. At the end of the loop you'll know if you wear any armor or not, and shields can be excluded.

 

I can provide an example script for the loop, too, if you need it.

Posted

Yes, I know. Sorry, if I expressed myself poorly.

 

I was asking whether in detecting if you're wearing armor holding a shield should count as wearing armor or not, too, because that's how the most simple solution, the GetArmorRating function works. It returns values > 0 when you're not wearing any armor but holding a shield and have your 1-hand weapon out. If that's no problem in your detection and the shield spell should only apply while not wearing any armor "or" shield, then go for GetArmorRating first. It will return "0" when neither is the case, and your shield spell can apply.

  • 4 weeks later...
Posted (edited)

I'm looking for something that'll ignore the shield. Still, this'd be good for testing if the script syntax works. I would also like that example script, thank you.

Edited by lordbevan1
  • Recently Browsing   0 members

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