is this possible?

Old and generally outdated discussions, with the rare hidden gem. Enter at your own risk.

Moderators: Haplo, Lead Developers

Locked
Kingofall32
Member
Posts: 28
Joined: Mon Sep 17, 2007 9:11 pm

is this possible?

Post by Kingofall32 »

since I am not to good at scripting, my friend had this idea and idk if it is possible to sciprt. a "keyblade" that has power to unlock doors when you swing the blade at it.
User avatar
Zalzidrax
Developer
Posts: 898
Joined: Wed Dec 03, 2003 7:26 am
Location: Bothell, WA

Post by Zalzidrax »

I don't think it is possible to do that with an unmodded Morrowind game, as there's no way of detecting whether a weapon has been swung. However, it may well be possible to have a sword that unlocks all nearby objects when it is drawn. I'll try to get an example script together and see if it works.
Kingofall32
Member
Posts: 28
Joined: Mon Sep 17, 2007 9:11 pm

Post by Kingofall32 »

Cool! Thanks!
User avatar
Zalzidrax
Developer
Posts: 898
Joined: Wed Dec 03, 2003 7:26 am
Location: Bothell, WA

Post by Zalzidrax »

The best I could do was give the player a spell that would open locks while having the weapon equipped

Code: Select all

begin keyswordscript
short spellequip
short OnPCEquip

if ( OnPCEquip == 1 )
   if ( spellequip == 0 )
      set spellequip to 1
      player->AddSpell "unlock_spell"
   endif
endif
if ( OnPCEquip == 0 )
   if ( spellequip == 1 )
      set spellequip to 0
      player->RemoveSpell "unlock_spell"
   endif
endif
end
The OnPCEquip variable, if declared in a script on the item, will automatically be changed to 1 when a player equips an item and 0 when a player unequips it. This script should (though I can't quite guarantee as I haven't tested this version) give the player a spell (currently "unlock_spell") whenever the item is put on, and remove the spell when the weapon is unequipped. If you put this script on a sword, make a custom unlock spell for it (unlock 100 pts touch, no cost spell or something like that) and put the spell's name in for "unlock_spell", it should hopefully work.
Last edited by Zalzidrax on Thu Sep 20, 2007 5:41 pm, edited 1 time in total.
Kingofall32
Member
Posts: 28
Joined: Mon Sep 17, 2007 9:11 pm

Post by Kingofall32 »

neat...ill try it out.
User avatar
Andres Indoril
Senior Developer
Posts: 1459
Joined: Fri Jan 13, 2006 9:01 pm
Location: Lost.... Somewhere?
Contact:

Post by Andres Indoril »

Shouldn't the second AddSpell be RemoveSpell?
[url=http://andresindoril.blogspot.com/][img]http://i45.photobucket.com/albums/f94/Andres_Indoril/siggyleft.jpg[/img][/url][url=http://www.youtube.com/user/AndresIndoril][img]http://i45.photobucket.com/albums/f94/Andres_Indoril/siggyright.jpg[/img][/url]
"You guys are no fun, I'll start my own TR with dead children and toy guars!" -Why
User avatar
Serric
Reviewer
Posts: 290
Joined: Tue Oct 18, 2005 1:06 pm
Location: The Kingdom United!!!

Post by Serric »

Yes. Yes it should...
Approved: 15 In review: 0 Claimed: 0
Reviews Done: ~85
User avatar
Zalzidrax
Developer
Posts: 898
Joined: Wed Dec 03, 2003 7:26 am
Location: Bothell, WA

Post by Zalzidrax »

D'oh! That's what I get for not actually testing something, dumb mistakes.

Should be better now.
CrazedOne
Member
Posts: 12
Joined: Tue Mar 27, 2007 9:06 pm

Post by CrazedOne »

if it's in morrowind, you can open the lockpicks menu in the construction set, right click press add new item. Select what weapon you want the pick to look like.(make sure you have your CS disk in) and search through the folders until you find the weapons one. now choose your weapon and place it ingame. It will work as a lockpick but it will be a sword. (there might be some other steps I havent used the Morrowind CS in awhile)
~CrazedOne~
-wissen ist enrgie-
Locked