• PC 1.4.3: An eye for an eye, the Terraria x Don't Starve Together Crossover Update! Get all the details here. Found some bugs? Report them with as much detail as possible here.
  • Journey's End on Xbox and PlayStation!: Get all the info by clicking here. Click here for Known Issues and FAQ. For any other bugs, report them (with as much detail as possible) here.
  • SWITCH 1.4: Journey's End will launch on Switch January 4, 2022! More details here.
  • MOBILE NEWS: Stay up to date with the latest mobile news here. Report mobile bugs here

Standalone [1.3] tModLoader - A Modding API

Everybody

Terrarian
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
 

Quethed

Terrarian
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)
 

Everybody

Terrarian
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
 

Quethed

Terrarian
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.
 

Everybody

Terrarian
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
 

Quethed

Terrarian
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;
}
 

Everybody

Terrarian
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.
 

Quethed

Terrarian
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.
 

Everybody

Terrarian
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).
 

Pendromeda

Terrarian
? 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.
 

Quethed

Terrarian
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...
 
Top Bottom