Crimsondeath
Active member
Hi again,
I'm using this script as onmodelcopyscript when enemies pick up a weapon or I give the weapon to them by special events:
The problem is that some "defense" values aren't changed properly (and don't know why).
For example:
I make an enemy inmune to ATK_NORMAL and very resistant to ATK_NORMAL54 like this:
Works fine until he pick up a weapon or I use weaponframe on him (or changeentityproperty(self, "weapon", 1); ), he keeps his ATK_NORMAL inmunity but ATK_NORMAL54 is completely vulnerable. I thought it was because the decimal value of ATK_NORMAL54 so I change the variable to float:
But don't work either.
I'm using this script as onmodelcopyscript when enemies pick up a weapon or I give the weapon to them by special events:
C++:
void main()
{
void self = getlocalvar("self");
void old = getlocalvar("old");
int iSpeed = getentityproperty(old,"speed");
int iAggre = getentityproperty(old,"aggression");
int iMaxJuggle = getentityproperty(old,"maxjugglepoints");
int iJuggle = getentityproperty(old,"jugglepoints");
int iBounce = getentityproperty(old,"bounce");
int iMprate = getentityproperty(old,"mprate");
int iRunS = getentityproperty(old,"running","speed");
int iRunY = getentityproperty(old,"running","jumpy");
int iRunX = getentityproperty(old,"running","jumpx");
int iRunL = getentityproperty(old,"running","land");
int iRunM = getentityproperty(old,"running","movez");
float iJumpS = getentityproperty(old,"jumpspeed");
float iJumpH = getentityproperty(old,"jumpheight");
int iStealth = getentityproperty(old,"stealth");
int iDetect = getentityproperty(old,"detect");
int iGrabForce = getentityproperty(old,"grabforce");
int iFalldie = getentityproperty(old,"falldie");
int iHostile = getentityproperty(old,"hostile");
int iCandamage = getentityproperty(old,"candamage");
int iProjectile = getentityproperty(old,"projectilehit");
int iOffScreenkill = getentityproperty(old,"offscreenkill");
int iBlockOdds = getentityproperty(old,"blockodds");
int iNodieblink = getentityproperty(old,"nodieblink");
int itHold = getentityproperty(old,"thold");
char iBlockpain = getentityproperty(old,"blockpain");
int iHostile = getentityproperty(old,"hostile");
int iCandamage = getentityproperty(old,"candamage");
int iProjectile = getentityproperty(old,"projectilehit");
int iDefense = getentityproperty(old,"defense", openborconstant("ATK_NORMAL"));
int iDefense2 = getentityproperty(old,"defense", openborconstant("ATK_NORMAL2"));
int iDefense3 = getentityproperty(old,"defense", openborconstant("ATK_NORMAL3"));
int iDefense4 = getentityproperty(old,"defense", openborconstant("ATK_NORMAL4"));
int iDefense5 = getentityproperty(old,"defense", openborconstant("ATK_NORMAL5"));
int iDefense6 = getentityproperty(old,"defense", openborconstant("ATK_NORMAL6"));
int iDefense7 = getentityproperty(old,"defense", openborconstant("ATK_NORMAL7"));
int iDefense8 = getentityproperty(old,"defense", openborconstant("ATK_NORMAL8"));
int iDefense9 = getentityproperty(old,"defense", openborconstant("ATK_NORMAL9"));
int iDefense10 = getentityproperty(old,"defense", openborconstant("ATK_NORMAL10"));
int iDefense23 = getentityproperty(old,"defense", openborconstant("ATK_NORMAL23"));
int iDefense24 = getentityproperty(old,"defense", openborconstant("ATK_NORMAL24"));
int iDefense26 = getentityproperty(old,"defense", openborconstant("ATK_NORMAL26"));
int iDefense27 = getentityproperty(old,"defense", openborconstant("ATK_NORMAL27"));
int iDefense28 = getentityproperty(old,"defense", openborconstant("ATK_NORMAL28"));
int iDefense29 = getentityproperty(old,"defense", openborconstant("ATK_NORMAL29"));
int iDefense30 = getentityproperty(old,"defense", openborconstant("ATK_NORMAL30"));
int iDefense31 = getentityproperty(old,"defense", openborconstant("ATK_NORMAL31"));
int iDefense50 = getentityproperty(old,"defense", openborconstant("ATK_NORMAL50"));
int iDefense51 = getentityproperty(old,"defense", openborconstant("ATK_NORMAL51"));
int iDefense52 = getentityproperty(old,"defense", openborconstant("ATK_NORMAL52"));
int iDefense53 = getentityproperty(old,"defense", openborconstant("ATK_NORMAL53"));
int iDefense54 = getentityproperty(old,"defense", openborconstant("ATK_NORMAL54"));
int iDefBurn = getentityproperty(old,"defense", openborconstant("ATK_BURN"));
int iDefShock = getentityproperty(old,"defense", openborconstant("ATK_SHOCK"));
changeentityproperty(self, "speed", iSpeed);
changeentityproperty(self, "aggression", iAggre);
changeentityproperty(self, "maxjugglepoints", iMaxJuggle);
changeentityproperty(self, "jugglepoints", iJuggle);
changeentityproperty(self, "bounce", iBounce);
changeentityproperty(self, "mpset", NULL(), NULL(), NULL(), iMprate, NULL(), NULL()); //SET MP RECOVERY RATE.
changeentityproperty(self, "running", iRunS, iRunY, iRunX, iRunL, iRunM);
changeentityproperty(self, "jumpspeed", iJumpS);
changeentityproperty(self, "jumpheight", iJumpH);
changeentityproperty(self, "stealth", iStealth);
changeentityproperty(self, "detect", iDetect);
changeentityproperty(self, "grabforce", iGrabForce);
changeentityproperty(self, "falldie", iFalldie);
changeentityproperty(self, "hostile", iHostile);
changeentityproperty(self, "candamage", iCandamage);
changeentityproperty(self, "projectilehit", iProjectile);
changeentityproperty(self, "offscreenkill", iOffScreenkill);
changeentityproperty(self, "blockodds", iBlockOdds);
changeentityproperty(self, "nodieblink", iNodieblink);
changeentityproperty(self, "thold", itHold);
changeentityproperty(self, "blockpain", iBlockpain);
changeentityproperty(self, "hostile", iHostile);
changeentityproperty(self, "candamage", iCandamage);
changeentityproperty(self, "projectilehit", iProjectile);
changeentityproperty(self, "defense", openborconstant("ATK_NORMAL"), iDefense);
changeentityproperty(self, "defense", openborconstant("ATK_NORMAL2"), iDefense2);
changeentityproperty(self, "defense", openborconstant("ATK_NORMAL3"), iDefense3);
changeentityproperty(self, "defense", openborconstant("ATK_NORMAL4"), iDefense4);
changeentityproperty(self, "defense", openborconstant("ATK_NORMAL5"), iDefense5);
changeentityproperty(self, "defense", openborconstant("ATK_NORMAL6"), iDefense6);
changeentityproperty(self, "defense", openborconstant("ATK_NORMAL7"), iDefense7);
changeentityproperty(self, "defense", openborconstant("ATK_NORMAL8"), iDefense8);
changeentityproperty(self, "defense", openborconstant("ATK_NORMAL9"), iDefense9);
changeentityproperty(self, "defense", openborconstant("ATK_NORMAL10"), iDefense10);
changeentityproperty(self, "defense", openborconstant("ATK_NORMAL23"), iDefense23);
changeentityproperty(self, "defense", openborconstant("ATK_NORMAL24"), iDefense24);
changeentityproperty(self, "defense", openborconstant("ATK_NORMAL26"), iDefense26);
changeentityproperty(self, "defense", openborconstant("ATK_NORMAL27"), iDefense27);
changeentityproperty(self, "defense", openborconstant("ATK_NORMAL28"), iDefense28);
changeentityproperty(self, "defense", openborconstant("ATK_NORMAL29"), iDefense29);
changeentityproperty(self, "defense", openborconstant("ATK_NORMAL30"), iDefense30);
changeentityproperty(self, "defense", openborconstant("ATK_NORMAL31"), iDefense31);
changeentityproperty(self, "defense", openborconstant("ATK_NORMAL50"), iDefense50);
changeentityproperty(self, "defense", openborconstant("ATK_NORMAL51"), iDefense51);
changeentityproperty(self, "defense", openborconstant("ATK_NORMAL52"), iDefense52);
changeentityproperty(self, "defense", openborconstant("ATK_NORMAL53"), iDefense53);
changeentityproperty(self, "defense", openborconstant("ATK_NORMAL54"), iDefense54);
changeentityproperty(self, "defense", openborconstant("ATK_BURN"), iDefBurn);
changeentityproperty(self, "defense", openborconstant("ATK_SHOCK"), iDefShock);
}
The problem is that some "defense" values aren't changed properly (and don't know why).
For example:
I make an enemy inmune to ATK_NORMAL and very resistant to ATK_NORMAL54 like this:
Code:
defense normal 0 0 1 0 21 0 0
defense normal54 0.10 0 1 0 0 0 0
Works fine until he pick up a weapon or I use weaponframe on him (or changeentityproperty(self, "weapon", 1); ), he keeps his ATK_NORMAL inmunity but ATK_NORMAL54 is completely vulnerable. I thought it was because the decimal value of ATK_NORMAL54 so I change the variable to float:
C++:
float iDefense54 = getentityproperty(old,"defense", openborconstant("ATK_NORMAL54"));
But don't work either.
