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
Achtunging
Terrarian
My terraria went through this weird stage when I had tAPI. After I played a bit with my character, when I turned my computer off all my data on tAPI was erased. When I put the old files before my character/world files were erased, in the character selection screen where it should say my characters name it was completely blank. When I loaded my world save (which was not blank and normal), I crashed.
MODS:
Thorium+
TUWM
Dark Souls weapons
Ulterria
EDIT: Not sure but this was in my logs:
Ionic.Zip.ZipException: Cannot read that as a ZipFile
at Ionic.Zip.ZipFile.ReadIntoInstance(Ionic.Zip.ZipFile zf)
at Ionic.Zip.ZipFile.Read(System.String fileName, System.IO.TextWriter statusMessageWriter, System.Text.Encoding encoding, System.EventHandler`1[[Ionic.Zip.ReadProgressEventArgs, Ionic.Zip.Reduced, Version=1.9.1.9000, Culture=neutral, PublicKeyToken=null]] readProgress)
at Terraria.WorldFile.ActualLoadWorld(System.String world)
at Terraria.WorldFile.loadWorld()
at Terraria.WorldGen.playWorldCallBack(System.Object threadContext)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object state)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Ionic.Zip.BadReadException: Bad signature (0x00000066) at position 0x00000000
at Ionic.Zip.ZipEntry.ReadHeader(Ionic.Zip.ZipEntry ze, System.Text.Encoding defaultEncoding)
at Ionic.Zip.ZipEntry.ReadEntry(Ionic.Zip.ZipContainer zc, System.Boolean first)
at Ionic.Zip.ZipFile.ReadIntoInstance_Orig(Ionic.Zip.ZipFile zf)
at Ionic.Zip.ZipFile.ReadIntoInstance(Ionic.Zip.ZipFile zf)
MODS:
Thorium+
TUWM
Dark Souls weapons
Ulterria
EDIT: Not sure but this was in my logs:
Ionic.Zip.ZipException: Cannot read that as a ZipFile
at Ionic.Zip.ZipFile.ReadIntoInstance(Ionic.Zip.ZipFile zf)
at Ionic.Zip.ZipFile.Read(System.String fileName, System.IO.TextWriter statusMessageWriter, System.Text.Encoding encoding, System.EventHandler`1[[Ionic.Zip.ReadProgressEventArgs, Ionic.Zip.Reduced, Version=1.9.1.9000, Culture=neutral, PublicKeyToken=null]] readProgress)
at Terraria.WorldFile.ActualLoadWorld(System.String world)
at Terraria.WorldFile.loadWorld()
at Terraria.WorldGen.playWorldCallBack(System.Object threadContext)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object state)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Ionic.Zip.BadReadException: Bad signature (0x00000066) at position 0x00000000
at Ionic.Zip.ZipEntry.ReadHeader(Ionic.Zip.ZipEntry ze, System.Text.Encoding defaultEncoding)
at Ionic.Zip.ZipEntry.ReadEntry(Ionic.Zip.ZipContainer zc, System.Boolean first)
at Ionic.Zip.ZipFile.ReadIntoInstance_Orig(Ionic.Zip.ZipFile zf)
at Ionic.Zip.ZipFile.ReadIntoInstance(Ionic.Zip.ZipFile zf)
Achtunging
Terrarian
Update: When I create another character, the world also doesn't work.
Also, my character reset. I had all the files, but i'm not quite sure.
I only moved my world/player info into my Docs/Terraria/tAPI, not sure if it should've been somewhere else.
http://imgur.com/ed7s6oK,HC4iJEj#0
The second image is in my character folder.
(this is all in my Docs/Terraria/tAPI/Players folder.
Also, my character reset. I had all the files, but i'm not quite sure.
I only moved my world/player info into my Docs/Terraria/tAPI, not sure if it should've been somewhere else.
http://imgur.com/ed7s6oK,HC4iJEj#0
The second image is in my character folder.
(this is all in my Docs/Terraria/tAPI/Players folder.
Last edited:
Flaming Flamingo
Terrarian
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?
ravyn
Empress of Light
How could I edit the recipes of an already existing vanilla item? Like, remove a recipe, add one, etc.
Mirsario
Spazmatism
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
Code:
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;
MarioKart7z
Plantera
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?
MarioKart7z
Plantera
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.
EDIT: how can i make my tile make the blocks below it unbreakable? (like demon altars in vanilla)
Last edited:
Mirsario
Spazmatism
Is there any way built-in way to modify character saving/loading? I need to save one additional float for each item in player's inventory. Or atleast how can i know when the game is being saved/closed?
Last edited:
zadum4ivii
Official Terrarian
I have a question. What sound projectile uses when it hits a tile?
NoSoap
Eye of Cthulhu
Apologize if this has been brought up before but tAPI crashes during an ice queen fight, saying Reindeer Balls not found.
Mirsario
Spazmatism
Figured it out. Here's an example if anyone needs it.Is there any way built-in way to modify character saving/loading?
In ModPlayer:
Code:
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
{
}
}
MarioKart7z
Plantera
how can i make my tile make the blocks below it unbreakable?
Mirsario
Spazmatism
Halp? 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?
Edit: Somehow fixed it, but that fix does not even make any sense. Forget about it.
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
{
}
}
Edit: Somehow fixed it, but that fix does not even make any sense. Forget about it.
Last edited:
MarioKart7z
Plantera
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 { } }
Mirsario
Spazmatism
Why would i? =.=why do you use "var" for new variables? just use the specific types like "float" or "int" etc
///var vec=Vector2.Zero;
looks same as
///Vector2 vec=Vector2.Zero;
for C# compiler.
Learn before teaching.
Last edited:
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
Pumpking
Wall of Flesh
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.
You delete your post.
- Status
- Not open for further replies.
Similar threads
- Replies
- 0
- Views
- 98
-
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.