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
Script Help Making it so Slime Damage can Kill, need help!
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#8
RE: Making it so Slime Damage can Kill, need help!

(08-15-2014, 08:46 PM)MrBehemoth Wrote:
(08-15-2014, 08:34 AM)Romulat✪r (✿◠‿◠) Wrote: A float is a decimal number between 0 and 100.

That's not quite true, Rom. 0-100 wouldn't be much use.

A float has the range +/- 3.402823466e+38, or in other words between -340,282,346,600,000,000,000,000,000,000,000,000,000 and 340,282,346,600,000,000,000,000,000,000,000,000,000.

The bigger the number is (in either positive or negative direction) the less precise it becomes.

Also, DaPurpleHippo, try this:

void OnStart()
{
    AddEntityCollideCallback("Player", "checkpoint_00", "Restart", true, 1);
    AddEntityCollideCallback("Player", "damage_zone01", "EnterToxicGas", false, 0);
    SetGlobalVarInt("InToxicGas", 0);
}

void Restart(string &in asParent, string &in asChild, int alState)
{
    CheckPoint("FirstCheckpoint", "respawn_001", "Happening", "DeathCategory", "Deathtext");
}

void EnterToxicGas(string &in asParent, string &in asChild, int alState)
{
    if(alState == 1)
    {
        SetGlobalVarInt("InToxicGas", 1);
        AddTimer("ToxicGasTimer", 0.0f, "ToxicGasCheck");
    }
    else
    {
        SetGlobalVarInt("InToxicGas", 0);
    }
}

void ToxicGasCheck(string &in asTimer)
{
    if(GetGlobalVarInt("InToxicGas") == 1)
    {
        GivePlayerDamage(25.0f, "blood", false, true);
        AddTimer("ToxicGasTimer", 2.0f, "ToxicGasCheck");
    }
}

For the sake of the code in this case, I probably should have mentioned that the float should be between 0 and 100 because the health range is 0 <= x <= 100.
Regardless, I stand corrected Smile

Discord: Romulator#0001
[Image: 3f6f01a904.png]
08-15-2014, 11:25 PM
Find


Messages In This Thread
RE: Making it so Slime Damage can Kill, need help! - by Romulator - 08-15-2014, 11:25 PM



Users browsing this thread: 1 Guest(s)