Page 1 of 1

How to make a custom weapon

Posted: Fri Jul 17, 2015 9:29 am
by barronvonburp
I am using
cloneObject{
name = "super_machete",
baseObject = "machete",
uiName = "Super Machete",
attackPower = 12,
damageType = "shock",
description = "This machete radiates with strange energy.",
}
Put it in the lua file, and reloaded and a got an error, how can i make custom weapons using defualt sprites and 3d graphics, for minimal effort, and performance impact.

Re: How to make a custom weapon

Posted: Fri Jul 17, 2015 9:37 am
by THOM
You do not use the correct definition format. In Log2 everything works with components. Have a look at the asset pack.

The definition of the original Machete looks like that:

Code: Select all

defineObject{
	name = "machete",
	baseObject = "base_item",
	components = {
		{
			class = "Model",
			model = "assets/models/items/machete.fbx",
		},
		{
			class = "Item",
			uiName = "Machete",
			gfxIndex = 23,
			impactSound = "impact_blade",
			weight = 2.2,
			traits = { "light_weapon", "sword" },
		},
		{
			class = "MeleeAttack",
			attackPower = 12,
			accuracy = 0,
			cooldown = 4.5,
			swipe = "horizontal",
		},
	},
	tags = { "weapon" },
}

Re: How to make a custom weapon

Posted: Fri Jul 17, 2015 9:41 am
by barronvonburp
I would like an explanation on why all this works, and how to find the asset pack to change weapons for myself.

Re: How to make a custom weapon

Posted: Fri Jul 17, 2015 10:00 am
by THOM
Look up on this side. The menu-entry "Modding" leads you to a lot of informations about this - a link to the assets-pack, a scripting reference and so on...

Also have a look at Skuggasveinns Editor Tutorials about using the editor: viewtopic.php?f=22&t=7055

And have a look at the modding Superthread with Links to other helpful threads: viewtopic.php?f=22&t=7972

Re: How to make a custom weapon

Posted: Fri Jul 17, 2015 10:12 am
by barronvonburp
I am unable to find a copy of the asset pack.

Re: How to make a custom weapon

Posted: Fri Jul 17, 2015 10:16 am
by THOM

Re: How to make a custom weapon

Posted: Fri Jul 17, 2015 10:20 am
by barronvonburp
In the words of a stick figure comic that i once saw, "I am not a smart man"
Edit: I just spent 5 minutes clicking the title because I didn't notice the download button.