Jump to content


Photo

Differences between PartyHasItem() and HasItem()


3 replies to this topic

#1 argent77

argent77
  • Members
  • 257 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)

Imagination is more important than knowledge. Knowledge is limited; imagination encircles the world. - Albert Einstein

 

My contributions:


#2 Miloch

Miloch

    Barbarian

  • Modders
  • 4749 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?
Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it." -Terry Pratchett

#3 argent77

argent77
  • Members
  • 257 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.

Imagination is more important than knowledge. Knowledge is limited; imagination encircles the world. - Albert Einstein

 

My contributions:


#4 lynx

lynx
  • Modders
  • 1819 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