Jump to content


Photo

Differences between PartyHasItem() and HasItem()


3 replies to this topic

#1 argent77

argent77
  • Members
  • 254 posts
  • Gender:Male

Posted 01 February 2012 - 11:22 AM

I want to make sure a script detects a certain item in my possession, be it in an inventory slot, equipped or somewhere deep within my bags.

Which method is more reliable?
PartyHasItem("MYITEM")

or

OR(6)
   HasItem("MYITEM", Player1)
   HasItem("MYITEM", Player2)
   HasItem("MYITEM", Player3)
   HasItem("MYITEM", Player4)
   HasItem("MYITEM", Player5)
   HasItem("MYITEM", Player6)


#2 Miloch

Miloch

    Barbarian

  • Modders
  • 4715 posts
  • Gender:Male
  • Location:At Large

Posted 01 February 2012 - 11:50 AM

They should do the same thing, meaning 1 line of code is preferable to 7, no?
Mod Contributions
Aurora (new release!) * BG1 NPC * Gnomes * Haiass * Level 1 NPCs * Lost Items * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * In Progress: Adjusted Portraits * DSotSC (Tutu)
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * PSPad Highlighters * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Wherefore do ye toil; is it not that ye may live and be happy? And if ye toil only that ye may toil more,
when shall happiness find you?" -H.P. Lovecraft, The Quest of Iranon

#3 argent77

argent77
  • Members
  • 254 posts
  • Gender:Male

Posted 01 February 2012 - 12:06 PM

They should do the same thing, meaning 1 line of code is preferable to 7, no?

Good point. I was hoping there would be a difference, because in some of my past walkthroughs where I had the Item Upgrade mod installed, Cromwell didn't always detect some of my components. I think they used HasPartyItem() in their scripts.

#4 lynx

lynx
  • Modders
  • 1795 posts
  • Gender:Male
  • Location:Ljubljana, Slovenija

Posted 01 February 2012 - 12:44 PM

could be just bugs in the scripts, eg. wrong item resrefs.
GemRB - IE anywhere.
Mages needed! Python tamers needed for iwd2!



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users