Hello friends,
I'm having some problems with my DEBUG, correct some mistakes, but they do not understand what I was wrong, they can give me some tips?
POL 097
Script Error in 'scripts/ai/archerkillpcs.ecl' PC=2530:
Call to function CreateItemInContainer:
Parameter 1: Expected Long, String, or Struct, got datatype Uninit
Script Error in 'scripts/ai/merchant.ecl' PC=1723:
Call to function GetConfigString:
Parameter 0: Expected datatype ApplicObj, got datatype Error
Can you help?
DEBUG
Re: DEBUG
These are coming from debug.log correct?
They occur when data is not checked.
When you call a core function, you should always try to determine if the return value is an error before proceeding.
You used GetConfigString() and the ConfigElem reference that should be passed was an error data type.
http://docs.polserver.com/pol097/objref.php#Error
For
CreateItemInContainer( container, objtype, amount := 1 )
Parameter 1 is getting a variable that has never been assigned a value in your script.
They occur when data is not checked.
When you call a core function, you should always try to determine if the return value is an error before proceeding.
Code: Select all
Script Error in 'scripts/ai/merchant.ecl' PC=1723:
Call to function GetConfigString:
Parameter 0: Expected datatype ApplicObj, got datatype Errorhttp://docs.polserver.com/pol097/objref.php#Error
For
Code: Select all
Script Error in 'scripts/ai/archerkillpcs.ecl' PC=2530:
Call to function CreateItemInContainer:
Parameter 1: Expected Long, String, or Struct, got datatype UninitParameter 1 is getting a variable that has never been assigned a value in your script.