Standalone [1.3] tModLoader - A Modding API

if(player.reviveDebuff = false)
{
return false;
player.statLife += (player.statLifeMax * 0.3);
Main.NewText(player.name + " lives!", 0, 155, 55);
player.AddBuff(mod.BuffType("ReviveDebuff"), 18000);
}
likely because you mis-placed a return value, but that return value is still a problem.
return values go on the end:

if(player.reviveDebuff = false)
{
player.statLife += (player.statLifeMax * 0.3);
Main.NewText(player.name + " lives!", 0, 155, 55);
player.AddBuff(mod.BuffType("ReviveDebuff"), 18000);
return false;
}
same error still occuring
 
same error still occuring
Have you tried limiting parts of the code into /*notes*/?
That can reveal the location in the file?
also player.reviveDebuff = false wont work on an "if" statement "==" is needed on "if" statements
 
Have you tried limiting parts of the code into /*notes*/?
That can reveal the location in the file?
in the tmodloader it says error GlobalPlayer(21,4) : CS1513 if that helps
 
in the tmodloader it says error GlobalPlayer(21,4) : CS1513 if that helps
It does help:

public override void ResetEffects()
{
public bool reviveAngel = false;
public bool reviveDebuff = false;
}
it is stopping at "public" in "public bool reviveAngel = false;",
bool reviveAngel = false; would allow it to continue, but it would stop at "duplicate variable". try:
public override void ResetEffects()
{
reviveAngel = false;
reviveDebuff = false;
}

note: (only say "bool" first time)
 
It does help:

public override void ResetEffects()
{
public bool reviveAngel = false;
public bool reviveDebuff = false;
}
it is stopping at "public" in "public bool reviveAngel = false;",
bool reviveAngel = false; would allow it to continue, but it would stop at "duplicate variable". try:
public override void ResetEffects()
{
reviveAngel = false;
reviveDebuff = false;
}

note: (only say "bool" first time)
now I get error CS1061 stating that Terraria does not have a definition for reviveAngel
 
I meant like this:
public bool reviveAngel = false;
public bool reviveDebuff = false;
public override void ResetEffects()
{
reviveAngel = false;
reviveDebuff = false;
}

first time adds the definition, second calls it.
 
Please come to Discord for modding help, that's what it's for.
 
I meant like this:
public bool reviveAngel = false;
public bool reviveDebuff = false;
public override void ResetEffects()
{
reviveAngel = false;
reviveDebuff = false;
}

first time adds the definition, second calls it.
yeah wait that's how I had it though. It was already like that
 
yeah wait that's how I had it though. It was already like that
This is how you had it:
public bool reviveAngel = false;
public bool reviveDebuff = false;
public override void ResetEffects()
{
public bool reviveAngel = false;
public bool reviveDebuff = false;
}
 
This is how you had it:
public bool reviveAngel = false;
public bool reviveDebuff = false;
public override void ResetEffects()
{
public bool reviveAngel = false;
public bool reviveDebuff = false;
}
I put it like this
Code:
        public bool reviveAngel = false;
        public bool reviveDebuff = false;
        public override void ResetEffects()
        {
            reviveAngel = false;
            reviveDebuff = false;
        }

and it just gives me CS1061 error now.
 
I put it like this
Code:
        public bool reviveAngel = false;
        public bool reviveDebuff = false;
        public override void ResetEffects()
        {
            reviveAngel = false;
            reviveDebuff = false;
        }

and it just gives me CS1061 error now.
line number?
 
player. refers to the "player" file in terraria. since GlobalPlayer is not player it is refered to as "GlobalPlayer.".
however, you don't need to(you still can) say file name inside itself:
public override void Hurt (bool pvp, bool quiet, double damage, int hitDirection, bool crit)
{
for (int index1 = 3; index1 < 8 + player.extraAccessorySlots; ++index1)
{
if (player.reviveAngel = true)
{
if(player.reviveDebuff = false)
{
return false;
player.statLife += (player.statLifeMax * 0.3);
Main.NewText(player.name + " lives!", 0, 155, 55);
player.AddBuff(mod.BuffType("ReviveDebuff"), 18000);
}
}
}
}

to:

public override void Hurt (bool pvp, bool quiet, double damage, int hitDirection, bool crit)
{
for (int index1 = 3; index1 < 8 + player.extraAccessorySlots; ++index1)
{
if (reviveAngel = true)
{
if(reviveDebuff = false)
{
return false;
player.statLife += (player.statLifeMax * 0.3);
Main.NewText(player.name + " lives!", 0, 155, 55);
player.AddBuff(mod.BuffType("ReviveDebuff"), 18000);
}
}
}
}

also I asked for the line number because sometimes there are multiple errors, when one is fixed another may show up, that seemed likely here.
 
player. refers to the "player" file in terraria. since GlobalPlayer is not player it is refered to as "GlobalPlayer.".
however, you don't need to(you still can) say file name inside itself:
public override void Hurt (bool pvp, bool quiet, double damage, int hitDirection, bool crit)
{
for (int index1 = 3; index1 < 8 + player.extraAccessorySlots; ++index1)
{
if (player.reviveAngel = true)
{
if(player.reviveDebuff = false)
{
return false;
player.statLife += (player.statLifeMax * 0.3);
Main.NewText(player.name + " lives!", 0, 155, 55);
player.AddBuff(mod.BuffType("ReviveDebuff"), 18000);
}
}
}
}

to:

public override void Hurt (bool pvp, bool quiet, double damage, int hitDirection, bool crit)
{
for (int index1 = 3; index1 < 8 + player.extraAccessorySlots; ++index1)
{
if (reviveAngel = true)
{
if(reviveDebuff = false)
{
return false;
player.statLife += (player.statLifeMax * 0.3);
Main.NewText(player.name + " lives!", 0, 155, 55);
player.AddBuff(mod.BuffType("ReviveDebuff"), 18000);
}
}
}
}

also I asked for the line number because sometimes there are multiple errors, when one is fixed another may show up, that seemed likely here.
:( now a NEW error shows up. CS0266 line (60,27).
 
:( now a NEW error shows up. CS0266 line (60,27).
player.statLifeMax is an int, 0.3 is a double or float. try:

player.statLife += (player.statLifeMax/3);

also ints cannot use decimal points
 
player.statLifeMax is an int, 0.3 is a double or float. try:

player.statLife += (player.statLifeMax/3);

also ints cannot use decimal points
aw man I knew that, I'm so :red:ing dumb...
 
I'm gonna be so sad when tmodloader/Terraria updates, and so many mods will be lost. Like tears in the rain, scoob.
 
I'm gonna be so sad when tmodloader/Terraria updates, and so many mods will be lost. Like tears in the rain, scoob.
? Most mod authors including me update their mods with tmodloader/terraria?
 
? Most mod authors including me update their mods with tmodloader/terraria?
And I'm thankful for that. However, many mod makers have since moved on or stopped updating, like this RPG classes mod I enjoy. It will more than likely not survive the transition. Same with the Spirit mod, which I think the devs are having a hard time deciding whether to scrap it or not. it'd be hard to see these high quality mods be lost in the transition.
 
And I'm thankful for that. However, many mod makers have since moved on or stopped updating, like this RPG classes mod I enjoy. It will more than likely not survive the transition. Same with the Spirit mod, which I think the devs are having a hard time deciding whether to scrap it or not. it'd be hard to see these high quality mods be lost in the transition.
oh, I thought it was just tremer...
 
Back
Top Bottom