Ask a simple question, get a simple answer

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!
User avatar
zimberzimber
Posts: 432
Joined: Fri Feb 08, 2013 8:06 pm

Re: Ask a simple question, get a simple answer

Post by zimberzimber » Sun Mar 12, 2017 5:20 pm

1) Items can only have one attack, and secondary (aka power) attack

2) You must add this in the item component - secondaryAttack = "nameOfTheSecondaryAttack",

3) Not sure what do you need with "--WTF GOES HERE"

4) "if monster = "all the monsters i want" (i hope there's an easier way lol)"
You can give those specific monsters a trait in their definition, and then check if they have that trait when the effect should proc.
My asset pack [v1.10]
Features a bit of everything! :D

minmay
Posts: 2689
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay » Sun Mar 12, 2017 10:54 pm

secondaryAction, not secondaryAttack
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.

User avatar
Mysterious
Posts: 226
Joined: Wed Nov 06, 2013 8:31 am

Re: Ask a simple question, get a simple answer

Post by Mysterious » Tue Mar 21, 2017 8:26 am

RE: Animation Convertor.

Hi all.

I remember that somewhere in this forum there is a convertor to convert animations. I have a animation from LOG 1 and need to convert it to LOG 2. I remember you open the program and direct it to the animation and it converts it no worries at all.

Ty for any help.

EDIT:

I used GrimFBX. I dragged the ani file onto GrimFBX to convert and it does not work. The Editor gives me a error:
Invalid file_conversion (expected v2 got v1):

Ok so I guess I need to convert to v2 and I really cant rememeber what to do. It was not the file for Blender though, that much I do rememeber.

minmay
Posts: 2689
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay » Tue Mar 21, 2017 9:15 am

Mysterious wrote:I remember that somewhere in this forum there is a convertor to convert animations. I have a animation from LOG 1 and need to convert it to LOG 2. I remember you open the program and direct it to the animation and it converts it no worries at all.
It was here, but since it was on Dropbox it's gone now. You'd want to write a new converter anyway (or use the Blender plugin), however, so you can take advantage of Grimrock 2 animations' support for constant node location/rotation/scale (= smaller file size). Maybe I'll do that myself, it'd be really fast.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.

User avatar
Leki
Posts: 548
Joined: Wed Sep 12, 2012 3:49 pm

Re: Ask a simple question, get a simple answer

Post by Leki » Tue Mar 21, 2017 1:58 pm

...try this one to convert animations (not sure if it's LoG>LoG2 or LoG2>LoG):

GrimAnimConverter.exe inputfile [outputfile]

Tool is here.
I'm the Gate I'm the Key.
Dawn of Lore

kelly1111
Posts: 332
Joined: Sun Jan 20, 2013 6:28 pm

Re: Ask a simple question, get a simple answer

Post by kelly1111 » Sat Mar 25, 2017 10:53 pm

I have a question about texture offset. In the original asset pack there are two models:
- dungeon_wall_01
- dungeon_wall_02

the only difference I found between them is that the offset of the wall texture is shifted to the left (or right... you can see that the moss pattern repeats itself, but not in the same place). Also there is only one dungeon_wall_01 material definition.
how do you accomplish this offset ---- is this done in the grimrock model toolkit?

minmay
Posts: 2689
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay » Sat Mar 25, 2017 11:54 pm

kelly1111 wrote:I have a question about texture offset. In the original asset pack there are two models:
- dungeon_wall_01
- dungeon_wall_02

the only difference I found between them is that the offset of the wall texture is shifted to the left (or right... you can see that the moss pattern repeats itself, but not in the same place). Also there is only one dungeon_wall_01 material definition.
how do you accomplish this offset ---- is this done in the grimrock model toolkit?
https://en.wikipedia.org/wiki/UV_mapping
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.

User avatar
Mysterious
Posts: 226
Joined: Wed Nov 06, 2013 8:31 am

Re: Ask a simple question, get a simple answer

Post by Mysterious » Sun Mar 26, 2017 12:30 am

Thank you.

I have found the convertor I was looking for on a old hard drive its the same one Leki recommended. Sorry for the inconvenience guys. I knew I had it somewhere but I thought use might have it.

User avatar
THOM
Posts: 1167
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM » Sat Apr 01, 2017 11:04 pm

Is it true, that locks can just be triggered once???

I have a beach nexus lock and after using a key at it, it seems that I cannot use it a second time. And I can reproduce that behaviour with other locks, too.

If it is really true: is there a way to reactivate them then?
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download

minmay
Posts: 2689
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay » Sat Apr 01, 2017 11:38 pm

When a LockComponent is activated it gets disabled. You can re-enable it to allow it to be used again. Example:

Code: Select all

-- The coinslot consumes one coin with each click, decrementing coinsNeeded by 1
-- each time, until it reaches 0. Connectors added to the lock will trigger
-- every time a coin is inserted. Connectors added to coinsNeeded will trigger
-- only when all of the required coins have been inserted. Once coinsNeeded
-- reaches 0, additional coins will not be consumed.
-- If you wish for the lock to consume an infinite number of coins, set the
-- coinsNeeded value to a negative number.
defineObject{
	name = "dm_lock_coinslot",
	baseObject = "lock",
	components = {
		{
			class = "Model",
			model = "mod_assets/dmcsb_pack/models/env/dm_coinslot.fbx",
			offset = vec(0, 1.74, 0),
			staticShadow = true,
		},
		{
			class = "Clickable",
			offset = vec(0, 1.74, 0),
			size = vec(0.4, 0.4, 0.4),
			onClick = function(self)
				if self.go.lock:isEnabled() and getMouseItem() and getMouseItem().go.name == self.go.lock:getOpenedBy() then
					GameMode.dm_tempLockItem = getMouseItem()
				end
			end,
		},
		{
			class = "Lock",
			sound = "key_lock",
			openedBy = "dm_coin_gold",
			onActivate = function(self)
				local item = GameMode.dm_tempLockItem
				if item:getStackSize() > 1 then
					item:setStackSize(item:getStackSize()-1)
					setMouseItem(item)
				end
				GameMode.dm_tempLockItem = nil
				self:enable()
				self.go.coinsNeeded:decrement()
			end,
		},
		{
			class = "Counter",
			name = "coinsNeeded",
			value = 1,
			onActivate = function(self)
				self.go.lock:disable()
			end,
		},
	},
	tags = {"dm","dm_user"},
}
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.

Post Reply