ApplicPtr and ApplicObj

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
richardali
New User
Posts: 7
Joined: Tue Sep 09, 2008 4:27 am

ApplicPtr and ApplicObj

Post by richardali »

What is ApplicPtr? and ApplicObj?

Can i convert a value to these values?
thanks
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Re: ApplicPtr and ApplicObj

Post by Yukiko »

Where do those names appear?
richardali
New User
Posts: 7
Joined: Tue Sep 09, 2008 4:27 am

Re: ApplicPtr and ApplicObj

Post by richardali »

Here:

Script Error in 'scripts/ai/animaltrainer.ecl' PC=3237:
Call to function GetConfigStringArray:
Parameter 0: Expected datatype ApplicObj, got datatype Error

Script Error in 'scripts/ai/merchant.ecl' PC=4455:
Call to function GetConfigStringArray:
Parameter 0: Expected datatype ApplicObj, got datatype Error

in debug.log
thanks
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Re: ApplicPtr and ApplicObj

Post by CWO »

Basically what is happening here is parameter 0 (the first parameter you're passing to GetConfigStringArray()) is expected to be a configfile element but its not, its an error. Now you need to trace back why you're getting this error, likely the FindConfigElem() before it is returning an error.

small example:

Code: Select all

var myconfig := ReadConfigFile("::myconfig");
var elem := FindConfigElem(myconfig, "myelement");   <--- This is likely returning an error. So the variable 'elem' is now an Error.
var array := GetConfigStringArray(elem, "stringarray"); <-- GetConfigStringArray() wants the element as the first parameter which is an ApplicObj datatype, but since elem is an error, its getting datatype Error.
So basically it is telling you in a very short way that it wants an ApplicObj as the first parameter (in this case its a configfile element) but its being given an error so it throws that to debug.log. You're not looking for a way to convert something to these values, you're looking at why you're getting something different than those values.
Post Reply