NoSoap
Eye of Cthulhu
I haven't tried it before but I think you add this into projectile json.How do I make a projectile bounce?
"aiStyle": 8, // 8 for bounce
I haven't tried it before but I think you add this into projectile json.How do I make a projectile bounce?
Yes I have and I am really at a loss to why it does this at this point I might just make a source mod for myself to play onMaybe tAPI isn't being run with administrative privileges. Have you tried enabling administrative privileges?
NoScope already answered you, just set aiStyle to eight.How do I make a projectile bounce like Water Bolt?
game's code:I haven't tried it before but I think you add this into projectile json.
"aiStyle": 8, // 8 for bounce
this.name = "Water Bolt";
this.width = 16;
this.height = 16;
this.aiStyle = 8;
this.friendly = true;
this.alpha = 255;
this.timeLeft /= 2;
this.penetrate = 10;
this.magic = true;
i made it teleport the player to the coordinates. do i need to multiply them by 16?You need to override ModNPC like this:
Then override the SetupLootRules method. Here's an example from my mod:Code:[GlobalModAttribute] public class Dummy : ModNPC
Code:public override void SetupLootRules(NPC unused) { LootRule.settingUp = true; LootRule[] rules = new LootRule[1]; LootRule frostMoon = new LootRule("Frost Moon").Rules(new Func<NPC, bool>[]{LootRule.ruleFrostMoon}); Func<NPC, bool>[] small = {((NPC npc) => NPC.waveCount >= 11 && NPC.waveCount < 15)}; Func<NPC, bool>[] large = {((NPC npc) => NPC.waveCount >= 15)}; LootRule[] conditionals = new LootRule[2]; conditionals[0] = new LootRule(null).Rules(small).Chance((NPC npc) => 0.2 * (NPC.waveCount - 10)).Item("Bluemagic:Icicle"); conditionals[1] = new LootRule(null).Rules(large).Stack(4, 6).Item("Bluemagic:Icicle"); rules[0] = frostMoon.LootRules(conditionals); LootRule.AddFor("Ice Queen", rules); rules = new LootRule[1]; rules[0] = new LootRule(null).Item("Bluemagic:Bubble").Stack(5, 7); LootRule.AddFor("Duke Fishron", rules); rules = new LootRule[1]; LootRule pumpkinMoon = new LootRule("Pumpkin Moon").Rules(new Func<NPC, bool>[]{LootRule.rulePumpkinMoon}); small = new Func<NPC, bool>[]{((NPC npc) => NPC.waveCount >= 11 && NPC.waveCount < 15)}; large = new Func<NPC, bool>[]{((NPC npc) => NPC.waveCount >= 15)}; conditionals = new LootRule[2]; conditionals[0] = new LootRule(null).Rules(small).Chance((NPC npc) => 0.2 * (NPC.waveCount - 10)).Item("Bluemagic:ScytheBlade"); conditionals[1] = new LootRule(null).Rules(large).Stack(4, 6).Item("Bluemagic:ScytheBlade"); rules[0] = pumpkinMoon.LootRules(conditionals); LootRule.AddFor("Pumpking", rules); LootRule.settingUp = false; }
I'd recommend using Main.NewText to display the coordinates of all the spawns onto your screen. That way, you can make sure the code is being called and you'll know where to look.
Yeah, since tile coordinates are counted by tiles and entity coordinates are counted by pixels.i made it teleport the player to the coordinates. do i need to multiply them by 16?
Found a solution. apparently EmptyTileCheck doesn't work so well in checking multiple blocks at once... so i made it check the corners and the platform below all separately, and killing any tile in the way. now it works!Yeah, since tile coordinates are counted by tiles and entity coordinates are counted by pixels.
Figured it out. Here's an example if anyone needs it.Is there any way built-in way to modify character saving/loading?
public override void Save(BinBuffer bb)
{
#region Save "SaveFloatTest"
bb.Write(Main.localPlayer.position.X);
Main.NewText("Saved "+Main.localPlayer.position.X);
#endregion
}
public override void Load(BinBuffer bb)
{
try
{
#region Load "SaveFloatTest"
var flo=bb.ReadFloat();
Main.NewText("Loaded "+flo);
#endregion
base.Load(bb);
}
catch
{
}
}
public override void Save(BinBuffer bb)
{
var player=Main.localPlayer;
#region Save "Overhaul"
bb.Write(player.position);
for(var i=0;i<59;i++)
{
bb.Write(player.inventory[i].shootSpeed);
}
#endregion
base.Save(bb);
}
public override void Load(BinBuffer bb)
{
var player=Main.localPlayer;
try
{
#region Load "Overhaul"
setLater=new float[59];
positionOnLoad=bb.ReadVector2();
for(var i=0;i<59;i++)
{
var shootSpd=bb.ReadFloat();
setLater[i]=shootSpd;
}
#endregion
base.Load(bb);
}
catch
{
}
}
why do you use "var" for new variables? just use the specific types like "float" or "int" etcHalp? I'm saving and loading some things in ModPlayer, but it only works until i restart the game. (No errors, no wrong/default values, just like there's no such variables in save)
Any ideas?Code:public override void Save(BinBuffer bb) { var player=Main.localPlayer; #region Save "Overhaul" bb.Write(player.position); for(var i=0;i<59;i++) { bb.Write(player.inventory[i].shootSpeed); } #endregion base.Save(bb); } public override void Load(BinBuffer bb) { var player=Main.localPlayer; try { #region Load "Overhaul" setLater=new float[59]; positionOnLoad=bb.ReadVector2(); for(var i=0;i<59;i++) { var shootSpd=bb.ReadFloat(); setLater[i]=shootSpd; } #endregion base.Load(bb); } catch { } }
Why would i? =.=why do you use "var" for new variables? just use the specific types like "float" or "int" etc
What exactly do you mean? If you want them to rotate in different directions, you can always add to npc.rotation for one of them and subtract from npc.rotation for the other. Or if it's a single NPC with multiple rotating parts, you can call SpriteBatch.Draw in the PostDraw method.How would I make an NPC always rotate away from another NPC? Like this:
View attachment 46387
Nevermind about that, I changed my mind.What exactly do you mean? If you want them to rotate in different directions, you can always add to npc.rotation for one of them and subtract from npc.rotation for the other. Or if it's a single NPC with multiple rotating parts, you can call SpriteBatch.Draw in the PostDraw method.