[Scripts,Assets] Small interesting additions

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!
Daveyx0
Posts: 11
Joined: Sat Nov 01, 2014 10:46 am
Location: Netherlands

[Scripts,Assets] Small interesting additions

Post by Daveyx0 »

Hey there,

I'm Daveyx0 and I'm quite new to the Grimrock modding scene. Besides this, I mainly mod for Minecraft which is quite something else. I decided to check this out for level design and lua experience.
So the last couple of days I came to know the community and the amazing content that everyone provides here. I also did some tinkering in the editor and got to know lua to a decent extent. After some fooling around I got some things done that I want to share with you. It might not be as amazing as some of the things around here, but I hope people will take the time to check it out.
Thanks for reading and thanks for all the amazing content on this site! Enjoy!

Most of these are made possible by the community.

Simple Fogs
Image
Description:
A very simple way to add a bit of "brrrr" atmosphere to your frozen area.
Code:
SpoilerShow

Code: Select all

defineObject{
	name = "frozen_sky",
	baseObject = "forest_day_sky",
	components = {
		{
			class = "Sky",
			--farClip = 1000,
			sunColor1 = vec(0.0,0.0,0.0,0),
			sunColor2 = vec(0.0,0.0,0.0,0),
			sunColor3 = vec(0.0,0.0,0.0,0),
			fogMode = "dense",
			fogColor1 = vec(0.05,0.2,0.2,0),
			fogColor2 = vec(0.05,0.2,0.2,0),
			fogColor3 = vec(0.05,0.2,0.2,0),
			fogRange = {4,40},
			ambientIntensity = 0.3,
			tonemapSaturation = 0.5,
		},
		{
			class = "FogParticles",
			texture = "assets/textures/particles/ice_guardian_smoke.tga",
			--texture = "assets/textures/particles/bubble.tga",
			--texture = "assets/textures/particles/fog_particle_cemetery.tga",
			color1 = vec(0.5,1.0,1.0,0),
			color2 = vec(0.5,1.0,1.0,0),
			color3 = vec(0.5,1.0,1.0,0),
			particleSize = 4.0,
			opacity = 0.4,
		},
		{
			class = "LensFlare",
			enabled = false,
		},
		{
			class = "Light",
			color = vec(0.5,1.0,1.0,0),
			type = "directional",
			castShadow = true,
			enabled = false,
		},
		{
			class = "Light",
			name = "ambient",
			type = "ambient",
			enabled = false,
		},
		{
			class = "LensFlare",
			enabled = false,
		},
	},
}
Image
Description:
Get the feeling of being inside a volcano with this fog.
Code:
SpoilerShow

Code: Select all

defineObject{
	name = "fire_sky",
	baseObject = "forest_day_sky",
	components = {
		{
			class = "Sky",
			--farClip = 1000,
			sunColor1 = vec(0.0,0.0,0.0,0),
			sunColor2 = vec(0.0,0.0,0.0,0),
			sunColor3 = vec(0.0,0.0,0.0,0),
			fogMode = "dense",
			fogColor1 = vec(0.05,0.0,0.0,0),
			fogColor2 = vec(0.05,0.0,0.0,0),
			fogColor3 = vec(0.05,0.0,0.0,0),
			fogRange = {16,40},
			ambientIntensity = 0.3,
			tonemapSaturation = 0.5,
		},
		{
			class = "FogParticles",
			texture = "assets/textures/particles/smoke_01.tga",
			--texture = "assets/textures/particles/ground_fog_dif.tga",
			--texture = "assets/textures/particles/firefly_dif.tga",
			--texture = "assets/textures/particles/bubble.tga",
			--texture = "assets/textures/particles/fog_particle_cemetery.tga",
			color1 = vec(1.0,0.2,0.1,0),
			color2 = vec(1.0,0.2,0.1,0),
			color3 = vec(1.0,0.2,0.1,0),
			particleSize = 4.0,
			opacity = 0.1,
		},
		{
			class = "Light",
			color = vec(0.2,0.0,0.0,0),
			type = "directional",
			castShadow = true,
			enabled = false,
		},
		{
			class = "Light",
			name = "ambient",
			type = "ambient",
			enabled = false,
		},
		{
			class = "LensFlare",
			enabled = false,
		},
	},
}
Lava pit: viewtopic.php?f=22&t=9141

Fancy Materials
Image
Description:
After tinkering around with materials thanks to Prozail's slime thread, I found out some neat ways to make it look like monsters are made from gold, ice and steel/silver. It's kind of experimental as it could possible be made to look better and my laptop is decent so I'm not sure about how much it affects fps. I chose wardens because it made the most sense to me. If you want to apply it to a different monster it could be that you have to adjust some of the values. No custom assets needed.
Code:
SpoilerShow

Code: Select all

defineObject{
	name = "golden_warden",
	baseObject = "warden",
	components = {
		{
			class = "Model",
			model = "assets/models/monsters/guardian.fbx",
			material = "golden_warden",
			storeSourceData = true,
		},
	},
}

defineObject{
	name = "ice_warden",
	baseObject = "warden",
	components = {
		{
			class = "Model",
			model = "assets/models/monsters/guardian.fbx",
			material = "ice_warden",
			storeSourceData = true,
		},
	},
}

defineObject{
	name = "steel_warden",
	baseObject = "warden",
	components = {
		{
			class = "Model",
			model = "assets/models/monsters/guardian.fbx",
			material = "steel_warden",
			storeSourceData = true,
		},
	},
}

defineMaterial{
	name = "golden_warden",
	diffuseMap = "assets/textures/monsters/guardian_dif.tga",
	specularMap = "assets/textures/monsters/guardian_spec.tga",
	normalMap = "assets/textures/monsters/guardian_normal.tga",
    shadeTex = "assets/textures/monsters/xeloroid_emissive.tga",
	shadeTexAngle = 1.0,
    crystalIntensity = 300,
    shader = "crystal",
	doubleSided = false,
	lighting = true,
	alphaTest = true,
	blendMode = "Opaque",
	textureAddressMode = "Wrap",
	glossiness = 100,
	depthBias = 0,
}

defineMaterial{
	name = "ice_warden",
	diffuseMap = "assets/textures/monsters/guardian_dif.tga",
	specularMap = "assets/textures/monsters/guardian_spec.tga",
	normalMap = "assets/textures/monsters/guardian_normal.tga",
    shadeTex = "assets/textures/monsters/goromorg_shield_shadetex.dds",
	shadeTexAngle = 1.0,
    crystalIntensity = 300,
    shader = "crystal",
	doubleSided = false,
	lighting = true,
	alphaTest = true,
	blendMode = "Opaque",
	textureAddressMode = "Wrap",
	glossiness = 100,
	depthBias = 0,
}

defineMaterial{
	name = "steel_warden",
	diffuseMap = "assets/textures/monsters/guardian_dif.tga",
	specularMap = "assets/textures/monsters/guardian_spec.tga",
	normalMap = "assets/textures/monsters/guardian_normal.tga",
	shadeTex = "assets/textures/monsters/skeleton_warrior_spec.tga",
	shadeTexAngle = 0.5,
    crystalIntensity = 100,
    shader = "crystal",
	doubleSided = false,
	lighting = true,
	alphaTest = true,
	blendMode = "Opaque",
	textureAddressMode = "Wrap",
	glossiness = 100,
	depthBias = 0,
}
Add to init.lua:

Code: Select all

import "assets/scripts/monsters/warden.lua"
import "assets/scripts/grimrock1/grimrock1_materials.lua"
Make sure that the code for the new wardens is loaded after calling the above 2 lines, else it will probably not find the warden object.

More Slimes!
Image
Description:
5 Different types of slimes (also thanks to Prozail for inspiration): Fire, Ice, Plasma (Shock), Dark and Poison. They all have appropriate materials and particles. Some have been changed to use the Melee Brain AI, because they use spells when up close to simulate elemental attacks. It also makes them quite powerful :P For now, you can simply balance the spells they cast. However I might add custom attacks later. Additionally, I still need to make new hit particles for each kind.
Download: http://www.mediafire.com/download/inbax ... aveyx0.zip
Add to init.lua:

Code: Select all

import "mod_assets/scripts/monsters/slimes.lua"
Coloured Torches + Holder
Image
Description:
5 new coloured torches. This pack includes 1 torch holder that holds all these kinds of torches (including the normal ones) and 10 new torch items (normal and everburning). This was quite the thing to make for me. I had many issues getting this one to work properly and now I'm still not sure if it works 100%. I had to make multiple atlas files as the torches seem to be forced to take index 130 on the gfxAtlas. It requires a bit of setup for you as well.
Instructions:
When put into a level, its ID will be coloured_torch_holder_1 or something. This will spawn the regular torch in the holder. Rename the holder to: blue_torch_holder_X to make a blue one spawn etc. There are: blue_torch_holder, red_torch_holder, yellow_torch_holder, green_torch_holder, purple_torch_holder and just torch_holder. Just name it for example: empty_holder to remove the torch at the start.
Also to make it work in the players hands:
The code below should be put in a script entity. The updateTorch() function should be called as often as possible, for example: I use a timer with an interval of 0.025 to call it constantly. If called to infrequently it appears to reset the torch light color rapidly. This needs to be set up every floor the torches can be used on, unless a party hook of some kind is used. You could choose to stop the function when no torch is hold, but I did not implement this. This one might get optimized with some suggestions from you guys.
Download: http://www.mediafire.com/download/78bqo ... aveyx0.zip
In a script entity:
SpoilerShow

Code: Select all

function updateTorch()

   for k = 1,2 do
   for i = 1,4 do

   local j = party.party:getChampionByOrdinal(i):getItem(k)
   if j ~= nil then

		if not(j.go:getComponent("torchitem") == nil) then
		
		if string.find(j:getFormattedName(), "Coloured") then
			party.torch:setColor(vec(1.3, 0.68, 0.35))
		elseif string.find(j:getFormattedName(), "Blue") then
			party.torch:setColor(vec(0.1, 0.4, 1.0))
		elseif string.find(j:getFormattedName(), "Red") then
			party.torch:setColor(vec(1.0, 0.1, 0.4))
		elseif string.find(j:getFormattedName(), "Green") then
			party.torch:setColor(vec(0.4, 1.0, 0.1))
		elseif string.find(j:getFormattedName(), "Yellow") then
			party.torch:setColor(vec(1.0, 0.8, 0.1))
		elseif string.find(j:getFormattedName(), "Purple") then
			party.torch:setColor(vec(0.5, 0.1, 1.0))
		elseif string.find(j:getFormattedName(), "Torch") then
			party.torch:setColor(vec(1.3, 0.68, 0.35))
			
		end
		end
	 end	
	end	
	end
end
Credit for the torch particle texture goes to AlmostHuman (it was in the grimrock 1 asset pack)

Death Bomb
Image
Description:
A new kind of bomb :D Based on the "Death" element in the game. New particles and icon. Does quite large amount of damage.
Download: http://www.mediafire.com/download/2i0v5 ... yx0_v3.zip

Tearable Castle Cloth and Dungeon Gobelin
ImageImage
Description:
Simple tearable cloth/goblin like in the first game. It seems that this was planned as most assets are in the game. I'm not sure if somehow has already done this; this is simply my version. It works but requires a bit of setup. Castle cloth and dungeon gobelin version.
Download: http://www.mediafire.com/download/5xhfj ... aveyx0.zip
Note: The download includes a possible gobelin normal map; however it looks pretty odd with it being applied. It did the same thing with the original normal map. I personally prefer the gobelin without it.
Setup:
Image
(Cannot be placed over wall tiles, only over manually placed walls/alcoves)
Please use this order:
- Place an alcove wall (any theme). Disable its surface + clickable components.
- Put the "cloth_alcove_whole" or "gobelin_alcove_whole" behind the alcove. (see image) If it's the castle cloth, make it face the alcove, else (gobelin) make it face the other way.
- Put a invisible wall behind the alcove. (see image) (putting the invisible wall first will make it so you cannot hit the cloth, so add it after the cloth)
- Put the items you want to receive in the surface component of cloth/gobelin. Leaving it empty will result into the surface being disabled, so it can also be placed in front of normal walls.
- Done

Other fun (and obvious)tips:
- Add the aquatic trait to the monster component to allow a monster to walk underwater (like the crab)

Enjoy and all suggestions for improvement are welcome!
Last edited by Daveyx0 on Wed Jan 07, 2015 7:35 pm, edited 14 times in total.
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

Re: [Scripts,Assets] Small interesting additions

Post by Drakkan »

Hello Daveyx0 !
Welcome to the forum, I have to say that these are high quality items you have shared. Thanks a lot for it, hope you will stay with us some time and share / create some other cool stuff !

I have tried some, here are some quick observations
- frozen weather is simple and nice. Probably little better close-vision should be nice (one more square ?) and not sure if distant particle is not too much bright. Could be fine with some snow asset which we curently do not have :/

- the torches are really amazing. Probably ou can put together all icons inside one atlas ? it will save like 4mb of size :)

- death bomb - when thrown I am getting error no death_bomb particle, have you forgotten to copy it or I have missed something ?

I will try the slimes eventually as well

thanks a lot !
D.
Breath from the unpromising waters.
Eye of the Atlantis
Daveyx0
Posts: 11
Joined: Sat Nov 01, 2014 10:46 am
Location: Netherlands

Re: [Scripts,Assets] Small interesting additions

Post by Daveyx0 »

Thanks Drakkan!
You are quite fast in testing them :D Thanks!

The death bomb should be fixed, I forgot the particle indeed.

The problem with the torches is that in-code it seems that the index for the torch-lit always resets to 131 whatever I do. I don't know the solution atm, so I will need to stick with 5 atlas files for now :(
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

Re: [Scripts,Assets] Small interesting additions

Post by Drakkan »

Daveyx0 wrote:Thanks Drakkan!
You are quite fast in testing them :D Thanks!

The death bomb should be fixed, I forgot the particle indeed.

The problem with the torches is that in-code it seems that the index for the torch-lit always resets to 131 whatever I do. I don't know the solution atm, so I will need to stick with 5 atlas files for now :(
yep that torch is little clunky, but still really nice scripting :)
btw I have small request if you are interested - I´d like to have "heat" fog - something similar to frozen just in red version for some lava caves :)
Breath from the unpromising waters.
Eye of the Atlantis
User avatar
TheStoryteller01
Posts: 20
Joined: Wed Dec 31, 2014 3:29 am
Contact:

Re: [Scripts,Assets] Small interesting additions

Post by TheStoryteller01 »

Love the Cold Fog and the new slimes - thanks for your hard work!

Hopefully LG2 will get a winter addition sometimes.
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: [Scripts,Assets] Small interesting additions

Post by akroma222 »

Death Bomb! :twisted:
Thanks daveyx0 for sharing!
And welcome again
Grimfan
Posts: 369
Joined: Wed Jan 02, 2013 7:48 am

Re: [Scripts,Assets] Small interesting additions

Post by Grimfan »

Some really nice stuff Davey. An instant addition to many a dungeon (including mine). I look forward to seeing more of your stuff in the future. :D
User avatar
Ciccipicci
Posts: 154
Joined: Mon Oct 08, 2012 12:55 am

Re: [Scripts,Assets] Small interesting additions

Post by Ciccipicci »

Wardens work perfectly and are great! The gold one will be a great guardian for an eventually dungeon treasure room addon! For the frozen fog I'm agree with Drakkan. The torches are amazing and the slimes are already part of my mod project. I'll test death bomb when you'll fix it.
Daveyx0
Posts: 11
Joined: Sat Nov 01, 2014 10:46 am
Location: Netherlands

Re: [Scripts,Assets] Small interesting additions

Post by Daveyx0 »

I toned down the frozen sky a bit and updated the code. Also added a WIP fire_sky which is basically a sky entity for hot areas. I made it a bit less foggy, as fire areas are often dark already (mine is at least).

I fixed the death bomb already, Ciccipicci :) Nice to know that the wardens work.

Also I've been working on some fire/lava themed caves:

Image
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

Re: [Scripts,Assets] Small interesting additions

Post by Drakkan »

fire seems cool. here are some ideas for improvement - if you check screen, up is fire fog, while down is original mine. Fire fog is curently really bright - it makes mine losing lots of its atmosphere as it removes the shadows completely. Probably somehow limit it ?
What I really love is the distance red fog - I woul even make it more dark red.Looking forward for some final version

Image
Breath from the unpromising waters.
Eye of the Atlantis
Post Reply