ModNPC and ModProjectile classes (which you use for your custom NPCs & Projectiles respectively) have a hook called AI() (public override void AI()) , you can use it to make them do whatever it is you want them to do.Not sure if this has been asked but, i would like to know how to make custom ai for your npc/boss and how to get a blizzard staff effect for a weapon(i have the spread/offset of the projectile just cant get the trajectory correct).
Thanks,
Drok
To make a pickaxe, make a sword with a pickaxe texture and put a pick value in the JSON.
"pick": "100" for instance, that would give it 100% pickaxe power
As for putting custom items into recipes, I do that all the time!
When writing the recipe, instead of putting in
"items": { "Wood": 10, "Rock": 1 } <- that would not work
but instead
"items": { "Wood": 10, "internalModname:Rock" 1 } <- that will work
If you don't know your mod's internal name, you can find out in the ModInfo file your mod has.
R5 code (I suppose TheHuckleberryWill's code) does work for R11, the only conflict I have received from transfer from old code to R11 was thePeople like you are why I don't give up on things! But, does this work in r11? If so can you give me the updated sword code? 'Cause r5 code doesn't really work anymore :/
R5 code (I suppose TheHuckleberryWill's code) does work for R11, the only conflict I have received from transfer from old code to R11 was the
holy removal of constructors from CS files
but pickaxes dont need CS files, so his tutorial should be working for you
Just wondering the what is wrong with this JSON code, that causes it not to work.
Yes it's a weird code, but it doesn't craft or it simply does not exist.{
"name": "Wooden Spear Sword",
"displayName": "Wooden Spear Sword",
"texture": "Item/WoodenSpear",
"size": [64, 64],
"maxStack": 1,
"value": [0, 0, 0, 50],
"rare": 1,
"tooltip": "Sucky lookin spear!",
"useStyle": 1,
"useAnimation": 15,
"useTime": 15,
"damage": 5,
"knockback": 5,
"useSound": 4,
"autoReuse": true,
"useTurn": true,
"melee": true,
"recipes":[{
"items": { "Mushroom": 1 },
"tiles": ["Work Bench"],
"creates": 1
}]
}
(also I know not how to put the code in a fancy box!)
Try checking / clearing out your "documents/my games/terraria/tAPI" folder , or clear out the steam folder , reinstall terraria , then game launcher and then tAPI.I'm having trouble using tAPI, in terms of literally running it. I just installed r11 today, I'm running legit terraria 1.2.4.1 through steam on windows 7 and ive installed tAPI into my terraria directory as well as game launcher to manage it.
Yet, I cannot open it and all that shows up is this when I try to run it http://prntscr.com/4y88in
If anyone could help that would be appreciated, I used to use tConfig loads and wish to mod again, thanks
Thanks, Because I haven't played terraria since forever, I removed all game files after uninstalling and then did what you said, It seems to be working now so thank you and yay, I can mod again :3Try checking / clearing out your "documents/my games/terraria/tAPI" folder , or clear out the steam folder , reinstall terraria , then game launcher and then tAPI.
the file you uploaded is named marteauEnBeton.png.png <--- you have .png twice there , remove one.Hi everybody i post here to know if you could help me because i did some codes for a item and when i run a world with the mod tAPI just crash and i would like to know what is going wrong (i watched a video to do it and it is my first item :/ so i'm a litle frustrated)
{
"displayName": "marteau en béton",
"texture": "item/marteauEnBéton",
"size": [32, 32],
"maxStack": 99,
"value": [0, 5, 0, 0],
"tooltip": "c'est un marteau",
"recipes":
[{
"items": { "Dirt Block": 1 },
"tiles": [ "Work Bench" ],
"creates": 1
}]
}
i wrote this in french because.... i'm french LOL i also add the sprite of the item so you can see his name
thx for your rapid answer but still crashing and i forgot to mention that when i did this on r10 the game wasn't crashing but the item wasn't craftable and when i did it on r11 the game just crash
TAPI.Mods+LoadException: Eikesters Decoration Pack.tapi: TAPI.Mods+LoadException: Json "JsonData object" Missing texture: item/marteauEnB�ton
bei TAPI.ModJsonHandler.PropTexture(JsonData j, String key, IDictionary`2 dict, String defaultKey)
bei TAPI.ModJsonHandler.HandleItem(ModBase modBase, JsonData j, String fname)
bei TAPI.ModJsonHandler.Handle(ModBase modBase)
bei TAPI.Mod.<Load>b__0(BinBuffer bb)
bei TAPI.Mods.HandleTapiModFile(FPath path, Action`1 action)
bei TAPI.Mods.HandleModFile(FPath path, Action`1 action)
bei TAPI.Mod.Load()
bei TAPI.Mods.Load()
bei TAPI.Mods.Load()
Edit:
I tried to add your item and this is the crash:
Code:TAPI.Mods+LoadException: Eikesters Decoration Pack.tapi: TAPI.Mods+LoadException: Json "JsonData object" Missing texture: item/marteauEnB�ton bei TAPI.ModJsonHandler.PropTexture(JsonData j, String key, IDictionary`2 dict, String defaultKey) bei TAPI.ModJsonHandler.HandleItem(ModBase modBase, JsonData j, String fname) bei TAPI.ModJsonHandler.Handle(ModBase modBase) bei TAPI.Mod.<Load>b__0(BinBuffer bb) bei TAPI.Mods.HandleTapiModFile(FPath path, Action`1 action) bei TAPI.Mods.HandleModFile(FPath path, Action`1 action) bei TAPI.Mod.Load() bei TAPI.Mods.Load() bei TAPI.Mods.Load()
the Game can't handle chars like this, simply change all "é" to "e" (even the displayName because ingame you'd get it replaced with a '*'), also you dont need the "texture" parameter if the png filename is the same as the json filename
{
"displayName": "marteau en beton",
"size": [32, 32],
"maxStack": 99,
"value": [0, 5, 0, 0],
"tooltip": "c'est un marteau",
"recipes":
[{
"items": { "Dirt Block": 1 },
"tiles": [ "Work Bench" ],
"creates": 1
}]
}
just to clarify you changed the filenames to (because i meant all "é")?-snip-