Is there a way around this?

Post » Sun May 01, 2011 10:45 pm

For the mod i'm making i just noticed this small little bug where an npc requests the player to give him 20 grandmaster repair hammers. Well it works just fine i typed this in the result box of the dialogue

player->removeitem "repair_grandmaster_01", 20

but if a player has a used up grandmaster repair hammer it will take only his/her grandmaster used up repair hammers. I did a little test and put 20 grandmaster repair hammers in my inventory and put one used up grandmaster repair hammer and what happens is the used up one gets removed but the 20 not used up ones stay. At first i thought i didn't type it right to recognize the amount to remove but that wasn't it the game engine seperates the two, and each seperate used repair hammer by itself. The game doesn't take 20 total unless they are all perfect and not used. So the only other way to do this is via script??
User avatar
MR.BIGG
 
Posts: 3373
Joined: Sat Sep 08, 2007 7:51 am

Post » Mon May 02, 2011 1:12 am

so the problem is it returns true (that they have 20 hammers), but then when you go to remove them if there is a semi-used hammer it will only remove the semi-used one/?

Im thinking prehaps repeating the function might make it remove used hammers then start on the good hammers. eg:
player->removeitem "repair_grandmaster_01", 1
player->removeitem "repair_grandmaster_01", 1
player->removeitem "repair_grandmaster_01", 1
player->removeitem "repair_grandmaster_01", 1
... and so forth until 20

But its been a long while since Ive scripted in morrowind. Might make the code longer, but it cant hurt to give it a go.
User avatar
Sara Johanna Scenariste
 
Posts: 3381
Joined: Tue Mar 13, 2007 8:24 pm

Post » Mon May 02, 2011 1:31 am

thanks i was thinking of that i didn't put the 1 in front of each command that's probably why it didn't work before.

so the problem is it returns true (that they have 20 hammers), but then when you go to remove them if there is a semi-used hammer it will only remove the semi-used one/?


yea if there is a semi used hammer it will only remove that one semi used hammer. It thinks it's removing 20 but it's not. It even says in the dialogue that 20 grandmaster repair hammers were removed.
User avatar
Maria Garcia
 
Posts: 3358
Joined: Sat Jul 01, 2006 6:59 am

Post » Sun May 01, 2011 2:52 pm

The remove command "thinks" that it does remove the items, even if there are none there. As a side effect, it affects the player's carried weight as if the items were removed. If the gm hammers in the above example weighed 1 pound, the player would be able to carry 19 more pounds.(since the weight of 19 extra hammers were removed)
User avatar
Cat Haines
 
Posts: 3385
Joined: Fri Oct 27, 2006 9:27 am

Post » Mon May 02, 2011 2:04 am

Correct. Another reason I wanted to fix this slight bug. It's not a major deal just something I wanted to fix.
User avatar
Add Meeh
 
Posts: 3326
Joined: Sat Jan 06, 2007 8:09 am


Return to III - Morrowind