Air Elemental Particles Questions

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!
Post Reply
Echoplex
Posts: 63
Joined: Tue Nov 04, 2014 10:59 pm

Air Elemental Particles Questions

Post by Echoplex »

Hello Community. I was hoping someone could help me understand the Air Elemental particles and its potential uses. Is it possible to give the Air Elemental particles to monsters other than the Uggardian instead of using their normal diffuse maps? Also I'm not entirely sure I understand how the Uggardian uses them in the first place. It looks like there is an UggardianFlames component that the Air Elemental particles replace. In messing around I was able to make a hybrid Uggardian that used the Uggardian Armor and replaced flames with the Air Elemental particles however Ive not been able to give them to other creatures without disastrous results. If someone could help me understand whats going on with these I would appreciate it. Thank you
User avatar
Skuggasveinn
Posts: 562
Joined: Wed Sep 26, 2012 5:28 pm

Re: Air Elemental Particles Questions

Post by Skuggasveinn »

Any monster can be come a pure particle effect like the air elemental.

Lets take the Sand Warg and change it to fire. (I know you asked for air elemental, but I just like fire :D )

The trick is to hide the model by placing enabled = false to the model class (you can also skip this and then the model is visable and simply on fire)
then we add the UggardianFlames class to the monster, and have emit the particles from all the materials the monster has
emitFromMaterial = "*"

(added notes to the code where you make changes)
SpoilerShow

Code: Select all

defineObject{
	name = "fire_warg",	--change the name
	baseObject = "base_monster",
	components = {
		{
			class = "Model",
			model = "assets/models/monsters/sand_warg.fbx",
			storeSourceData = true,
			enabled = false, -- disable the model
		},
		{
			class = "Animation",
			animations = {
				idle = "assets/animations/monsters/sand_warg/sand_warg_idle.fbx",
				moveForward = "assets/animations/monsters/sand_warg/sand_warg_walk.fbx",
				turnLeft = "assets/animations/monsters/sand_warg/sand_warg_turn_left.fbx",
				turnRight = "assets/animations/monsters/sand_warg/sand_warg_turn_right.fbx",
				moveForwardTurnLeft = "assets/animations/monsters/sand_warg/sand_warg_walk_turn_left.fbx",
				moveForwardTurnRight = "assets/animations/monsters/sand_warg/sand_warg_walk_turn_right.fbx",
				attack = "assets/animations/monsters/sand_warg/sand_warg_attack.fbx",
				getHitFrontLeft = "assets/animations/monsters/sand_warg/sand_warg_get_hit_front_left.fbx",
				getHitFrontRight = "assets/animations/monsters/sand_warg/sand_warg_get_hit_front_right.fbx",
				getHitBack = "assets/animations/monsters/sand_warg/sand_warg_get_hit_back.fbx",
				getHitLeft = "assets/animations/monsters/sand_warg/sand_warg_get_hit_left.fbx",
				getHitRight = "assets/animations/monsters/sand_warg/sand_warg_get_hit_right.fbx",
				fall = "assets/animations/monsters/sand_warg/sand_warg_get_hit_front_left.fbx",
				howl = "assets/animations/monsters/sand_warg/sand_warg_howl.fbx",
			},
			currentLevelOnly = true,
		},
		{
			class = "Monster",
			meshName = "sand_warg_mesh",
			hitSound = "warg_hit",
			dieSound = "warg_die",
			hitEffect = "hit_blood_black",
			capsuleHeight = 0.2,
			capsuleRadius = 0.7,
			health = 400,
			exp = 350,
			lootDrop = { 75, "warg_meat", 10, "warg_meat" },
			resistances = { ["poison"] = "weak" },
			traits = { "animal" },
			headRotation = vec(90, 0, 0),
		},
		{
			class = "WargBrain",
			name = "brain",
			sight = 5,
		},
		{
			class = "MonsterMove",
			name = "move",
			sound = "warg_walk",
			cooldown = 0.5,
		},
		{
			class = "MonsterTurn",
			name = "turn",
			sound = "warg_walk",
			resetBasicAttack = true,
		},
		{
			class = "MonsterMove",
			name = "moveForwardAndTurnRight",
			animations = { forward="moveForwardTurnRight" },
			sound = "warg_walk",
			turnDir = 1,
			cooldown = 2,
			resetBasicAttack = true,
		},
		{
			class = "MonsterMove",
			name = "moveForwardAndTurnLeft",
			animations = { forward="moveForwardTurnLeft" },
			sound = "warg_walk",
			turnDir = -1,
			cooldown = 2,
			resetBasicAttack = true,
		},
		{
			class = "MonsterAttack",
			name = "basicAttack",
			attackPower = 35,
			pierce = 5,
			accuracy = 15,
			cooldown = 3,
			woundChance = 30,
			sound = "warg_attack",
			screenEffect = "damage_screen",
		},
		{
			class = "UggardianFlames",		    -- this class is addded
			particleSystem = "fire_elemental",  -- what particle effect you want
			emitFromMaterial = "*",				-- what materials should emit that particle
		},
		{
			class = "MonsterAction",
			name = "howl",
			animation = "howl",
			cooldown = 60,
			-- sound = "warg_howl",
		},
	},
}
hope that answers your question.

kind regards
Skuggasveinn.
Last edited by Skuggasveinn on Mon May 02, 2016 9:32 pm, edited 1 time in total.
Link to all my LoG 2 assets on Nexus.
Link to all my LoG 1 assets on Nexus.
User avatar
Skuggasveinn
Posts: 562
Joined: Wed Sep 26, 2012 5:28 pm

Re: Air Elemental Particles Questions

Post by Skuggasveinn »

Also you can pretty much set particle effects on any object in the shape of that object, but since the UggardianFlames Class can't be added to props or items (it looks for a monster class) you simply use a normal particle class with emitterMesh

Want to have the oak tress on fire ?, simple add a particle class to the trees like this

Code: Select all

		{
			class = "Particle",		    -- this class is addded
			particleSystem = "fire_elemental",  -- what particle effect you want
			emitterMesh = "assets/models/env/forest_oak_cluster.fbx",	-- what Mesh the particles should emit from, if its the same mesh as the objects itself the particle effect takes the shape of that object.
		},
Full definition of the oak tree cluster would then look like this.
SpoilerShow

Code: Select all

defineObject{
	name = "forest_oak_cluster_ON_FREAKING_FIRE",
	baseObject = "base_obstacle",
	components = {
		{
			class = "Model",
			model = "assets/models/env/forest_oak_cluster.fbx",
			dissolveStart = 2,
			dissolveEnd = 5,
			shadowLod = 1,
			staticShadow = true,
			--debugDraw = true,
			-- bounding box fix: automatically computed bounding box is too small because the model is built incorrectly
			-- (without skinning all the trees in the cluster are in one place)
			boundBox = { pos = vec(0, 5, 0), size = vec(8, 10, 8) },
		},
		{
			class = "Animation",
			animations = {
				sway = "assets/animations/env/forest_oak_cluster_idle.fbx",
			},
			playOnInit = "sway",
			loop = true,
			maxUpdateDistance = 5,
		},
		{
			class = "Particle",		    -- this class is addded
			particleSystem = "fire_elemental",  -- what particle effect you want
			emitterMesh = "assets/models/env/forest_oak_cluster.fbx",	-- what Mesh the particles should emit from
		},
	},
	editorIcon = 168,
	automapTile = "trees",
	minimalSaveState = true,
}
The application of this is that you can have disabled particle effects on objects that you want to put on fire (or freeze, or poison etc) then enable them when the time comes and enable a hurt tile for good measure.

forest on fire
SpoilerShow
Image

kind regards
Skuggasveinn.
Link to all my LoG 2 assets on Nexus.
Link to all my LoG 1 assets on Nexus.
Echoplex
Posts: 63
Joined: Tue Nov 04, 2014 10:59 pm

Re: Air Elemental Particles Questions

Post by Echoplex »

Oh man that is fantastic, thank you for the in depth explanation Skuggasveinn! I can't wait to dive into this further. This opens a lot of cool doors for me I appreciate it. While you're lurking around here do you think we will ever see a waterfall tutorial? I'm super jealous of that quick video you made for it in action.
User avatar
Skuggasveinn
Posts: 562
Joined: Wed Sep 26, 2012 5:28 pm

Re: Air Elemental Particles Questions

Post by Skuggasveinn »

Echoplex wrote:While you're lurking around here do you think we will ever see a waterfall tutorial? I'm super jealous of that quick video you made for it in action.
Sure give me a couple of days to set it up.
End result will be something like this, waterfall, shallow river, splash screen if party goes under the waterfall.
https://youtu.be/eqeCr9N75Wc

kind regards.
Skuggasveinn.
Link to all my LoG 2 assets on Nexus.
Link to all my LoG 1 assets on Nexus.
Echoplex
Posts: 63
Joined: Tue Nov 04, 2014 10:59 pm

Re: Air Elemental Particles Questions

Post by Echoplex »

/Mind blown. Can't wait!
User avatar
Vandalar
Posts: 31
Joined: Sun Jan 18, 2015 6:05 pm
Location: Montreal, Canada

Re: Air Elemental Particles Questions

Post by Vandalar »

*Jaws brokes*

Wow !

I can't wait for your tutorial !

Regards,
Vand
Post Reply