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 »

AFAIK you can't. It's a sore spot. People do it by importing the music as sound effects, but this means no compression, and problems with resuming playback.
Pompidom
Posts: 497
Joined: Sun May 06, 2018 9:42 pm

Re: Ask a simple question, get a simple answer

Post by Pompidom »

GameMode.playStream("myTrack")

Works perfectly fine in my mod on the millisecond.

It jumps from "ambient" to "combat tune" to "victory tune" onDie and then back to "ambient" when it needs to with some very basic scripting.
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 »

When I use GameMode.playStream(), the music stops when changing levels, and you cannot resume from where it was playing when it stopped. The regular (conventionally assigned) ambient tracks fade when transitioning levels, but they resume where they left off, upon arrival.
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

Isaac wrote: Sun Oct 13, 2019 6:29 amThe regular (conventionally assigned) ambient tracks fade when transitioning levels, but they resume where they left off, upon arrival.
No, they restart too.
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 »

minmay wrote: Sun Oct 13, 2019 7:51 am
Isaac wrote: Sun Oct 13, 2019 6:29 amThe regular (conventionally assigned) ambient tracks fade when transitioning levels, but they resume where they left off, upon arrival.
No, they restart too.
They did not for me, last night—but that was in the editor.. I did not test it in the game.

https://vimeo.com/366091640

Update: I did just test it in the game, and they do resume where they left off at the transition. :?
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

Oh, sorry, I thought you were talking about returning to a level after visiting one with a different ambient track, not going between levels that have the same ambient track.
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 »

Ah... I get what you mean; where returning upstairs would not resume the previous track where it left off. ;)
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 »

Heloo. Im using the fw hooks by jkos in my mod and im trying to get this to work:

Code: Select all

onPickUpItem = function(self, lock_pick_3)
counter_23.counter:decrement()
end
Basically when the party picks up the lock pick the counter should decrement but it does'nt what is wrong with my code?
Pompidom
Posts: 497
Joined: Sun May 06, 2018 9:42 pm

Re: Ask a simple question, get a simple answer

Post by Pompidom »

As far as I understand.

The speed of all the maps you're currently not on are updated only 1/10th?
Is this correct? Or how exactly does it work?

For example a timer with a 1 second interval will only update or "tick" every 10 seconds when you're not on the same map of the timer? I can see this clearly happening (for example npc actions ordering to a certain location while you're not on that map)

Now for example you are on map 1
a timer placed on map 2 set to "1" interval will tick every 10 seconds once now as long it gives a command to anything on map 2
I can still see this happening.

But I have this odd setup where you are on map 1, a timer on map 2 gets activated ordering an npc around on map 3.
slowing down the process to at least 1/100th.
Yes, I know it's silly and complicated, but that's what you get with multiple dimensions.
I "can" change it, but again, the speed the npc's move or reach their destination isn't important, neither is reaching their destination.
It's just to get their ass away from a thing they're standing in front off. And I'm too lazy to change all the things I have in place now.

Can I leave in these lazy mechanics or is there any way this can break the movement sequence? (by saving/loading or whatever)
I just let the game run and eventually after 20+ minutes, the npc does reach the intended target.
Again, the amount of time they take to reach their location is not important.

One of the many examples where this is happening:

Basically, in the ice dimension you need to help someone out who is freezing their ass off in his house. So you light up his fireplace with some wooden logs you carry around for whatever silly "grimrock reasons"
The cold peasant thanks you and now shuffles towards his fireplace at original speed.

Meanwhile in the normal dimension the same peasant in the same house is confused because the dimensions leak into eachother and out of nowhere his fireplace starts burning and he shuffles at 1/10th speed towards his fireplace. Telling you all about the strange things happening in his house when you get back into his house and his fireplace started burning brightly on its own.

In the fire dimension, the same peasant in the same house starts freaking out as there is a shortage of water, it's already freakishly hot out there and then his house changes into an oven even more with the fireplace suddenly burning bright!

In all 3 houses the peasants simply move away from a wall so you can take stuff from the wall alcove that was previously blocked by the peasants.
User avatar
7Soul
Posts: 209
Joined: Sun Oct 19, 2014 1:56 am
Location: Brazil

Re: Ask a simple question, get a simple answer

Post by 7Soul »

I'm getting this error message when casting a spell in game (not in the editor)

Code: Select all

[string "Champion.lua"]:0: attempt to index a nil value
stack traceback:
	[string "Champion.lua"]: in function 'addTrait'
	[string "Champion.lua"]: in function 'castSpell'
	[string "RunePanel.lua"]: in function 'endGesture'
	[string "RunePanel.lua"]: in function 'updatePanel'
	[string "AttackPanel.lua"]: in function 'update'
	[string "AttackPanel.lua"]: in function 'update'
	[string "Gui.lua"]: in function 'draw'
	[string "GameMode.lua"]: in function 'update'
	[string "Grimrock.lua"]: in function 'display'
	[string "Grimrock.lua"]: in main chunk
Happens immediately as the spell is cast, and only with the exported mod
Join the LoG discord server: https://discord.gg/ArgAgNN :D

My Mods
Post Reply