Aller au contenu

Photo

CreateItemOnObject seems to be bugged


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
kamal_

kamal_
  • Members
  • 5 258 messages
CreateItemOnObject(sReward, oItemUser, iNumberToCreate);

If iNumToCreate is more than 1 and the thing you are creating is not stackable, only one is created. If the item is stackable, the proper number is created.

Can someone confirm that?

#2
Dann-J

Dann-J
  • Members
  • 3 161 messages
That's probably by design, since the function returns an object. I frequently use the function as...

object oItem = CreateItemOnObject(...);

...then do additional things to the created item via oItem (add additional properties, equip it, etc).

I suppose that means that if you tried to create more than the stack limit of a stackable item, you'd only get one stack with the maximum number (99 arrows, 50 throwing axes, etc).

Modifié par DannJ, 17 janvier 2013 - 12:43 .


#3
kamal_

kamal_
  • Members
  • 5 258 messages
The third parameter is called "nStackSize" in the function description. So maybe it's not bugged, just has a confusing description.

Not a big deal, I just while looped for the stack size.