Is there a updated level up script?

Dr. Scorpio

Member
This account is temporarily muted.
I tried using the newest version (OpenBOR 3.0 Build 6391) with the levelup script Pierwolf made a while back. It works.... but the normal "attack power" doesn't increase in the newer version. (It's been quiet a while since I have been here....)
 
I can see it when hitting enemies, I have the damage points visible.

Ah just as I thought. It's a bug with entity's takedamagescript. Damage value which the script could acquire doesn't include modified offense factor.
Ex: base damage is 2 and offense is multiplied by 3. If the damage is taken by entity, takedamagescript will only return 2 damage, even though the actual damage is 6.
 
Ah just as I thought. It's a bug with entity's takedamagescript. Damage value which the script could acquire doesn't include modified offense factor.
Ex: base damage is 2 and offense is multiplied by 3. If the damage is taken by entity, takedamagescript will only return 2 damage, even though the actual damage is 6.
Can you show me how to get around that bug? I noticed that base damage is actually increasing but it’s not showing it. I’m going to look into that takedamagescript after work in an hour.
 
This is what I used for ndamage.c.

void main()
{
int damage = getlocalvar("damage");
void self = getlocalvar("self");
int x, z, a, t;
void f;
if(damage)
{
x = getentityproperty(self, "x");
z = getentityproperty(self, "z")+1;
a = getentityproperty(self, "a")-50;
setspawnentry("name", "numflash");
while(damage)
{
t = damage % 10;
f = spawn();
changeentityproperty(f, "position", x,z,a);
updateframe(f, t);
damage/=10;
x -= 8;
}
f = spawn();
changeentityproperty(f, "position", x,z,a);
updateframe(f, 10);
}
}
 
Can you show me how to get around that bug? I noticed that base damage is actually increasing but it’s not showing it. I’m going to look into that takedamagescript after work in an hour.

I don't have any script for that yet. The best I could do right now is to assume that the upgrade affect at least attack1 type and I could acquire that to increase the damage value in the takedamagescript.

Couple hours later

I've managed to make workaround for this issue however it's not perfect due to how offense is acquired. What I mean is when offense value comes in floating number and when inputted to number producing script like this, it causes all zeros to be displayed as well.
Maybe someone could give better solution to this but here's the not perfect script:


I coded function to convert floating into integer to solve this for now.

Next day

I've discovered a better way to fix flaws of the workaround. Now the script becomes this:
Code:
void main()
{
   void self = getlocalvar("self");
   void Opp = getlocalvar("attacker"); //Get attacker
   int Buff = getentityproperty(Opp, "offense", openborconstant("ATK_NORMAL"));
   int damage = getlocalvar("damage");
   int x, z, y, t;
   void f;

   damage = Intego(damage*Buff);

   if(damage){
      x = getentityproperty(self, "x");
      z = getentityproperty(self, "z")+1;
      y = getentityproperty(self, "y")+50;
      setspawnentry("name", "numflash");

      while(damage){
         t = damage % 10;
         f = spawn();
         changeentityproperty(f, "position", x,z,y);
         updateframe(f, t);
         damage/=10;
         x -= 8;
      }
      f = spawn();
      changeentityproperty(f, "position", x,z,y);
      updateframe(f, 10);
   }
}

void Intego(int Value)
{
  int i = 0;

  while(i < Value){
    i = i+1;
  }

  return i;
}
 
Last edited:
Back
Top Bottom