PenUltima Online

It is currently Tue Oct 07, 2008 6:26 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: FindConfigElem()
PostPosted: Fri Sep 08, 2006 4:08 am 
Offline

Joined: Wed Aug 30, 2006 5:24 pm
Posts: 82
Location: Italy
When the output of FindConfigElem() change?

If I int my npc ai with code:

Code:
    SetObjProperty(me, "Template", FindConfigElem(ReadConfigFile(":*:npcdesc"), RemovePackageNameFromTemplate(me.npctemplate)));


I must reload FindConfigElem() every time, or I can use:
Code:
function InitNpc(me)
  if (!GetObjProperty(me, "Template"))
    SetObjProperty(me, "Template", FindConfigElem(ReadConfigFile(":*:npcdesc"), RemovePackageNameFromTemplate(me.npctemplate)));
  endif
endfunction


?

_________________
Admin/Scripter Innominabile
ZuluHotelItalia shard on m4d


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 08, 2006 12:23 pm 
Offline

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1154
Location: Southern Central USA
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.

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 09, 2006 6:31 am 
Offline

Joined: Wed Aug 30, 2006 5:24 pm
Posts: 82
Location: Italy
Beh.... And a new member that point to template element in npcdesc.cfg?
It could be faster.

_________________
Admin/Scripter Innominabile
ZuluHotelItalia shard on m4d


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: Google [Bot] and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl