Multiple damage types, one weapon

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Multiple damage types, one weapon

Post by Neikun »

On the topic of multiple damage types, one weapon, I would like to know: Is it possible?
ex. Physical and poison.
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: Multiple damage types, one weapon

Post 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?
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
User avatar
Edsploration
Posts: 104
Joined: Wed Sep 19, 2012 4:32 pm

Re: Multiple damage types, one weapon

Post 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,
}
Open Project -> Community FrankenDungeon: viewtopic.php?f=14&t=4276
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: Multiple damage types, one weapon

Post 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?
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
User avatar
Edsploration
Posts: 104
Joined: Wed Sep 19, 2012 4:32 pm

Re: Multiple damage types, one weapon

Post 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:
Open Project -> Community FrankenDungeon: viewtopic.php?f=14&t=4276
User avatar
HaunterV
Posts: 676
Joined: Mon Apr 16, 2012 9:54 pm
Location: Barrie, Ontario, Canada

Re: Multiple damage types, one weapon

Post 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?
Grimrock Community 'FrankenDungeon 2012. Submit your entry now!: http://tinyurl.com/cnupr7h
SUBMIT YOUR ASSETS! Community Asset Pack (C.A.P.): http://tinyurl.com/bqvykrp
Behold! The HeroQuest Revival!: http://tinyurl.com/cu52ksc
Lmaoboat
Posts: 359
Joined: Wed Apr 11, 2012 8:55 pm

Re: Multiple damage types, one weapon

Post 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)
}
User avatar
Montis
Posts: 340
Joined: Sun Apr 15, 2012 1:25 am
Location: Grimrock II 2nd playthrough (hard/oldschool)

Re: Multiple damage types, one weapon

Post 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,
}
When destiny calls, the chosen have no choice.

My completed dungeon (LoG1): Hypercube
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: Multiple damage types, one weapon

Post by Neikun »

I want to fill a room with daemon heads holding skulls in their mouths. >D
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
User avatar
Montis
Posts: 340
Joined: Sun Apr 15, 2012 1:25 am
Location: Grimrock II 2nd playthrough (hard/oldschool)

Re: Multiple damage types, one weapon

Post 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.
When destiny calls, the chosen have no choice.

My completed dungeon (LoG1): Hypercube
Post Reply