How to make a custom weapon

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
barronvonburp
Posts: 30
Joined: Mon Jul 13, 2015 7:41 am

How to make a custom weapon

Post 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.
User avatar
THOM
Posts: 1281
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: How to make a custom weapon

Post 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" },
}
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
barronvonburp
Posts: 30
Joined: Mon Jul 13, 2015 7:41 am

Re: How to make a custom weapon

Post by barronvonburp »

I would like an explanation on why all this works, and how to find the asset pack to change weapons for myself.
User avatar
THOM
Posts: 1281
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: How to make a custom weapon

Post 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
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
barronvonburp
Posts: 30
Joined: Mon Jul 13, 2015 7:41 am

Re: How to make a custom weapon

Post by barronvonburp »

I am unable to find a copy of the asset pack.
User avatar
THOM
Posts: 1281
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: How to make a custom weapon

Post by THOM »

THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
barronvonburp
Posts: 30
Joined: Mon Jul 13, 2015 7:41 am

Re: How to make a custom weapon

Post 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.
Post Reply