Page 1 of 2

Multiple damage types, one weapon

Posted: Tue Sep 25, 2012 12:17 am
by Neikun
On the topic of multiple damage types, one weapon, I would like to know: Is it possible?
ex. Physical and poison.

Re: Multiple damage types, one weapon

Posted: Tue Sep 25, 2012 12:47 am
by Neikun
While on the subjects of what if's and is it possibles,
Is it possible to place an item in an alcove that the player cannot interact with?
ie a skull, but not one that the player can pick up?

Re: Multiple damage types, one weapon

Posted: Tue Sep 25, 2012 3:40 am
by Edsploration
Neikun wrote:While on the subjects of what if's and is it possibles,
Is it possible to place an item in an alcove that the player cannot interact with?
ie a skull, but not one that the player can pick up?
You can do exactly this with the party's onPickUpItem hook. This following code works on preventing the party from picking up and interacting with only the first item placed in dungeon_alcove_1. Be sure to change the id to whichever alcove you're using for this. If you want to prevent the player from interacting with ANY of the items in the alcove you'll need to create a loop to check each one by repeatedly calling the temp() function.

Code: Select all

cloneObject{
	name = "party",
	baseObject = "party",
	onPickUpItem = function(self, item) -- Called when any item is picked up
		local temp = dungeon_alcove_1:containedItems() -- Get the item list in dungeon_alcove_1
		if item == temp() then -- Is the item being picked up the first item in the alcove?
			return false -- If so, cancel the pickup action
		end
	end,
}

Re: Multiple damage types, one weapon

Posted: Tue Sep 25, 2012 3:43 am
by Neikun
I'm a little confused as to where I would place this script.
As it's a cloneObject, would it go in one of the mod_asset files?
objects.lua maybe?

Re: Multiple damage types, one weapon

Posted: Tue Sep 25, 2012 3:51 am
by Edsploration
I think pasting it into any of those files works fine. Personally, I like to keep my custom party definition in the monsters.lua file :lol:

Re: Multiple damage types, one weapon

Posted: Tue Sep 25, 2012 4:44 am
by HaunterV
Edsploration wrote:I think pasting it into any of those files works fine. Personally, I like to keep my custom party definition in the monsters.lua file :lol:

but where? the bottom of the document? does it matter?

Re: Multiple damage types, one weapon

Posted: Tue Sep 25, 2012 6:07 am
by Lmaoboat
You could also create a custom alcove like this if you don't want people placing any items in it.

Code: Select all

cloneObject{
name = "dungeon_alcove_decorative",
baseObject = "dungeon_alcove",
targetPos = vec(0,0,0),
targetSize = vec(0,0,0)
}

Re: Multiple damage types, one weapon

Posted: Tue Sep 25, 2012 9:58 am
by Montis
HaunterV wrote:
Edsploration wrote:I think pasting it into any of those files works fine. Personally, I like to keep my custom party definition in the monsters.lua file :lol:

but where? the bottom of the document? does it matter?
No it doesn't, as long as it's not inside other brackets.

I personally do put the cloned party script in the init.lua.

If you only want a very specific pre-placed item not be able to be picked up (e.g. a skull that you gave the ID "glued_skull") use this:

Code: Select all

cloneObject{
	name = "party",
	baseObject = "party",
	onPickUpItem = function(self, item) -- called when any item is picked up
		if item.id == "glued_skull" then
			return false -- cancel the pickup action
		end
	end,
}

Re: Multiple damage types, one weapon

Posted: Tue Sep 25, 2012 12:30 pm
by Neikun
I want to fill a room with daemon heads holding skulls in their mouths. >D

Re: Multiple damage types, one weapon

Posted: Tue Sep 25, 2012 12:44 pm
by Montis
Then you would probably want to replace the one line to

Code: Select all

if item.name == "demon_head_skull" then
And obviously create a cloned skull with that name.