Trouble attaching a script to a weapon.

Post » Thu Jun 21, 2012 1:16 am

In Oblvion Oblivion had an amazing mod called a Thieves Arsenal. This had two niffty objects. A black jack that would knock people unconscious and allow you to loot, drag the bodies around until they woke up, and gas arrows that did the same thing.

Since my character is not fond of killing when not needed, he prefers to knock out a band of bandits and just take all their weapons, armor and such. I am trying to find a way to do this in Skyrim. A fine gentleman wrote/found a script that looks as though it would solve all my needs. This is the script(The title is not pasting in the white box for some reason on this post):

Scriptname fg109TestMEScript extendsActiveMagicEffect

Actor MySelf

Event OnEffectStart(Actor akTarget, Actor akCaster)
MySelf = akTarget
MySelf.SetUnconscious()
MySelf.PushActorAway(MySelf, -5)
RegisterForSingleUpdate(2)
EndEvent

Event OnUpdate()
MySelf.EnableAI(False)
EndEvent

Event OnEffectFinish(Actor akTarget, Actor akCaster)
MySelf.EnableAI()
MySelf.SetUnconscious(False)
EndEvent

Event OnActivate(ObjectReference akActionRef)
MySelf.OpenInventory(True)
EndEvent

If I am reading this right, it knocks them out, allows me to do anything I need to while he is out, and allows me to get into his inv while he is out. Now here is the problem... I have very little skill in scripting. I spent 6 hours trying to attach this to a weapon. I copied the script into the game and called it KO:

http://i895.photobucket.com/albums/ac158/squee913/sc1.jpg

I then made a new magic effect with this script and called it Knockout:

http://i895.photobucket.com/albums/ac158/squee913/magiceffect.jpg

I then attached that to an enchantment for weapons:

http://i895.photobucket.com/albums/ac158/squee913/enchantment-1.jpg[

Finally, I tried to give this enchantment to a weapon with 0 damage:

http://i895.photobucket.com/albums/ac158/squee913/weapon-1.jpg

this does not work at all. The weapon shows that it is enchanted, but nothing happens. Does anyone know what i am doing wrong? If we can get this to work, it would be a great addition to the game for everyone!
User avatar
Leticia Hernandez
 
Posts: 3426
Joined: Tue Oct 23, 2007 9:46 am

Post » Thu Jun 21, 2012 1:51 am

The first line of the script should be:

Scriptname KO extends ActiveMagicEffect
User avatar
kelly thomson
 
Posts: 3380
Joined: Thu Jun 22, 2006 12:18 pm

Post » Wed Jun 20, 2012 7:29 pm

The first line of the script should be:

Scriptname KO extends ActiveMagicEffect

Thank you, I changed it... didn't make it work... but I changed it :P
User avatar
Kat Lehmann
 
Posts: 3409
Joined: Tue Jun 27, 2006 6:24 am

Post » Wed Jun 20, 2012 4:28 pm

Take out all those curly braces too. Things between curly braces are considered comments, and not code, so it isn't compiled/processed. You should have copied the script exactly as what was given to you, and only changed the name.
User avatar
Mrs. Patton
 
Posts: 3418
Joined: Fri Jan 26, 2007 8:00 am

Post » Wed Jun 20, 2012 7:22 pm

Take out all those curly braces too. Things between curly braces are considered comments, and not code, so it isn't compiled/processed. You should have copied the script exactly as what was given to you, and only changed the name.

odd... I did copy and paste it. I didn't put the curly things in there. I shall remove them though
User avatar
Rachyroo
 
Posts: 3415
Joined: Tue Jun 20, 2006 11:23 pm

Post » Thu Jun 21, 2012 5:56 am

Take out all those curly braces too. Things between curly braces are considered comments, and not code, so it isn't compiled/processed. You should have copied the script exactly as what was given to you, and only changed the name.

You sir, are my Savior!!! my own personal Jeezy Chressy! It works! I shall now find a way to finish this and put it on nexus for all :)
User avatar
Rachael Williams
 
Posts: 3373
Joined: Tue Aug 01, 2006 6:43 pm


Return to V - Skyrim