Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-12-2006, 09:12 PM
Prozac Prozac is offline
one of the good guys
Prozac's Avatar
Join Date: Jan 2006
Posts: 245
Prozac is on a distinguished road
Send a message via AIM to Prozac
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 ...
Reply With Quote
  #2  
Old 01-12-2006, 09:35 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
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?
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #3  
Old 01-13-2006, 12:27 AM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to 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
Reply With Quote
  #4  
Old 01-13-2006, 12:51 AM
Moondeath_2 Moondeath_2 is offline
"..."
Moondeath_2's Avatar
Join Date: Jan 2006
Location: Far Far Away.
Posts: 238
Moondeath_2 is an unknown quantity at this point
Send a message via AIM to Moondeath_2 Send a message via MSN to Moondeath_2 Send a message via Yahoo to Moondeath_2
I also didn't have any problems i tested it on classic.
__________________
Aim: DarkFireXZ3
Email: [email protected] or [email protected]
Common Location: Unholy Nation
Gscript, Playerworld Rules, Support Center
Reply With Quote
  #5  
Old 01-13-2006, 12:53 AM
Riot Riot is offline
Delteria Management
Join Date: Nov 2003
Location: Seminole County, Florida
Posts: 280
Riot is on a distinguished road
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.
Reply With Quote
  #6  
Old 01-13-2006, 05:22 AM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
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;".
Reply With Quote
  #7  
Old 01-20-2006, 04:11 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
I tested the thing on Sanstrata Classic and it is not giving me any error (added the //#CLIENTSIDE line again)

Last edited by Admins; 01-22-2006 at 04:06 PM..
Reply With Quote
  #8  
Old 01-21-2006, 06:13 AM
Prozac Prozac is offline
one of the good guys
Prozac's Avatar
Join Date: Jan 2006
Posts: 245
Prozac is on a distinguished road
Send a message via AIM to Prozac
thank you all for testing it, I found that when I cleaned up the code to post it here, that removed the error.
Reply With Quote
  #9  
Old 01-21-2006, 07:52 AM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
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
__________________

Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:27 AM.


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