[SCRIPT] Issue with player.additem

Post » Sun May 19, 2013 3:13 am

Hello,

I started scripting recently, and I have done some simple scripts for a new mod. I managed to do what I wanted with several function, but the one on which I got some issues is the most simple : player.additem.

There are two things.

FIRST, in a script which is going to allow you to craft weapons.

I made a first menu to choose the material (iron, steel, silver, etc.). It works perfectly.

The second menu is about the kind of weapon (Dagger, shortsword....). The menu works well, but when I select an option, the item I should receive doesn't come...

Here is an instance of a part of script :

If (ChoiceI == -1)
Set ChoiceI to GetButtonPressed

Elseif (ChoiceI == 0)
If (Type == 1)
player.additem WeapIronDagger 1
Elseif (Type == 2)
player.additem WeapSteelDagger 1
Elseif (Type == 3)
player.additem WeapSilverDagger 1
Endif
Set ChoosingI to 0

I a going to add other materials but it doesn't work for no so I didn't ; and there is no items needed for now because it is only a test.

Type is the variable associated to the material (this menu is the same for all 8 materials, it takes less space in the script).

I can't see what's wrong, but I can't get the daggers in game...

So what did I wrong ?

SECOND, this one is really strange.

I made little scripts to craft Leather from animal hide / pelt. You need callipers to craft it.

The scripts I made for wolf pelt and lion hide work perfectly, but the one for bear pelt causes a game crash, even if it is the same but with different item and count...

Let's see it :

Scn 0bearpelt10
Begin OnEquip
If Player.GetItemCount Callipers01 == 0
MessageBox "Il vous faut un compas d'épaisseur pour transformer l'objet." "OK"
Elseif Player.GetItemCount Callipers01 >= 1
player.additem LeatherPiece 4
player.removeitem BearPelt01 1
Endif
End

(I am french, so the text is)

I hope someone will be able to help me... and that my English is not too bad.

User avatar
Ana Torrecilla Cabeza
 
Posts: 3427
Joined: Wed Jun 28, 2006 6:15 pm

Return to IV - Oblivion