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!
Pompidom
Posts: 497
Joined: Sun May 06, 2018 9:42 pm

Re: Ask a simple question, get a simple answer

Post by Pompidom »

Haven't had much time to test, but the tilting part doesn't seem to function.
The prison cage is a bad example since it's tilted by default. If you replace it by a healing potion, it's just spinning straight no matter what values you give to rotationAngles between 0 and 360.
kelly1111
Posts: 349
Joined: Sun Jan 20, 2013 6:28 pm

Re: Ask a simple question, get a simple answer

Post by kelly1111 »

Question about optimisation:

(under dungeon only)
What I am currently doing is using 13 levels with a 50 by 50 grid size. When designing my level layout... I am filling the left over spaces on the map with things ... squeezing rooms and stuff I need in the areas that are not yet used by my level on each map...
this gets a bit confusing for myself and takes alot of time to do right. ... I get lost in my own design !

My question is. Does it matter if I add more levels with a 50 by 50 grid that dont use all the empty (walltiles) so that in the end I get a less chaotic feel when designing my levels. Does it matter performance wise?

So for instance instead of 13 levels of 50 by 50 ... I make:

20 levels of 50 by 50 ... with more unused tiles -- but easier to navigate when designing
or 35 levels of 32 by 32 grid...

Does anyone know if the engine has level limits ? (or is it only objects placed that add to the strain on performance)

anyone ever made a map with more than 40 levels?
minmay
Posts: 2788
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

kelly1111 wrote: Wed Jul 11, 2018 2:33 pmMy question is. Does it matter if I add more levels with a 50 by 50 grid that dont use all the empty (walltiles) so that in the end I get a less chaotic feel when designing my levels. Does it matter performance wise?
Not really.
kelly1111 wrote: Wed Jul 11, 2018 2:33 pmDoes anyone know if the engine has level limits ?
There is no limit on the number of levels in a dungeon.
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.
Pompidom
Posts: 497
Joined: Sun May 06, 2018 9:42 pm

Re: Ask a simple question, get a simple answer

Post by Pompidom »

Code: Select all

function Quest2()
	local s = g1_dark_temple_pedestal_1.surface
	for _,e in s:contents() do
		if e.go.name == "fancy_skull" then
			e.go:destroy()
			playSound("secret")
			
			-- Here i want to decrement counter_2
		end
	end
end
What's the right command to decrement counter_2?
User avatar
THOM
Posts: 1280
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

counter_2.counter:decrement()
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: Ask a simple question, get a simple answer

Post by akroma222 »

Pompidom wrote: Tue Jul 10, 2018 6:01 pm Haven't had much time to test, but the tilting part doesn't seem to function.
The prison cage is a bad example since it's tilted by default. If you replace it by a healing potion, it's just spinning straight no matter what values you give to rotationAngles between 0 and 360.
Sorry for the late reply Pompidom,
Youre right, I cant get the rotating object to tilt in the same function either
If I place the method setWorldRotationAngles before setWorldPosition then the tilt angle is overriden and the object doesnt tilt (just rotates). If I place it after, the tilt happens - but no rotate.

Apologies, I think to do what you want in the same function, -Im guessing - you might need to use matrices
(which I cant help with unfortunately)
minmay
Posts: 2788
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

You're using the wrong axis. The y axis is the same one you're rotating it around, so offsetting its rotation on that axis won't give you any tilt. And again, stop trying to use setPosition() for this!

Here is an example of how to rotate an object around one axis and tilt it on another:

Code: Select all

function update()
	local tilt = 10
	local speed = 180
	potion_healing_2:setWorldRotationAngles(tilt, Time.currentTime()*speed, 0)
end
As usual, connect a TimerComponent with a timerInterval of 0 to this function.
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: 1280
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

Is it possible to add new sky materials?

In the main game exists only "day_sky" and "night_sky". But for ORRR3 I've added a material called "dark_sky" but it behaves odd after the first night cycle passed through. The sky now seems to be "greyish", clouds have weired colours, colours of objects in the distance seem to be erased and the sight of the objects seem to be nearly inverted.

Or is this just a problem of the editor mode?
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
minmay
Posts: 2788
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

Like the three water materials, the three sky materials have hardcoded behaviour. Instead of trying to duplicate them (which is not practical), you should use the onUpdate hook to modify them as needed. In fact, this is already done in mod_assets/rooms/minmay/babble/monsters/storm_guardian.lua.
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: 1280
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

I expected something like that...

I will have a look at your definitions to see what can be done.

Thanks once again.
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
Post Reply