casma164 Posted April 15, 2014 Share Posted April 15, 2014 First off, I have little experience scripting. I've completed several tutorials, notably editing items, creating and applying enchantments, and construction templates.I've looked at some .psc files and tried making my own spell, spell effect and scripts using these other scripts as reference material. I've got a spell and activemagiceffect script that enlarges actors via setscale using an oneffectstart event, then after 30 seconds reduces them back to normal size. Now, I want the script to also unequip all of the actors weapons/armor, then when the spell expires, re-equip everything. Browsing thru this list http://mod.gib.me/skyrim/functions.html , I find the unequipall function. The script fails to compile and gives this reason "Unequipall is not a property on script actor or one of its parents". Does this mean that I have to declare a property before I'm able to use the Unequipall function? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted April 16, 2014 Share Posted April 16, 2014 You would do better browsing here at the official CK wiki for appropriate papyrus functions/events. Not because the other site is wrong about the existence of functions/events but because the CK wiki goes into more detail about how to use the functions/events. Also, if you posted the script that you are trying to compile, we would be able to see where it went wrong and give you steps to correct it. But to answer your question. No, you do not need to declare a property to use the UnequipAll function. What you most likely need without seeing the script code is correct syntax. Link to comment Share on other sites More sharing options...
casma164 Posted April 16, 2014 Author Share Posted April 16, 2014 ok, here's the script in question... Scriptname enlargementray extends ActiveMagicEffect Event OnEffectStart(Actor akTarget, Actor akCaster) akTarget.Unequipall akTarget.SetScale(2.0) akTarget.SetScale(3.0) akTarget.SetScale(4.0) akTarget.SetScale(5.0) akTarget.SetScale(6.0) akTarget.SetScale(7.0) akTarget.SetScale(8.0) akTarget.SetScale(9.0) akTarget.SetScale(10.0)EndEventEvent OnEffectFinish(Actor akTarget, Actor akCaster) akTarget.SetScale(9.0) akTarget.SetScale(8.0) akTarget.SetScale(7.0) akTarget.SetScale(6.0) akTarget.SetScale(5.0) akTarget.SetScale(4.0) akTarget.SetScale(3.0) akTarget.SetScale(2.0) akTarget.SetScale(1.0)EndEvent Like I mentioned in my first post, I'm just looking at other peoples scripts to figure out how things work. Link to comment Share on other sites More sharing options...
Ceruulean Posted April 16, 2014 Share Posted April 16, 2014 You forgot the parentheses after Unequipall Link to comment Share on other sites More sharing options...
IsharaMeradin Posted April 16, 2014 Share Posted April 16, 2014 What Ceruulean said. That line should be:akTarget.Unequipall() Link to comment Share on other sites More sharing options...
casma164 Posted April 17, 2014 Author Share Posted April 17, 2014 TY, that was the problem. Link to comment Share on other sites More sharing options...
casma164 Posted April 18, 2014 Author Share Posted April 18, 2014 OK, next question. Following up on the enlargement ray script, when the spell ends, I want the NPC to equip all armor/weapons that was on him before the unequipall function ran. Would I need to use a GetEquippedObject function for each Biped Object slot(slots 30-43) then use EquipItem function to equip said items? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted April 18, 2014 Share Posted April 18, 2014 Sounds about right. Just be sure to call the GetEquippedObject function prior to the UnequipAll function. Link to comment Share on other sites More sharing options...
casma164 Posted April 18, 2014 Author Share Posted April 18, 2014 Is it safe to assume that all functions are done in a first in, first out basis? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted April 18, 2014 Share Posted April 18, 2014 I guess. Can't really say for sure. I'm not a programmer. All I know is that in your case logically you would want to get the equipped objects prior to taking them off. If the actor is not wearing anything when you check for equipped items, they would have nothing to put back on when told to re-equip. Link to comment Share on other sites More sharing options...
Recommended Posts