FindConfigElem()

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
innominabile
Adept Poster
Posts: 85
Joined: Wed Aug 30, 2006 5:24 pm

FindConfigElem()

Post by innominabile »

When the output of FindConfigElem() change?

If I int my npc ai with code:

Code: Select all

    SetObjProperty(me, "Template", FindConfigElem(ReadConfigFile(":*:npcdesc"), RemovePackageNameFromTemplate(me.npctemplate)));
I must reload FindConfigElem() every time, or I can use:

Code: Select all

function InitNpc(me)
  if (!GetObjProperty(me, "Template"))
    SetObjProperty(me, "Template", FindConfigElem(ReadConfigFile(":*:npcdesc"), RemovePackageNameFromTemplate(me.npctemplate)));
  endif
endfunction
?
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Post by Yukiko »

Recently I was working with some cleric scripts writing a GM tool and I found that I had to re-read the cfg file if I did repeated calls to GetConfigStringArray using different data. So it may be the same with FindConfigElem.
innominabile
Adept Poster
Posts: 85
Joined: Wed Aug 30, 2006 5:24 pm

Post by innominabile »

Beh.... And a new member that point to template element in npcdesc.cfg?
It could be faster.
Post Reply