tAPI Getting Started with Modding

Status
Not open for further replies.
This is getting really annoying, as I have followed everything you've said (Put the two files together) and I keep getting this error:
TAPI.Mods+LoadException: Chazm's Miscellaneous Mod.tapi: TAPI.Mods+LoadException: Json "JsonData object" Missing default texture: Items/Weapons/ModInfo
at TAPI.ModJsonHandler.PropTexture(JsonData j, String key, IDictionary`2 dict, String defaultKey)
at TAPI.ModJsonHandler.HandleItem(ModBase modBase, JsonData j, String fname)
at TAPI.ModJsonHandler.Handle(ModBase modBase)
at TAPI.Mod.<Load>b__0(BinBuffer bb)
at TAPI.Mods.HandleTapiModFile(FPath path, Action`1 action)
at TAPI.Mods.HandleModFile(FPath path, Action`1 action)
at TAPI.Mod.Load()
at TAPI.Mods.Load()
at TAPI.Mods.Load()
Help right now would take all my worries off my back because I've even checked the files of MoreTools Weapons Mod and I've done exactly the same as them yet I have no success what so ever...i need it URGENTLY so I can continue, otherwise I'm just going to be stuck in a loophole forever...
Copy paste the json file in here so we can check it out, also what files do you have and what's their exact names.
 
note: the sprite is really bad.
{
"displayName": "Crystal Blade",
"size": [200, 200],
"maxStack": 1,
"value": [1,0,0,0],
"rare": 6,
"scale": 2,
"tooltip": "'Yeah, it looks rubbish, but at least it functions unlike yours!'",
"useStyle": 1,
"useAnimation": 6,
"useTime": 6,
"damage": 4623,
"knockback": 2,
"useSound": 1,
"autoReuse": true,
"useTurn": true,
"melee": true,

"recipes":
[{
"items": { "Crystal Shard": 999, "Hallowed Bar": 60, "Soul of Might": 500 },
"tiles": [ "Mythril Anvil" ],
"creates": 1
}]
}
Crystal Blade.png
 
note: the sprite is really bad.
{
"displayName": "Crystal Blade",
"size": [200, 200],
"maxStack": 1,
"value": [1,0,0,0],
"rare": 6,
"scale": 2,
"tooltip": "'Yeah, it looks rubbish, but at least it functions unlike yours!'",
"useStyle": 1,
"useAnimation": 6,
"useTime": 6,
"damage": 4623,
"knockback": 2,
"useSound": 1,
"autoReuse": true,
"useTurn": true,
"melee": true,

"recipes":
[{
"items": { "Crystal Shard": 999, "Hallowed Bar": 60, "Soul of Might": 500 },
"tiles": [ "Mythril Anvil" ],
"creates": 1
}]
}
View attachment 30356
What's the name of the files in your Items folder? The issue is it cannot find the default sprite for an item, which means there is an item in your folder with no default sprite (the default sprite must be a png file with the same exact name as the json file, file format side).
 
Crystal Blade.json
Crystal Blade.png
ModInfo.png
tAPImod.cs
tAPImod.json
This looks fairly confusing. Your directory's necessary files should be something like:
ModInfo.json
Items/CrystalBlade.png
Items/CrystalBlade.json
 
Rearranged it
Both the CrystalBlade files are in Items/Weapons
And yet it still isn't working.
 
But how do you code something to shoot projectile?
Code:
public static int NewProjectile(float X, float Y, float speedX, float speedY, int Type, int Damage, float Knockback, int Owner)
You'll need to replace float X with the x-coordinate of the center of the projectile, and float Y with the y-coordinate of the projectile's center.
Replace float speedX and float speedY with the projectile's speed... although to be honest for the demon scythe I'm not sure what to put there.
If you want to make a hostile demon scythe, replace int Type with 44. If you want a friendly (player-fired) one, make it 45.
int Damage is where the projectile's damage goes... but remember, if the projectile is a hostile one, this damage will actually get doubled!
Replace float Knockback with a number between 0 and 1, and replace int Owner with Main.myPlayer.
 
No. Same error as before:
Is your ModInfo.json file (if you have any) in your mod's main folder? What's inside it?
Also do you have any files other than the 3 I mentioned earlier? What's insite them if yes?
 
{
"displayName" : "Chazm's Miscellaneous Mod",
"author" : "Chazm",
"info" : "This is really just training... lol",
"internalName" : "PNova"
}
That's all.
No, this is all that I have right now
 
{
"displayName" : "Chazm's Miscellaneous Mod",
"author" : "Chazm",
"info" : "This is really just training... lol",
"internalName" : "PNova"
}
That's all.
No, this is all that I have right now
And it's still not working with the same exact error?
Also, if you don't mind, could you upload the mod's files?
 
I made a demon to use it. Do i still write Main.myPlayer? And what are x and y coordinates?
You'll still have to write Main.myPlayer, because on servers, that keeps track of whether the projectile came from a server or a client. Since the projectile is coming from an npc, the x and y coordinates are npc.Center.X and npc.Center.Y (assuming you're creating the projectile in the npc's .cs file).
 
And it's still not working with the same exact error?
Also, if you don't mind, could you upload the mod's files?
I really don't know how to. This forum doesn't support jsons anyway. But i'll try
 

Attachments

  • Chazm's Miscellaneous Mod.tapi
    20.7 KB · Views: 114
I really don't know how to. This forum doesn't support jsons anyway. But i'll try
The issue is the tAPImod.json file in your weapons folder. It's trying to load it as an item but there is no sprite for it. Given I see both it and its cs file are both blank, I'd suggest to delete them both altogether.
 
Status
Not open for further replies.
Back
Top Bottom