Jump to content

Basic Scripting Question


neuntoter

Recommended Posts

Okay I am still new to this scripting thing and am getting frustrated.

 

I have this script I got from a post from here. I have added a ShowMessage to it too just to make sure it is not working. The script type is effect.

ScriptName 00ArmorScript
Begin ScriptEffectStart
SetActorValue SpeedMult 300
End

Begin ScriptEffectFinish
       SetActorValue SpeedMult 100
End

 

I have a Base Effect Archtype Script and this script as it's Item. Flags being set to Self, Touch, Target, No Magnitude, No Area

 

I have my armor which has an Object Effect, everything else from that object effect is working except for the base effect.

 

Am I going about this wrong? Any clue why it is not working in game?

Link to comment
Share on other sites

One thing, I read somewhere that anything that starts with numerical characters won't work. Probably because it thinks it's an ID, not a text string.

 

You are trying to make an armor that makes you fast when you equip it?

 

I would try:

scn scriptname

Begin OnEquip Player

player.setactorvalue speedmult 300

End

Begin OnUnEquip Player

player.setactorvalue speedmult 100

End

 

You might also want to first save your speedmult to a variable in case it is not 100. Then you'll know what to set it back to.

Link to comment
Share on other sites

I would put it right on the armor. That's the only way the OnEquip block will work, anyway.

 

Okay redoing it as an armor script simplifies everything.. Not sure why I didn't just go with that idea in the first place heh.

 

So the only other thing I can think of is though that if an NPC equips my armor they will give me the buff. How can I get the wearer and run the onequip regardless if its player or npc?

 

Just to show I am actually trying to do my own work...

 

ScriptName 00ArmorScript

ref Wearer

Begin OnEquip
set Wearer to GetSelf
Wearer.SetActorValue SpeedMult 300
End

Begin OnUnequip
set Wearer to GetSelf
Wearer.SetActorValue SpeedMult 100
End

 

I will fix the restore of Speedmult and save the value later just trying to get some basic idea here.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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