Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rounding off.
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#10
RE: Rounding off.

Ok, so this is interesting.

This is how my script looks.

Base damage
PHP Code: (Select All)
if(GetGlobalVarString("Move") == "Dust")
    {
        
SetLocalVarInt("BaseDamage"RandInt(1,2));
    } 

Damage calculation
PHP Code: (Select All)
if(GetGlobalVarInt("FriendlyMonsterLevel") != GetLocalVarInt("EnemyMonsterLevel"))
        {
            
SetLocalVarInt("levelDifference"GetGlobalVarInt("FriendlyMonsterLevel")-GetLocalVarInt("EnemyMonsterLevel"));
            
            
SetLocalVarFloat("damageMult", (GetLocalVarInt("levelDifference")/3)*0.5);
        }
        else
        {
            
SetLocalVarFloat("damageMult"0);
        }

        
SetLocalVarFloat("Damage"GetLocalVarInt("BaseDamage")+GetLocalVarFloat("DamageMult"));
        if(
GetLocalVarFloat("Damage") <= 0)
        {
            
//SetLocalVarFloat("Damage", 0);
        
}
        
AddDebugMessage("DAMAGE BEFORE = "+GetLocalVarFloat("damage"), false);
        
AddLocalVarInt("FriendlyMonsterHealth", -Floor(GetLocalVarFloat("damage")));
        
AddDebugMessage("DAMAGE = "+GetLocalVarFloat("damage"), false); 

For some reason end damage = 0
It really shouldn't


EDIT: NEVERMIND! I got it to work.

Trying is the first step to success.
(This post was last modified: 08-25-2014, 12:46 PM by FlawlessHappiness.)
08-25-2014, 12:00 PM
Find


Messages In This Thread
Rounding off. - by FlawlessHappiness - 08-24-2014, 04:33 PM
RE: Rounding off. - by Romulator - 08-24-2014, 04:55 PM
RE: Rounding off. - by Mudbill - 08-24-2014, 05:55 PM
RE: Rounding off. - by FlawlessHappiness - 08-24-2014, 07:07 PM
RE: Rounding off. - by Mudbill - 08-24-2014, 07:58 PM
RE: Rounding off. - by FlawlessHappiness - 08-24-2014, 10:27 PM
RE: Rounding off. - by MrBehemoth - 08-24-2014, 11:16 PM
RE: Rounding off. - by Daemian - 08-24-2014, 11:40 PM
RE: Rounding off. - by MrBehemoth - 08-25-2014, 12:25 AM
RE: Rounding off. - by FlawlessHappiness - 08-25-2014, 12:00 PM
RE: Rounding off. - by TheGreatCthulhu - 08-25-2014, 05:34 PM
RE: Rounding off. - by Romulator - 08-26-2014, 04:21 PM



Users browsing this thread: 3 Guest(s)