Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   code that makes a DLL error in v4 (https://forums.graalonline.com/forums/showthread.php?t=63386)

Prozac 01-12-2006 09:12 PM

code that makes a DLL error in v4
 
Here is the bulk of (not the entirety as to comply with rules) some code that causes a dll error. Works fine offline, lots of
"Access violation at address 0265B11F in module 'GrallEngine.dll. Read of address 000000D1" windows pop up.

PHP Code:

//#CLIENTSIDE
if (created || playerenters)
  {
  
showsay 0;
  
message;
  
this.angle=0;
  
this.radius=9//radius from player
  
this.speed=.1//rotation speed
  
this.going=1//1=in, 0=out
  
this.newx=30;
  
this.newy=30;
  
this.inc=20;
  
this.nextinc=0;
  
this.hearts=15;
  
this.alive=1;
  
timeout=.07;
}

if (
timeout && this.alive==1)
  {
   
this.shoot1=int(random(0,20));
   if (
this.shoot1==1)
    {
shootball;}
   if (
this.nextinc this.inc)
    {
this.nextinc++;}
    if (
this.inc==this.nextinc)
     {
       
this.nextinc=0
       
move();
     }
    
   if (
x<playerx){x+=.5;}
   if (
x>playerx){x-=.5;}
   if (
y<playery){y+=.5;}
   if (
y>playery){y-=.5;}

  
timeout=.1;
}


if (
wa**** ||  waspelt || wasshot)
  {
  if (
this.hearts>0)
   {
    
this.hearts-=1;  
    
message OWIE!!!; 
    
this.angle=0
    
this.speed+=.1
   }
  if (
this.hearts<=0)
    {
    
//die
    
message NOOOOOO!; sleep 1;
    for (
this.a=0this.a<20this.a++)
      {
      
this.putx1=random(x+3,x-3);
      
this.puty1=random(y+3,y-3);
      
sleep .05;
      
putleaps 3,this.putx1,this.puty1;
    }
    
//regenerate
    
this.alive=0
    
set gotearthboss
    
hide
    
sleep 5
    
this.alive=1
    
this.hearts=7
    
show;
    
this.speed=.1
    
timeout=.7;
  }
}


function 
move()
  {
  if (
this.going==&& this.radius>1){this.radius--;}
  if (
this.going==&& this.radius<60){this.radius++;}
  if (
this.radius==60){this.going=1this.radius--;}
  if (
this.radius==1){this.going=0this.radius++;}
  
message;
  return;
}

function 
boom()
  {
  
this.putx=random(playerx-5,playerx+5);
  
this.puty=random(playery-5,playery+5);
  
hitplayer this.putx,this.puty,playerx,playery;
  
putleaps 3,this.putx,this.puty;
  
putleaps 2,this.putx,this.puty;
  return;


any help would be appreciated ...

ApothiX 01-12-2006 09:35 PM

I've noticed that putting controls other than bitmap, or textboxes inside scroll controls cause an error similiar to that, is that what you're doing?

Yen 01-13-2006 12:27 AM

Did you debug it to see what block is causing the error?
My guess is that it's the 'return;' line. Try 'return 0;' instead

Moondeath_2 01-13-2006 12:51 AM

I also didn't have any problems i tested it on classic.

Riot 01-13-2006 12:53 AM

I tested this code as you supplied, with the exception of adding a showcharacter so I could see it, and got no errors at all.

Tested on Delteria dev.

Rick 01-13-2006 05:22 AM

Quote:

Originally Posted by Yen
Did you debug it to see what block is causing the error?
My guess is that it's the 'return;' line. Try 'return 0;' instead

Just to let you know. In GScript2, "return;" actually does "return 0;".

Admins 01-20-2006 04:11 PM

I tested the thing on Sanstrata Classic and it is not giving me any error (added the //#CLIENTSIDE line again)

Prozac 01-21-2006 06:13 AM

thank you all for testing it, I found that when I cleaned up the code to post it here, that removed the error.

CheeToS2 01-21-2006 07:52 AM

Quote:

Originally Posted by Prozac
thank you all for testing it, I found that when I cleaned up the code to post it here, that removed the error.

Do you know what you changed? If you can find something that causes errors then it will make v4 more stable in the long run :)


All times are GMT +2. The time now is 08:35 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.