lordbevan1 Posted July 26, 2019 Author Share Posted July 26, 2019 UPDATE: It works now, but magic seems to be a bit...broken. Like the player's spells won't cast. The animation will play, but the spell won't be cast. Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted July 31, 2019 Share Posted July 31, 2019 Well, that took me quite some time to come back to here again... Let's see if I can whip something up. array_var arItems array_var arIterator short bWearsArmor ref rItem Begin GameMode ;could also be one of the spell script block types ... let arItems := player.GetEquippedItems ;could also be some other reference than player let bWearsArmor := 0 ForEach arIterator <- arItems let rItem := arIterator["value"] If rItem.IsArmor let bWearsArmor := 1 Break EndIf Loop let arItems := ar_Null ;clean up, necessary? ;here bWearsArmor is either 1 or 0 ... End Turns out my initial suggestion GetArmorType wasn't exactly the best choice for this (returning either 0 or 1 but both meaning it is an armor, thus only working on armors to begin with). IsArmor seems to be a much better fit here. That should tell you if you wear any armor "and" exclude shields. Or so I hope. Else it'd just need a check for rItem being a shield combined with a Continue to just ignore it and go on. Now, I don't know why your spells sometimes won't cast, but I also don't know your current script. I assume it's inside your recently released plugin? If so, I can grab it and take a look as soon as my free time allows for it again. Link to comment Share on other sites More sharing options...
lordbevan1 Posted August 12, 2019 Author Share Posted August 12, 2019 I think it's a conflict since I don't think anyone else has had this issue (at least not since I last checked), but I can't figure out with what Link to comment Share on other sites More sharing options...
lordbevan1 Posted January 4, 2021 Author Share Posted January 4, 2021 So everything is working as intended, except that the game isn't removing the shield effect Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted January 4, 2021 Share Posted January 4, 2021 Is it still like the first script you posted, all at once within the same game mode frame? If it's a Draconian, the spell gets added, if it's wearing armor, the spell gets removed?I'm not sure how exactly the game works in this regard, but it's pretty likely this way will just cause the spell to constantly appear and disappear, perhaps even unnoticeably fast. Some do once conditions or states could help, or maybe even a re-structuring, like: ... let bIsDraconian := 0 If Player.GetRace == Draconian let bIsDraconian := 1 EndIf ... let bHasSpell := 0 If Player.HasSpell AbRaceDraconianShield let bHasSpell := 1 EndIf ... ; use fancy loop code from above to set bWearsArmor ... If bIsDraconian == 1 && bHasSpell == 0 && bWearsArmor == 0 Player.AddSpell AbRaceDraconianShield Else Player.RemoveSpell AbRaceDraconianShield EndIf ... That's a lot more code than necessary, but I think you'll easier see what I'm aiming at with 3 boolean variables and 1 setting code each. Link to comment Share on other sites More sharing options...
OvadWolfeye Posted January 18, 2021 Share Posted January 18, 2021 (edited) Ok I think I get what your wanting. How about a Magic script that sets a ref and a variable for each equipment slot Then set them each using the getequippedobject function in the Begin ScriptEffectStart Block In the Begin ScriptEffectUpdate Block use the isarmor on each ref to set the Variables to allow a toggle for the OnScriptEffectFinish Block Set up a timer for the spell and have it dispel at a set time Edited January 18, 2021 by CountryRoberts Link to comment Share on other sites More sharing options...
Recommended Posts