Standalone [1.3] tModLoader - A Modding API

Idea:
tModMaker
This would be just a compiler for tModLoader Mods, for people who don't have Terraria, but want to make mods for it. It doesn't have the Terraria source code, so it would not check code, so is solely a .tmod compiler.
 
The pickaxe works and everything just i cant move left if im mining right, so how would i make it so i can move both ways and mine. With being stuck on one way each time.

And how would i go about animating furnaces. I have the sprite file set up for it.
Could you show the animation file (even if in a private conversation)? Then I can give you an example.

Hello everyone. I have a question. Is this good for newbie modders? I really wanted to make small mod, not big as Necro or Avalon mods. Problem is that Im completely new to modding. I can't even draw sprites properly but Im training. Is this program for launching mods only or also creating? By creating I mean that I can write items properties
not using such thing as Json etc. but using this program? Thanks for help. Im still gonna read documentation.
It might be, not really sure.
This program (or API) is solely for adding (selfmade) mods to the game. It's not as if you're going to create mods inside this program.
If you want to start creating a mod, I'd recommend learning C# (since that's the programming language required to make mods with this API), look at the help threads in the OP and have a look through the ExampleMod. If you want one-on-one explanation, you can always ask questions here or start a private conversation.
 
I'm trying to make a projectile half transparent. I fiddled around with the alpha value and with preDraw(), but I couldn't get it to work. Can anyone help me?
EDIT:nvrmind fixed it
 
How do I make it so when you have a certain accessory certain mobs spawn

like

checking for the accessory
then allowing the spawn params


I cant think straight


I just drank a whole monster in 5 seconds


I think im having cardiac arrest
 
How do I make it so when you have a certain accessory certain mobs spawn

like

checking for the accessory
then allowing the spawn params


I cant think straight


I just drank a whole monster in 5 seconds


I think im having cardiac arrest
You can make a property in your modPlayer that changes value when the accessory is equipped, and check that property in CanSpawn()
 
You can make a property in your modPlayer that changes value when the accessory is equipped, and check that property in CanSpawn()
example? I never used modplayer before
 
example? I never used modplayer before
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Mod
{
     public class Player : ModPlayer
{
     public bool accessoryOn;//this is the property Im talking about
}
}
 
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Mod
{
     public class Player : ModPlayer
{
     public bool accessoryOn;//this is the property Im talking about
}
}
Yes I know bool I just dont know how to use it in the sit im talking about
 
Yes I know bool I just dont know how to use it in the sit im talking about
In an if statement, you would use

((Player)player.GetModPlayer(mod, "Player")).accessoryOn

NOTE: You have to replace "Player" with another name because Player is already an existing class (ex: change "Player" to "myModPlayer" or something)
 
so...
if
{
((Player)player.GetModPlayer(mod, "Player")).accessoryOn
}
then
{
spawning params?
]

how do I get it to spawn thou? I dont want it to spawn instantly, like an item. I just want it to enable spawning of that mob.

Oh I just relized

public override float CanSpawn(NPCSpawnInfo spawnInfo)
{
If
{ ((Player)player.GetModPlayer(mod, "Player")).accessoryOn
}
then
{
return spawnInfo.spawnTileY < Main.rockLayer && !Main.dayTime ? 0.5f : 0f;
}
}
 
so...
if
{
((Player)player.GetModPlayer(mod, "Player")).accessoryOn
}
then
{
spawning params?
]

how do I get it to spawn thou? I dont want it to spawn instantly, like an item. I just want it to enable spawning of that mob.

Oh I just relized

public override float CanSpawn(NPCSpawnInfo spawnInfo)
{
If
{ ((Player)player.GetModPlayer(mod, "Player")).accessoryOn
}
then
{
return spawnInfo.spawnTileY < Main.rockLayer && !Main.dayTime ? 0.5f : 0f;
}
}
Yeah, just change "Player" to another name. Your code would allow your mob to spawn on the surface during day. Make sure, however, that CanSpawn() returns 0f if the accessoryOn is false
 
Yeah, just change "Player" to another name. Your code would allow your mob to spawn on the surface during day. Make sure, however, that CanSpawn() returns 0f if the accessoryOn is false
Does that mean it wont spawn?
[DOUBLEPOST=1457561402,1457561159][/DOUBLEPOST]
Yeah, just change "Player" to another name. Your code would allow your mob to spawn on the surface during day. Make sure, however, that CanSpawn() returns 0f if the accessoryOn is false
Also, its !Main.Day.Time. The ! means it wont, so it spawns at night ^_^
[DOUBLEPOST=1457561688][/DOUBLEPOST]One last thing, how do I make the bool go to true when I equip it?
 
thats nice thanks so much very very much
 
Does that mean it wont spawn?
[DOUBLEPOST=1457561402,1457561159][/DOUBLEPOST]
Also, its !Main.Day.Time. The ! means it wont, so it spawns at night ^_^
[DOUBLEPOST=1457561688][/DOUBLEPOST]One last thing, how do I make the bool go to true when I equip it?
Totally knew that ;)
In the Update() method of ModItem:
((Player)player.GetModPlayer(mod, "Player")).accessoryOn = true;
EDIT: also, in the PreUpdate() method of ModPlayer:
((Player)player.GetModPlayer(mod, "Player")).accessoryOn = false;
what this does is make it so that when the accessory is taken off the NPC wont spawn anymore
[DOUBLEPOST=1457564818][/DOUBLEPOST]
Does that mean it wont spawn?
and no, you would put the "return 0f;" outside of the if statement, like in an else statement.
this makes it so that the NPC wont spawn if you dont have the accessory on
 
Totally knew that ;)
In the Update() method of ModItem:
((Player)player.GetModPlayer(mod, "Player")).accessoryOn = true;
EDIT: also, in the PreUpdate() method of ModPlayer:
((Player)player.GetModPlayer(mod, "Player")).accessoryOn = false;
what this does is make it so that when the accessory is taken off the NPC wont spawn anymore
[DOUBLEPOST=1457564818][/DOUBLEPOST]
and no, you would put the "return 0f;" outside of the if statement, like in an else statement.
this makes it so that the NPC wont spawn if you dont have the accessory on
Can you make a quick example thing for me so I can easily copy paste it when I get back from dinner?
 
Can you make a quick example thing for me so I can easily copy paste it when I get back from dinner?
Player:

using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ModLoader;

namespace Mod
{
public class myModPlayer : ModPlayer
{
public bool accessoryOn = false;


public override void PreUpdate()
{
accessoryOn = false;
}

}
////////////////////////////////////////////////
Accessory:

using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ModLoader;

namespace Mod.Items
{
public class Accessory : ModItem
{
public override void SetDefaults()
{
item.name = "NPC Thingy";
item.width = 24;
item.height = 24;
item.toolTip = "Allows stuff to spawn";
item.value = Item.buyPrice(0, 10, 0, 0);
item.rare = 9;
item.accessory = true;
item.defense = 6;
}

public override void UpdateAccessory(Player player)
{
((myModPlayer)player.GetModPlayer(mod, "myModPlayer")).accessoryOn= true;
}


}
}
////////////////////////////////////////////////////////////////
NPC(just paste this in within your NPC class):

public override float CanSpawn(NPCSpawnInfo spawnInfo)
{
if(((myModPlayer)player.GetModPlayer(mod, "myModPlayer")).accessoryOn== true;)
{
return spawnInfo.spawnTileY < Main.rockLayer && !Main.dayTime ? 0.5f : 0f;
}
return 0f;
}
 
Player:

using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ModLoader;

namespace Mod
{
public class myModPlayer : ModPlayer
{
public bool accessoryOn = false;


public override void PreUpdate()
{
accessoryOn = false;
}

}
////////////////////////////////////////////////
Accessory:

using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ModLoader;

namespace Mod.Items
{
public class Accessory : ModItem
{
public override void SetDefaults()
{
item.name = "NPC Thingy";
item.width = 24;
item.height = 24;
item.toolTip = "Allows stuff to spawn";
item.value = Item.buyPrice(0, 10, 0, 0);
item.rare = 9;
item.accessory = true;
item.defense = 6;
}

public override void UpdateAccessory(Player player)
{
((myModPlayer)player.GetModPlayer(mod, "myModPlayer")).accessoryOn= true;
}


}
}
////////////////////////////////////////////////////////////////
NPC(just paste this in within your NPC class):

public override float CanSpawn(NPCSpawnInfo spawnInfo)
{
if(((myModPlayer)player.GetModPlayer(mod, "myModPlayer")).accessoryOn== true;)
{
return spawnInfo.spawnTileY < Main.rockLayer && !Main.dayTime ? 0.5f : 0f;
}
return 0f;
}
Thanks so much
 
Why is there a random winky face
 
Back
Top Bottom