porroone Posted February 8, 2012 Share Posted February 8, 2012 So basically im trying to add an script to a weapon, but im not sure what im doing wrong, im trying something very simple but it doesnt seem to work, I was hoping somebody could point me in the right direction, here is the code: Scriptname WarGlaiveBack extends Actor import debug import game import utility Event OnObjectUnequipped(Form WarGlaiveR, ObjectReference akActor) Debug.MessageBox("Hello, world!") EndEvent Basically I have a weapon named WarGlaiveR, and I want it to show a messagebox when I unequipped. Link to comment Share on other sites More sharing options...
porroone Posted February 8, 2012 Author Share Posted February 8, 2012 This is driving me nuts Link to comment Share on other sites More sharing options...
needsaname Posted February 8, 2012 Share Posted February 8, 2012 So basically im trying to add an script to a weapon, but im not sure what im doing wrong, im trying something very simple but it doesnt seem to work, I was hoping somebody could point me in the right direction, here is the code: Scriptname WarGlaiveBack extends Actor import debug import game import utility Event OnObjectUnequipped(Form WarGlaiveR, ObjectReference akActor) Debug.MessageBox("Hello, world!") EndEvent Basically I have a weapon named WarGlaiveR, and I want it to show a messagebox when I unequipped. TryScriptname _Weapon_test extends ObjectReference {Weapon Script} Event OnUnequipped (Actor AkActor) if AkActor == Game.GetPlayer() debug.MessageBox("Hello World!") endif EndEvent Link to comment Share on other sites More sharing options...
porroone Posted February 8, 2012 Author Share Posted February 8, 2012 (edited) So basically im trying to add an script to a weapon, but im not sure what im doing wrong, im trying something very simple but it doesnt seem to work, I was hoping somebody could point me in the right direction, here is the code: Scriptname WarGlaiveBack extends Actor import debug import game import utility Event OnObjectUnequipped(Form WarGlaiveR, ObjectReference akActor) Debug.MessageBox("Hello, world!") EndEvent Basically I have a weapon named WarGlaiveR, and I want it to show a messagebox when I unequipped. TryScriptname _Weapon_test extends ObjectReference {Weapon Script} Event OnUnequipped (Actor AkActor) if AkActor == Game.GetPlayer() debug.MessageBox("Hello World!") endif EndEvent Didn't work, I tried several combinations including declaring the weapon as a property, using the WEAPON extend, using event OnObjectUnequipped(Weapon WarGlaiveR), tried so many tings that something should had work, or at least gave me something, but no, instead all I got is a perfect compiled script, with zero results after unequipping the weapon on all attempts which after a few hours I find a bit frustrating, so Im gonna go sleep hoping tomorrow ill see things clearly :P Edited February 8, 2012 by porroone Link to comment Share on other sites More sharing options...
needsaname Posted February 8, 2012 Share Posted February 8, 2012 The script works for me, did you copy the line "Scriptname _Weapon_test extends ObjectReference " by chance and leave it in with another Scriptname line? Link to comment Share on other sites More sharing options...
porroone Posted February 8, 2012 Author Share Posted February 8, 2012 Yes, why would the name matter ? Link to comment Share on other sites More sharing options...
needsaname Posted February 8, 2012 Share Posted February 8, 2012 (edited) Yes, why would the name matter ? The script on the sword wouldn't work since the name changed during the runtime of the script.Just create a new script with the Event OnUnequipped (Actor AkActor) if AkActor == Game.GetPlayer() debug.MessageBox("Hello World!") endif EndEventpart of the script and below what's in there by default. Edited February 8, 2012 by needsaname Link to comment Share on other sites More sharing options...
porroone Posted February 8, 2012 Author Share Posted February 8, 2012 I think I missunderstood you, I left the original scriptname, the one that matches the name of the file as the wiki says it should, otherwise it doesnt let you compile anyways. Link to comment Share on other sites More sharing options...
needsaname Posted February 8, 2012 Share Posted February 8, 2012 Oh I see. Wonder why it doesn't work for you? It works every time with me... Link to comment Share on other sites More sharing options...
porroone Posted February 8, 2012 Author Share Posted February 8, 2012 Im starting to think its because I already had the weapon in the inventory when I added the script to it, maybe if I make a new save without the mod then activate the mod again and recraft the weapon, any idea if that could be the reason? I think I had a similar issue back in oblivion but Im not sure. Link to comment Share on other sites More sharing options...
Recommended Posts