Solved There's an exception while executing script

Question that is answered or resolved.

Crimsondeath

Active member
"There's an exception while executing script"

Suddendly I got that error today in many scripts of my mod, until yesterday everything was working fine. I attach the log file.

I think is because the damageentity() function It's in all those scripts that crash the OpenBOR, I change some of them to changentityproperty and works good in some of them, but in others damageentity() was need it to work properly like this one:

Code:
void finish(int Damage, int x, int y, int z, int Face, char DamageType){ // Damage as slam finisher
   void self = getlocalvar("self");
   void target = getlocalvar("Target" + self);
   int SDir = getentityproperty(target,"direction");
   int DType = openborconstant(DamageType);
   int MDir;
   int hits = getentityproperty(self,"rush_count");

   if(Face==0){ // Same facing?
       MDir = SDir;
   }

   if(Face==1){ // Opposite facing?

     if(SDir==0){ // Facing left?
       MDir = 1;
     } else { MDir = 0;}
   }

   if(Face==2){ // Opposite facing?

     if(SDir==0){ // Facing left?
       MDir = 0;
     } else {
       MDir = 1;
     }
   }

   if(target==NULL())
   {
     target = getentityproperty(self, "opponent");
     setlocalvar("Target" + self, target);
   }
   if(target!=NULL())
   {
     int dir = getentityproperty(target,"direction"); //Get opponent's facing direction
     if(dir==0){ // Facing left?
       x = -x;
     }

     damageentity(target, self, Damage, 1, DType);
     hits = changeentityproperty(self, "rush_count", hits+1);
     tossentity(target, y, x, z); // Toss opponent ;)
     changeentityproperty(target, "direction", MDir);
   }
}

Did I have to update the OpenBOR version? I have the 6391 build, the last OpenBOR Version gives me the same errors too x.x.

I recently added "stealh" property to all entities, does it have anything to do with it?:

Code:
...
running    16 3.4 2 1 0
stealth 6 10 <--- stealth
risetime 200
...

Someone knows what happened? I can't keep working in my project now :( .

Thanks.

Edit:
It's the damageentity() function!
I deleted it and all those scripts works "good" but I turn it on again and the OpenBOR crash. Until yesterday the function was working fine.

"There's an exception while executing script"

Suddendly I got that error today in many scripts of my mod, until yesterday everything was working fine. I attach the log file.

I think is because the damageentity() function It's in all those scripts that crash the OpenBOR, I change some of them to changentityproperty and works good in some of them, but in others damageentity() was need it to work properly like this one:

Code:
void finish(int Damage, int x, int y, int z, int Face, char DamageType){ // Damage as slam finisher
   void self = getlocalvar("self");
   void target = getlocalvar("Target" + self);
   int SDir = getentityproperty(target,"direction");
   int DType = openborconstant(DamageType);
   int MDir;
   int hits = getentityproperty(self,"rush_count");

   if(Face==0){ // Same facing?
       MDir = SDir;
   }

   if(Face==1){ // Opposite facing?

     if(SDir==0){ // Facing left?
       MDir = 1;
     } else { MDir = 0;}
   }

   if(Face==2){ // Opposite facing?

     if(SDir==0){ // Facing left?
       MDir = 0;
     } else {
       MDir = 1;
     }
   }

   if(target==NULL())
   {
     target = getentityproperty(self, "opponent");
     setlocalvar("Target" + self, target);
   }
   if(target!=NULL())
   {
     int dir = getentityproperty(target,"direction"); //Get opponent's facing direction
     if(dir==0){ // Facing left?
       x = -x;
     }

     damageentity(target, self, Damage, 1, DType);
     hits = changeentityproperty(self, "rush_count", hits+1);
     tossentity(target, y, x, z); // Toss opponent ;)
     changeentityproperty(target, "direction", MDir);
   }
}

Did I have to update the OpenBOR version? I have the 6391 build, the last OpenBOR Version gives me the same errors too x.x.

I recently added "stealh" property to all entities, does it have anything to do with it?:

Code:
...
running    16 3.4 2 1 0
stealth 6 10 <--- stealth
risetime 200
...

Someone knows what happened?

Thanks.

Edit:
It's the damageentity() function!
I deleted it and all those scripts works "good" but I turn it on again and the OpenBOR crash. Until yesterday the function was working fine.

Edit SOLVED:
Ok I just know why some minutes ago xDDDDDDD.
I put exactly the same name to another function I was going to use for the same purpuse.

I'm sorry to everyone (I'm an idiot xd) please some mod delete this post, it's solved xd.
 

Attachments

Last edited:
@Crimsondeath,

What you call a "crash" is a deliberate, controlled shutdown. Look upstream in the log, and you will see the detailed error:

Code:
Can't translate constant #148680528

Script function 'openborconstant' returned an exception, check the manual for details.

 parameters: #148680528, 

 

********** An Error Occurred **********

*            Shutting Down            *


There's an exception while executing script 'Isolda' data/chars/isolda/isolda.txt

You are somehow passing openborconstant() a pointer value of #148680528 instead of a string constant name. The engine can't do anything with that, so it records the error and closes. You can also see the offending script file. This may not be the exact location depending on your use of #import and #include, but it will give you a starting point to look at.

HTH,
DC
 
Back
Top Bottom