Page 1 of 2
Problem starting POL
Posted: Mon Jun 24, 2013 11:35 am
by xeon
Hi guys, I've just compiled the latest POL from SVN sources. I'm trying to migrate from 096 to 099. So far all the scripts have been modified and compile successfully. I've got a little problem starting POL:
...
Loading package in <some package>
WARNING: <omitted>/regen.ecl: Unable to find module npc
Error reading configuration file <omitted>/vitals.cfg:
Export Script <omitted>/regen.ecl not found
Element: Vital Life, found on line 1
Server Shutdown: load_vitals_cfg: load_packed_cfgs
Execution aborted due to: Configuration file error
I don't understand what it is caused by. The script compile successfully.
Any hint??
Re: Problem starting POL
Posted: Mon Jun 24, 2013 11:47 am
by RusseL
Upload better your vitals.cfg and regen.ecl

Re: Problem starting POL
Posted: Mon Jun 24, 2013 12:24 pm
by xeon
Mmmm I'd like to not make them public... do you mind if I send them to you?
Re: Problem starting POL
Posted: Thu Jun 27, 2013 12:57 pm
by xeon
It's some day that I try to make it work without luck...
If I empty the .src leaving only the function definitions, it works. When I import a particular include file, it start to give that error.
Re: Problem starting POL
Posted: Fri Jun 28, 2013 3:50 am
by RusseL
send me your script
Re: Problem starting POL
Posted: Fri Jun 28, 2013 4:44 am
by AsYlum
xeon wrote:It's some day that I try to make it work without luck...
If I empty the .src leaving only the function definitions, it works. When I import a particular include file, it start to give that error.
If your *.inc file is called same as module files then POL is going nuts

I guess there is a npc.em and npc.inc or something similar.
OR
you have custom functions in inc/src files that have same names as those in em files.
Re: Problem starting POL
Posted: Thu Jul 04, 2013 12:48 pm
by xeon
Good call Asylum, I've already fixed many variables and function. I'm looking for something like that also in this one but I can't seem to find anything. In fact it compile fine.
Russel, the .dep files show 103 include files ...
Re: Problem starting POL
Posted: Fri Jul 05, 2013 12:34 pm
by xeon
Jeez I'm really stuck on this one.
Here's the script. The script is fine, and I don't get an error if I exclude the include files and I empty the function. So I think it's something in some include file
Any other ideas??
Re: Problem starting POL
Posted: Fri Jul 05, 2013 11:41 pm
by AsYlum
xeon wrote:Jeez I'm really stuck on this one.
Here's the script. The script is fine, and I don't get an error if I exclude the include files and I empty the function. So I think it's something in some include file
Any other ideas??
Show the code -_- without it it's just blind guessing.
Re: Problem starting POL
Posted: Sun Jul 07, 2013 6:21 am
by xeon
Ok I found the problem, but I don't know why it's a problem.
I started adding one by one all the include files to the .src, until I started getting this error.
Narrowing it down, the error starting pol is due to this single line in a function in a .inc file :
Code: Select all
...
Function ProcessEvents (byref ev)
var evtext;
Case (ev.type)
...
SYSEVENT_ENGAGED:
SYSEVENT_DAMAGED:
if ( (ev.source) and (!ev.source.dead) )
say("Die " + ev.source.name + "!" );
If I comment the say() line, pol starts fine.
By the way, this function I'm pretty sure it's not called by the .src file, and it's only by inclusions that it's compiled.
Re: Problem starting POL
Posted: Mon Jul 08, 2013 12:29 am
by xeon
Ok, an update: every say() line in that function causes that error starting POL.
I understand that the say() function is allowed only in NPC scripts. What I don't understand is why with the 096 POL starts fine and with 099 I get this error. I should try to follow backward the functions tree to see if that function is really called in some branch of my script.
But aren't we sure isn't the POL that calculate somewhat incorrectly the dependencies?

Re: Problem starting POL
Posted: Wed Jul 10, 2013 1:02 am
by xeon
Ok, the only way to solve this problem is to modify my include files in a way that in the .src script doesn't get included for compilation functions that have calls to npc.em functions. This is a big pain in the a** as you can imagine. I think anyway that in this case there's some error in the way POL validates the script. I repeat, in 096 it loaded this pkg without problem.
Isn't there a developer to whom I can send my script to reproduce the issue and check if there' something to fix?
Re: Problem starting POL
Posted: Fri Jul 12, 2013 8:21 am
by xeon
Ok, now I'm pretty sure there's some bug to fix in 099.
Here's the code to repro the issue. Put this in your regen.src script, and adjust vitals.cfg to use the functions.
Code: Select all
use uo;
use cfgfile;
use npc;
use attributes;
function testfor099( who, value )
if( who.IsA(POLCLASS_NPC) )
return who.SetWarMode(value);
endif
endfunction
exported function GetLifeRegenRateExported(mob)
endfunction
exported function GetLifeMaximumValueExported(mob)
endfunction
exported function GetStaminaRegenRateExported(mob)
endfunction
exported function GetStaminaMaximumValueExported(mob)
endfunction
exported function GetManaRegenRateExported(mob)
endfunction
exported function GetManaMaximumValueExported(mob)
endfunction
If you comment the function testfor099(), POL starts fine.
Any developer could check on this please? For me, it's a blocking issue in the path to 099.
Re: Problem starting POL
Posted: Sun Jul 14, 2013 11:09 am
by xeon
Up
Someone with 099 which could verify?
Re: Problem starting POL
Posted: Wed Jul 24, 2013 9:38 am
by xeon
No one can look into this issue?

Re: Problem starting POL
Posted: Thu Aug 01, 2013 11:44 pm
by xeon
Guys, I'm still struggling with this issue.
I've found that also a simple
trigger that error starting POL.
But isn't that method valid for both PC and NPC?!
Re: Problem starting POL
Posted: Sun Aug 04, 2013 1:09 am
by Tomi
Have you tried using that method only for PCs instead of only for NPCs ?
Re: Problem starting POL
Posted: Sun Aug 04, 2013 8:11 am
by xeon
I don't understand the suggestion Tomi.
The error is given when starting POL, not when that script is executed.
Could you elaborate on that?
Re: Problem starting POL
Posted: Sun Aug 04, 2013 9:48 am
by Tomi
Sorry just looked at your old post
Code: Select all
if( who.IsA(POLCLASS_NPC) )
return who.SetWarMode(value);
endif
Have to give this a try
Re: Problem starting POL
Posted: Sun Aug 04, 2013 9:59 am
by Tomi
Okay I tried this code
Code: Select all
use uo;
use cfgfile;
use npc;
use attributes;
function testfor099( who, value )
if( who.IsA(POLCLASS_NPC) )
return who.SetWarMode(value);
endif
endfunction
exported function GetLifeRegenRateExported(mob)
endfunction
exported function GetLifeMaximumValueExported(mob)
endfunction
exported function GetStaminaRegenRateExported(mob)
endfunction
exported function GetStaminaMaximumValueExported(mob)
endfunction
exported function GetManaRegenRateExported(mob)
endfunction
exported function GetManaMaximumValueExported(mob)
endfunction
Having that function just in the regen.src --> no problems Pol starts normally
Having that function used as regen and max value functions from vitals.cfg Pol wont start and complains about missing exported function in regen.src and the problem why it wont start that time is because the max value and regen functions only accepts 1 parameter, ecompile doesnt complain about this because its no error in the code itself
Tried the same code just changing that testfor099 function to only have parameter who and SetWarMode( 0 ) ---> no problems starting pol
Re: Problem starting POL
Posted: Mon Aug 05, 2013 1:59 am
by xeon
S**t, why instead I get that error??
If I comment the "use npc;" line, I don't get anymore the error.
I'm now trying to restructure the include files used by my regen.src to not include the "use npc;" directive...
Re: Problem starting POL
Posted: Mon Aug 05, 2013 4:44 am
by xeon
I finally succedeed in starting POL by removing all the "use npc;" directives from my include chain.
Strange but true...
Re: Problem starting POL
Posted: Sat Aug 17, 2013 11:34 am
by CWO
'use' shouldn't be used in includes. Only in sources. It drives me insane to see a 'use x;' in a .inc file.
Re: Problem starting POL
Posted: Sun Aug 18, 2013 6:09 am
by Yukiko
Now there you go again CWO promoting good coding practice!
How do you expect any of us to write sloppy code when there are folks like you going around trying to coerce us into cleaner more readable source code?
But seriously that's a good point.
Re: Problem starting POL
Posted: Mon Aug 26, 2013 1:14 am
by xeon
CWO wrote:'use' shouldn't be used in includes. Only in sources. It drives me insane to see a 'use x;' in a .inc file.
I do not agree with that.
Suppose your .inc file is a black box. If you don't put "use ..." statements inside it, you have to put them in your .src. And to know which modules you need, your only way is "edit - compile - look which module ecompile states is missing" in a loop.
So to me it makes sense to put "use " statements inside .inc