Jump to content

Scripting questions


casma164

Recommended Posts

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

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

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)
EndEvent

Event 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

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

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

  • Recently Browsing   0 members

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