Page 1 of 1

DEBUG

Posted: Mon Sep 08, 2008 8:03 am
by Tio Bugger
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?

Re: DEBUG

Posted: Mon Sep 08, 2008 8:16 am
by Austin
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.

Code: Select all

Script Error in 'scripts/ai/merchant.ecl' PC=1723:
Call to function GetConfigString:
Parameter 0: Expected datatype ApplicObj, got datatype Error
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

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 Uninit
CreateItemInContainer( container, objtype, amount := 1 )

Parameter 1 is getting a variable that has never been assigned a value in your script.