Problem starting POL

Here you can post threads specific to the current release of the core (099)

Moderator: POL Developer

xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy

Problem starting POL

Post 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??
RusseL
Forum Regular
Posts: 375
Joined: Fri Feb 20, 2009 8:30 pm

Re: Problem starting POL

Post by RusseL »

Upload better your vitals.cfg and regen.ecl :)
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy

Re: Problem starting POL

Post by xeon »

Mmmm I'd like to not make them public... do you mind if I send them to you?
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy

Re: Problem starting POL

Post 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.
RusseL
Forum Regular
Posts: 375
Joined: Fri Feb 20, 2009 8:30 pm

Re: Problem starting POL

Post by RusseL »

send me your script
User avatar
AsYlum
Grandmaster Poster
Posts: 109
Joined: Sun Feb 05, 2006 5:24 am
Location: Poland

Re: Problem starting POL

Post 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.
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy

Re: Problem starting POL

Post 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 ...
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy

Re: Problem starting POL

Post 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??
User avatar
AsYlum
Grandmaster Poster
Posts: 109
Joined: Sun Feb 05, 2006 5:24 am
Location: Poland

Re: Problem starting POL

Post 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.
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy

Re: Problem starting POL

Post 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.
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy

Re: Problem starting POL

Post 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? :(
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy

Re: Problem starting POL

Post 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?
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy

Re: Problem starting POL

Post 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.
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy

Re: Problem starting POL

Post by xeon »

Up
Someone with 099 which could verify?
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy

Re: Problem starting POL

Post by xeon »

No one can look into this issue? :(
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy

Re: Problem starting POL

Post by xeon »

Guys, I'm still struggling with this issue.
I've found that also a simple

Code: Select all

who.SetWarMode(value);
trigger that error starting POL.

But isn't that method valid for both PC and NPC?!
Tomi
POL Developer
Posts: 478
Joined: Tue Feb 21, 2006 5:08 pm

Re: Problem starting POL

Post by Tomi »

Have you tried using that method only for PCs instead of only for NPCs ?
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy

Re: Problem starting POL

Post 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?
Tomi
POL Developer
Posts: 478
Joined: Tue Feb 21, 2006 5:08 pm

Re: Problem starting POL

Post 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
Tomi
POL Developer
Posts: 478
Joined: Tue Feb 21, 2006 5:08 pm

Re: Problem starting POL

Post 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
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy

Re: Problem starting POL

Post 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...
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy

Re: Problem starting POL

Post by xeon »

I finally succedeed in starting POL by removing all the "use npc;" directives from my include chain.
Strange but true...
User avatar
CWO
POL Expert
Posts: 1159
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Re: Problem starting POL

Post 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.
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Problem starting POL

Post 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.
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy

Re: Problem starting POL

Post 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
Post Reply