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!
kelly1111
Posts: 349
Joined: Sun Jan 20, 2013 6:28 pm

Re: Ask a simple question, get a simple answer

Post by kelly1111 »

thanks Isaac. It worked.
I can add one flame.. but when I want more. for instance
parentnode: flame_01
parentnode: flame_02
parentnode: flame_03

each with a named empty in blender. It only shows 1 flame ingame and cant find the other parentnodes. Have not yet figured out why. Do you have any idea? ...is my hierachy wrong?

Image

hahah that was a bit too small

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

Re: Ask a simple question, get a simple answer

Post by minmay »

kelly1111 wrote: Tue Apr 23, 2019 12:53 pm I have to manually type in the coördinaties in the script definition - load the dungeon inside the editor to check of they are placed at the correct coordinaties, rince and repeat 20 times to place them at the right spot.

I think I am doing it wrong. Anyone have any suggestions on how to do it ?
This is the correct way to do it. Remember, you can easily see the coordinates of the selected object/vertex/whatever by pressing 'n' to bring up the panel with that information.
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
Skuggasveinn
Posts: 562
Joined: Wed Sep 26, 2012 5:28 pm

Re: Ask a simple question, get a simple answer

Post by Skuggasveinn »

kelly1111 wrote: Tue Apr 23, 2019 8:28 pm each with a named empty in blender. It only shows 1 flame ingame and cant find the other parentnodes. Have not yet figured out why. Do you have any idea? ...is my hierachy wrong?
I'm just guessing at your problem but if one shows up ingame then it stands to reason that they are all named the same, and the first gets overwritten by the second, and so on and you just have one particle defined in your lua code.
If you are going to have multiple particles nodes you need to name them differently in your object definition, maybe you forgot ?

Code: Select all

		{
			class = "Particle",
			particleSystem = "candle_flame",
			parentNode = "flame",
		},
		{
			class = "Particle",
                       name = "flame2"   -- perhaps this is missing for you !
			particleSystem = "candle_flame",
			parentNode = "flame_02",
		},
		{
			class = "Particle",
                        name = "flame3"  -- again unique name
			particleSystem = "candle_flame",
			parentNode = "flame_03",
		},
                   .. and so on

kind regards.
Skuggasveinn.
Link to all my LoG 2 assets on Nexus.
Link to all my LoG 1 assets on Nexus.
User avatar
Isaac
Posts: 3188
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

minmay wrote: Tue Apr 23, 2019 8:48 pmThis is the correct way to do it.
Agreed... but he asked for a different method.

@Skuggasveinn
That's the way to go when using nodes to position effects. However... instead of multiple particle components, one can use multiple emitters in the particle system; (that's how the castle candles work). But you have to offset them... so that the does lessen the advantage of using the empties.

The biggest advantage of using empties, is that they are animatable. 8-)
SpoilerShow
And in the case of candles, that means they can be made to burn downward; or made so that the burning candle can fall to the floor, if the shelf is destructible.
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: Ask a simple question, get a simple answer

Post by bongobeat »

any idea, how to make a mine_support_wall_01 (and _02) looks like a secret_wall on the automap? (a wall with 2 pillars)

Actually, if you don't put pillars on both side of the mine_support, the automap shows a "uncomplete" wall.

It's to put those objets withtout pillars (pillars will be placed after that, but they won't have an automap)

I've tried to make them like a secret door, but then you can't take item that are behind.
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
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 »

The most simple (but also a bit unelegant) solution would be to place some pillars at the right spot and give them elevation -1...
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: Ask a simple question, get a simple answer

Post by bongobeat »

well the goal of that, is to remove any pillar and replace them instead with an objet of 7 or 8 pillars (or more), so that will be the same if I put pillar under the floor.

Alsot I have try to put automap = -1, on all mine_support_wall and pillar, so the problem with the automap of the mine_support is removed, but on some case it is weird to not see a wall on the map, where a mine_support is alongside a door. Finally this is not the way I want.
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
Pompidom
Posts: 497
Joined: Sun May 06, 2018 9:42 pm

Re: Ask a simple question, get a simple answer

Post by Pompidom »

https://youtu.be/myXwU0oHrn0

My mod allows characters to die. As long at least 1 character survives during a tough encounter. Everything is fine. Dead characters will not miss out on experience. You can revive them in your house.

I'm making lots of "combat puzzles" the vampire being killed by opening the curtains as an example, meaning you will be chased relentlessly by enemies while having to solve a puzzle.
Many of these "combat puzzles" require to defeat your enemy by using the environment. Therefor in many puzzles characters will die a lot and it is perfectly ok for them to die without causing frustration to the player as long 1 character can solve the puzzle in time.

I'm using custom combat music every time you're in a tough encounter/battle. As soon the enemy is defeated, a short victory tune is played. Then the music returns to the default map tune.

I'd like some help with a script that changes the combat tune every time one of your party characters die. Playing darker and more ominous sounding tunes the closer you are to defeat. I don't know if it will be a worthwhile improvement over the current system I have in place right now because sometimes too much is too much, but at least i would like to give it a try.

I was thinking about simple scripts that activate whenever the "combat puzzle" begins and continously checks with a timer for the status of the party members. 4 heroes alive = standard combat music
3 heroes alive 2nd combat music tune
2 heroes alive 3rd combat music tune
1 hero alive 4th combat music tune

Something along the lines of:
timer_1 connected to music1() starts at the beginning of the encounter
timer_2 connected to music2()
tiemr_3 connected to music3()

Code: Select all

function music1()
	if 1 dead hero
	then gamestream.playstream combatmusic2
	timer_1.timer:stop()
	timer_2.timer:start()
end

function music2()
	if 2 dead heroes
	then gamestream.playstream combatmusic3
	timer_2.timer:stop()
	timer_3.timer:start()
end

function music3()
	if 3 dead heroes
	then gamestream.playstream combatmusic4
	timer_3.timer:stop()
end
Pompidom
Posts: 497
Joined: Sun May 06, 2018 9:42 pm

Re: Ask a simple question, get a simple answer

Post by Pompidom »

https://youtu.be/FmM71cJmyBY

Corpse creation. When fighting skeleton enemies, they will leave a skeleton corpse after they die.
So currently as seen in the video a corpse is currently created in front of the party every time a skeleton dies.
Whenever you kill the skeleton from a ranged distance this will create a corpse on the wrong square offcourse.

Code: Select all

function createcorpse()
	spawn("dm_floordecocorpse")
end
Now I was thinking making a lazy method of creating corpses on the right square. Since every monster will drop fixed items (in this case it will exactly drop 1 "skullcleave_6")
I was thinking about creating a simple script where it would search the location of the dropped item and then spawn a corpse there.

Code: Select all

 findEntity("skullcleave_6")
 spawn("dm_floordecocorpse")
Would this work? If yes, can anyone help me out with a script like this? Or is there a better way to create skeleton corpses on the right squares? I didn't find anything on the forum for it.

adding: to a custom monster definition should do the job I think
onDie = function(self)
spawn("dm_floordeco_corpse", self.go.level, self.go.x, self.go.y, self.go.facing, self.go.elevation)

But!
Can I use this in a script? The issue is that I can't really use it in a custom monster definition as I haven't created a custom monster definition. The skeletons are variations of G1 base trooper with custom weapons and shields in their hands. (torches in this case)
User avatar
Isaac
Posts: 3188
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

Why not make it a loot item?

Or... like you said with the onDie hook,

Code: Select all

onDie = function(self)
self.go:spawn('dm_floordeco_corpse')
end
Pompidom wrote: Tue Apr 30, 2019 10:59 pm But!
Can I use this in a script? The issue is that I can't really use it in a custom monster definition as I haven't created a custom monster definition. The skeletons are variations of G1 base trooper with custom weapons and shields in their hands. (torches in this case)
To use it in a script, create the onDie function in your script, and add a connector to the monster component's onDie hook (for each monster).

*When a connector is used to call a hook function, it cannot cancel the hook event by returning false; but you don't need it to in this case.
Post Reply