Problem with Events

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.

Moderator: POL Developer

Post Reply
Nightson
Neophyte Poster
Posts: 33
Joined: Mon Apr 02, 2007 1:13 pm

Problem with Events

Post by Nightson »

Code: Select all

Event queue for pkg/clr/ai/dai_default.ecl is full, discarding event.
NPC Serial: 0x52be2e (1342 1066 0)
Event: struct{ source = <appobj:MobileRef>, type = 32 }
Why im getting this info all the time? its strange thing becouse source is another "npc" i most cases its npc with same AI. and this 2 or more npcs are walking all the time and that makes this error but why and how i can slove this?
User avatar
CWO
POL Expert
Posts: 1158
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Re: Problem with Events

Post by CWO »

You either have to reduce the amount of events these NPCs receive by disabling certain events you don't need at that exact moment or you have to find a way to cycle through the events quicker. This error just means there are too many events being held by this script at one time and it has to discard any subsequent events until it has more room for them.
Nightson
Neophyte Poster
Posts: 33
Joined: Mon Apr 02, 2007 1:13 pm

Re: Problem with Events

Post by Nightson »

but i have only enabled ENTEREDAREA / DAMAGE / ENGAGE thats all
Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: Problem with Events

Post by Turley »

If you enable enteredarea i think leftarea will also be activated.
What is your range parameter for enteredarea? Maybe it is to small and every move of one npc will result in an entered/leftarea event.
User avatar
CWO
POL Expert
Posts: 1158
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Re: Problem with Events

Post by CWO »

Also does your script sleep() or sleepms() around the time you start getting these errors?
Nightson
Neophyte Poster
Posts: 33
Joined: Mon Apr 02, 2007 1:13 pm

Re: Problem with Events

Post by Nightson »

Range is 25
and there is no sleep function only wait_for_event
User avatar
ncrsn
Grandmaster Poster
Posts: 255
Joined: Fri Feb 10, 2006 12:15 am

Re: Problem with Events

Post by ncrsn »

Make sure NPC is not on a moving boat with other mobiles on it.
Nightson
Neophyte Poster
Posts: 33
Joined: Mon Apr 02, 2007 1:13 pm

Re: Problem with Events

Post by Nightson »

He is not. It mostly happens in dunegons or graveyards...
Nightson
Neophyte Poster
Posts: 33
Joined: Mon Apr 02, 2007 1:13 pm

Re: Problem with Events

Post by Nightson »

Here is part of my mainprogram AI

Code: Select all

while(Gethp(self()))
    if(check < 5)
        ev := wait_for_event(2);
    elseif(petla < 20)
        ev := wait_for_event(10);
    else
        ev := sleep();
    endif
    
     if((RandomInt(30) > 25))
           clear_event_queue();
          endif 
 if(ev)
        case(ev.type)    
            EVID_DAMAGED:
            opponent := ev.source; fight();

            EVID_ENGAGED:
            opponent := ev.source; fight();

                     EVID_ENTEREDAREA:          
                            if(ev.source.acctname)
                            opponent := ev.source; fight();
                            endif  
                            
                            endcase
    elseif(!ispcs())
        check := check + 1;
    else
        check:= 0;
        soundsy(dzwiek1,dzwiek2);
    endif 
    
    szukaj_opponenta();
    if(opponent)
        fight();
    endif
    
chodzsobie();  

endwhile
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Problem with Events

Post by Yukiko »

Nightson wrote:Range is 25
and there is no sleep function only wait_for_event
I'm not sure but that range seems a bit high to me. In most of the scripts I looked at range seems to be set somewhere between 7 to 15 but I'm only going by what I've seen in other scripts. Lord knows I could be wrong.
: P
User avatar
CWO
POL Expert
Posts: 1158
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Re: Problem with Events

Post by CWO »

Mine are set at 8 and I very rarely get that.

Now that I actually look over the event that is being discarded... type = 32 is the SYSEVENT_LEFTAREA event.
Nightson
Neophyte Poster
Posts: 33
Joined: Mon Apr 02, 2007 1:13 pm

Re: Problem with Events

Post by Nightson »

i Have sloved this error. thx guys for your help
User avatar
ncrsn
Grandmaster Poster
Posts: 255
Joined: Fri Feb 10, 2006 12:15 am

Re: Problem with Events

Post by ncrsn »

Nightson wrote:i Have sloved this error. thx guys for your help
Thank you for telling us how'd you solve this.
Nightson
Neophyte Poster
Posts: 33
Joined: Mon Apr 02, 2007 1:13 pm

Re: Problem with Events

Post by Nightson »

i will paste fixed code later becouse i have to go out now.
Nightson
Neophyte Poster
Posts: 33
Joined: Mon Apr 02, 2007 1:13 pm

Re: Problem with Events

Post by Nightson »

Code: Select all

if(ev)
        case(ev.type)   
            EVID_DAMAGED:
            opponent := ev.source; fight();

            EVID_ENGAGED:
            opponent := ev.source; fight();

                     EVID_ENTEREDAREA:         
                            if(ev.source.acctname)
                            opponent := ev.source; fight();
                            endif 
                           
                            endcase
  [color=#FF0000]  elseif(!ispcs())
        check := check + 1; [/color] <- here was ma problem 
    else
        check:= 0;
        soundsy(dzwiek1,dzwiek2);
    endif 
Npc was getting events all the time and there was no chance to increase check so my sleep() wasnt calld
Post Reply