Some scripting help please

Post » Fri May 27, 2011 11:20 pm

Is there a way to do a script for an NPC where he attacks you if you have a weapon in you inventory at all, not necessarily equipped but in your inventory? For example a throne room where you have to lay your weapons on a table before entering or the guard kill attack you.
Also, this may be even more complicated but is there a way to do the same as above but with only certain weapon types. (for example if it is at all possible I was planning to have all weapons be detectable by guards except short blades so an assassin character could smuggle one in).
-I don't know if either of these are possible at all and I am a complete noob at scripting so any help or advice would be great.
User avatar
Natasha Biss
 
Posts: 3491
Joined: Mon Jul 10, 2006 8:47 am

Post » Fri May 27, 2011 6:50 pm

Not possible with MWSE, unfortunately. With MWSE, you can iterate through all inventory items and scan for weapon type items, but it will cause a pretty good slowdown if the player is carrying a lot of stuff.

I would recommend having the guards require the player to not have a weapon readied, and to respond immediately if the player draws a weapon. That's much more common in games (because of the reasons above) and works roughly as well. It also leaves the role-playing option open to players carrying boot-knives, punching daggers, etc.
User avatar
Jonathan Montero
 
Posts: 3487
Joined: Tue Aug 14, 2007 3:22 am

Post » Sat May 28, 2011 12:21 am

of course it would be possible to do a "if ( player -> GetItem Count "item" != 0 ) on every weapon listed in vanilla morrowind and just exclude the short blades, but that would take a very long time and weapons from other mods would still be present. the script would also bring the game to a standstill for several seconds (speaking from experience and a computer that can run crisis on high)
sorry I couldn't be of more help :)
User avatar
Maria Leon
 
Posts: 3413
Joined: Tue Aug 14, 2007 12:39 am


Return to III - Morrowind