Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
Old 12-11-2010, 04:07 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by xAndrewx View Post
hmm how so @ my script
Just the use of getstringkeys instead of an array seems like a 'hack' to me.
__________________
Quote:
Reply With Quote
  #17  
Old 12-11-2010, 04:10 AM
DeCeaseD DeCeaseD is offline
Registered User
Join Date: Jan 2008
Posts: 247
DeCeaseD will become famous soon enough
With a little tinkering I was able to do what you said Jerret, but how exactly am I to determine if all the ingredients are in that item, and make the script return the result? Atm, it will take the recipe and determine if any required ingredients are the same as in the recipe and link it to the id of that recipe, but how exactly would I determine if ALL the ingredients are in the recipe and than return that?
Reply With Quote
  #18  
Old 12-11-2010, 04:50 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Loop through the provided ingredients and compare them to the recipes actual ingredients.

Possible solutions:

PHP Code:
temp.matches countIngredients(recipe);
temp.match 0;
for (
ingredientingredients) {
  if (
ingredientInRecipe(recipeitemqty)) temp.match++;
}
if (
temp.match == temp.matches) {
  return 
recipe;

then in your.. ingredientInRecipe(recipe, item, qty) you can specify if it needs to be exact or what not.
__________________
Quote:
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:32 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.