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
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

*Is there a command-line switch to run the editor directly?

**Perhaps one to open the editor ~and specify the project file?
User avatar
Eleven Warrior
Posts: 746
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Ask a simple question, get a simple answer

Post by Eleven Warrior »

RE: Obstacle Unticked.

Ok I am using the Object: sx_autumn_forest_oak_cluster. I untick the (obstacle bow so the party can walk through the Tree Object.)
It works in the editor fine but, when I export my mod and try to walk through the tree object it stops me from walking through?

I disabled the (obstacle) so it seem imam doing something wrong or is it a bug? It seems when the Mod is exported the obstacle is turned back on lol
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

Eleven Warrior wrote:RE: Obstacle Unticked.

Ok I am using the Object: sx_autumn_forest_oak_cluster. I untick the (obstacle bow so the party can walk through the Tree Object.)
It works in the editor fine but, when I export my mod and try to walk through the tree object it stops me from walking through?

I disabled the (obstacle) so it seem imam doing something wrong or is it a bug? It seems when the Mod is exported the obstacle is turned back on lol
Item 3 in this post.
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
Eleven Warrior
Posts: 746
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Ask a simple question, get a simple answer

Post by Eleven Warrior »

Thxs Minmay. I think I get it now. The object sx_winter_forest_oak_cluster has minimalSaveState = true,. So that means when the game is saved it reverts back to it's original state correct? Even if I untick the obstacle Box it will revert back right?
User avatar
THOM
Posts: 1274
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

Even if I am not minmay: Yes, that's how it goes...
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

Eleven Warrior wrote:Thxs Minmay. I think I get it now. The object sx_winter_forest_oak_cluster has minimalSaveState = true,. So that means when the game is saved it reverts back to it's original state correct? Even if I untick the obstacle Box it will revert back right?
Yes. Well, it's not when the game is saved but rather when the game is loaded from a save. But other than that, you're correct.
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
THOM
Posts: 1274
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

How can i make a flying monster trigger a function?

Normally I would use a floortrigger that starts a script. Sadly, flying monsters doen't seem to activate floortriggers. Is there another way to do that?

One possibility that comes to my mind is to start a timer that runs a script that checks if the monster is on a certain tile - but this seems to me beeing a bit expensive.
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
User avatar
Zo Kath Ra
Posts: 937
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Ask a simple question, get a simple answer

Post by Zo Kath Ra »

THOM wrote:How can i make a flying monster trigger a function?

Normally I would use a floortrigger that starts a script. Sadly, flying monsters doen't seem to activate floortriggers. Is there another way to do that?

One possibility that comes to my mind is to start a timer that runs a script that checks if the monster is on a certain tile - but this seems to me beeing a bit expensive.
viewtopic.php?f=22&t=8083
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

I would consider just making the monster not fly. A floor trigger is a much better solution.
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
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

Code: Select all

--trigger script (works on specific monsters; checks position and elevation.)

do     --Add additional monster ids to the monster table.
	local monster = {"crowern_1"}
	
	for x = 1, #monster do
		findEntity(monster[x]).move:addConnector('onEndAction', self.go.id, 'triggerFunction')
	end
end

function triggerFunction(target)
	if	target.go.x == self.go.x  and target.go.y  == self.go.y and target.go.elevation == self.go.elevation then
		
		--Do something when triggered
		
			playSound("secret")
			hudPrint(target.go.id.." (a "..target.go.name.."), has triggered the function.")
		
		--
	end
end

--------------
(Trigger script is placed in the center tile.)
Image
Post Reply