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
7Soul
Posts: 170
Joined: Sun Oct 19, 2014 1:56 am
Location: Brazil

Re: Ask a simple question, get a simple answer

Post by 7Soul » Thu Nov 05, 2020 11:28 pm

Isaac wrote:
Thu Nov 05, 2020 11:20 pm
7Soul wrote:
Thu Nov 05, 2020 7:31 pm
So... there's no monster:getAiState()?

This kinda kills my randomizer...
Monsters who are guarding, are usually not moving. ;)
MonsterComponent:isMoving()
I needed something that triggers right when the dungeon loads
Join the LoG discord server: https://discord.gg/ArgAgNN :D

My Mods

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

Re: Ask a simple question, get a simple answer

Post by minmay » Thu Nov 05, 2020 11:54 pm

monsters that aren't guarding usually aren't moving either
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
7Soul
Posts: 170
Joined: Sun Oct 19, 2014 1:56 am
Location: Brazil

Re: Ask a simple question, get a simple answer

Post by 7Soul » Fri Nov 06, 2020 12:40 am

I'm having a problem with

Code: Select all

for _,item in e.monster:contents() do
Image

There's an "if e.monster" before it so e.monster isn't nil, I can even print(e.monster) right before this line
Join the LoG discord server: https://discord.gg/ArgAgNN :D

My Mods

ratman
Posts: 140
Joined: Fri Jan 10, 2020 1:13 am

Re: Ask a simple question, get a simple answer

Post by ratman » Fri Nov 06, 2020 1:47 am

IttaBitta wrote:
Thu Nov 05, 2020 11:09 pm
7Soul wrote:
Wed Nov 04, 2020 11:03 pm
There's some at nexusmods https://www.nexusmods.com/legendofgrimrock2
just, does anyone have the frozen dungeon stuff laying around still? There's a lot of lost pieces that are probably still somewhere right?
minmays g1 mega pack has conversions of a lot of grimrock 1 stuff to grimrock 2, the nothern dungeon included. (just type in g1 mega pack and scroll down) :D

@ THOM:
here's my lindworm definition.

Code: Select all

defineObject{
	name = "lindworm",
	baseObject = "base_monster",
	components = {
		{
			class = "Model",
			model = "assets/models/monsters/lindworm.fbx",
			storeSourceData = true,
			materialOverrides = { wizard = "spectral_wizard", lindworm = "lindworm_red"},
			onInit = function(self)
				self.go.brainScript:loadFile("mod_assets/monsters/lindworm_brainscript.lua")
			end
		},
		{
			class = "Animation",
			animations = {
				idle = "assets/animations/monsters/lindworm/lindworm_idle.fbx",
				moveForward = "assets/animations/monsters/lindworm/lindworm_walk.fbx",
				turnLeft = "assets/animations/monsters/lindworm/lindworm_turn_left.fbx",
				turnRight = "assets/animations/monsters/lindworm/lindworm_turn_right.fbx",
				attack = "assets/animations/monsters/lindworm/lindworm_attack.fbx",
				attackFrontLeft = "assets/animations/monsters/lindworm/lindworm_attack_front_left.fbx",
				attackFrontRight = "assets/animations/monsters/lindworm/lindworm_attack_front_right.fbx",
				rangedAttack = "assets/animations/monsters/lindworm/lindworm_ranged_attack.fbx",
				wingAttack = "assets/animations/monsters/lindworm/lindworm_wing_attack.fbx",
				getHitFrontLeft = "assets/animations/monsters/lindworm/lindworm_get_hit_front_left.fbx",
				getHitFrontRight = "assets/animations/monsters/lindworm/lindworm_get_hit_front_right.fbx",
				getHitBack = "assets/animations/monsters/lindworm/lindworm_get_hit_back.fbx",
				getHitLeft = "assets/animations/monsters/lindworm/lindworm_get_hit_left.fbx",
				getHitRight = "assets/animations/monsters/lindworm/lindworm_get_hit_right.fbx",
				fall = "assets/animations/monsters/lindworm/lindworm_get_hit_front_left.fbx",
				flyManeuver1 = "assets/animations/monsters/lindworm/lindworm_fly_maneuver_1.fbx",
				flyManeuver2 = "assets/animations/monsters/lindworm/lindworm_fly_maneuver_2.fbx",
				flyManeuver3 = "assets/animations/monsters/lindworm/lindworm_fly_maneuver_3.fbx",
				knockback = "assets/animations/monsters/lindworm/lindworm_knockback.fbx",
				charge = "assets/animations/monsters/lindworm/lindworm_dash.fbx",
				roar = "assets/animations/monsters/lindworm/lindworm_roar.fbx",
				summon = "assets/animations/monsters/lindworm/lindworm_summon.fbx",
				intro = "assets/animations/monsters/lindworm/lindworm_intro.fbx",
				death = "assets/animations/monsters/lindworm/lindworm_death.fbx",
			},
			currentLevelOnly = true,
			onAnimationEvent = function(self, event)
				if event == "rear" then
					self.go.monster:setShape("1x1")
				elseif event == "knockback" then
					local party = party.party
					if math.max(math.abs(party.go.x - self.go.x), math.abs(party.go.y - self.go.y)) < 2 then
						local dx,dy = toLocal(self.go.x, self.go.y, self.go.facing, party.go.x, party.go.y)
						local dir = self.go.facing
						if dy > 0 then
							dir = self.go.facing
						elseif dy < 0 then
							dir = (self.go.facing+2) % 4
						elseif dx > 0 then
							dir = (self.go.facing+1) % 4
						else
							dir = (self.go.facing+3) % 4
						end
						party:knockback(dir)
						party:shakeCamera(0.5, 0.3)
						party:playScreenEffect("damage_screen")
						for i=1,4 do
							local ch = party:getChampion(i)
							if ch:isAlive() then
								ch:damage(math.random(10,30), "physical")
								ch:playDamageSound()
							end
						end
					end

					-- wake up minions
					-- this has to be done after knockback
					-- otherwise fast minions (e.g. mosquitos) can move to block party's path so that knockback fails
					-- and player gets stuck inside the lindworm
					for e in self.go.map:allEntities() do
						if e.brain then e.brain:enable() end
					end
				elseif event == "fly_maneuver1_begin" then
					self.go.sound:play("lindworm_fly_maneuver1")
				elseif event == "fly_maneuver2_begin" then
					self.go.sound:play("lindworm_fly_maneuver2")
				elseif event == "fly_maneuver3_begin" then
					self.go.sound:play("lindworm_fly_maneuver3")
				end
			end,
		},
		{
			class = "Monster",
			meshName = "lindworm_mesh",
			footstepSound = "ogre_footstep",
			hitSound = "lindworm_hit",
			--dieSound = "lindworm_die",
			hitEffect = "hit_dust",
			deathEffect = "lindworm_explode",
			capsuleHeight = 0.8,
			capsuleRadius = 0.25,
			collisionRadius = 3.5,
			collisionHeight = 5,
			health = 3000,
			protection = 10,
			exp = 1000,
			immunities = { "assassination", "sleep", "frozen", "blinded", "knockback", "burning" },
			shape = "cross",
			juggernaut = true,
			onInit = function(self)
				self:performAction("intro")
				self:setMonsterFlag("CantDie", false)
			end,
		},
		{
			class = "MonsterMove",
			name = "move",
			sound = "lindworm_walk",
			cooldown = 6,
		},
		{
			class = "MonsterTurn",
			name = "turn",
			sound = "lindworm_walk",
		},
		{
			class = "MonsterAttack",
			name = "basicAttack",
			attackPower = 80,
			accuracy = 30,
			woundChance = 60,
			reach = 2,
			cooldown = 4,
			sound = "lindworm_attack",
			--impactSound = "ogre_impact",
			cameraShake = true,
			screenEffect = "damage_screen",
		},
		{
			class = "MonsterAttack",
			name = "wingAttack",
			animation = "wingAttack",
			attackPower = 80,
			accuracy = 30,
			reach = 2,
			cooldown = 15,
			sound = "lindworm_wing_attack",
			--impactSound = "ogre_impact",
			cameraShake = true,
			knockback = true,
			screenEffect = "damage_screen",
		},
		{
			class = "MonsterAction",
			name = "knockback",
			animation = "knockback",
			sound = "lindworm_knockback",
			cooldown = 2,
		},
		{
			class = "LindwormFly",
			name = "flyManeuver1",
			animation = "flyManeuver1",
			relativeMoveX = 1,
			relativeMoveY = 5,
			turnDir = 0,
			cooldown = 60,
		},
		{
			class = "LindwormFly",
			name = "flyManeuver2",
			animation = "flyManeuver2",
			relativeMoveX = -2,
			relativeMoveY = 5,
			turnDir = 0,
			cooldown = 60,
		},
		{
			class = "LindwormFly",
			name = "flyManeuver3",
			animation = "flyManeuver3",
			relativeMoveX = 1,
			relativeMoveY = 7,
			turnDir = 2,
			cooldown = 60,
		},
		{
			class = "LindwormFly",
			name = "intro",
			animation = "intro",
			--animationSpeed = 10,
			relativeMoveX = 2,
			relativeMoveY = 9,
			turnDir = 0,
			cooldown = 0,
		},
		{
			class = "MonsterAction",
			name = "roar",
			animation = "roar",
			cooldown = 100,
		},
		{
			class = "LindwormCharge",
			name = "charge",
			animation = "charge",
			cooldown = 10,
		},
		{
			class = "MonsterAttack",
			name = "rangedAttack",
			attackPower = 40,
			cooldown = 3,
			animation = "rangedAttack",
			sound = "lindworm_roar",
			onAttack = function(self)
				for i=-1,1 do
					local dx,dy = getForward(self.go.facing)
					local rdx,rdy = getForward((self.go.facing + 1) % 4)
					local x = self.go.x + dx*2 + rdx*i
					local y = self.go.y + dy*2 + rdy*i
					local spell = spawn("ice_shards", self.go.level, x, y, self.go.facing, self.go.elevation)
					if i ~= 0 then spell.tiledamager:setSound(nil) end
					spell.tiledamager:setAttackPower(20)
				end
			end,
		},
		{
			class = "MonsterAction",
			name = "summon",
			animation = "summon",
			animationSpeed = 0.7,
			cooldown = 45,
		},
		{
			class = "MonsterAction",
			name = "takeoff",
			animation = "takeoff",
			cooldown = 20,
		},
		{
			class = "MonsterAction",
			name = "fly",
			animation = "fly",
		},
		{
			class = "MonsterAction",
			name = "land",
			animation = "land",
		},
		{
			class = "MonsterAction",
			name = "die",
			animation = "death",
		},
		{
			class = "RangedBrain",
			name = "brain",
			sight = 10,
         		morale = 100,
			seeInvisible = true,
			allAroundSight = true,
			onBloodied = function(self)
				self.go.move:setCooldown(1)
				self.go.basicAttack:setCooldown(2)
			end,
			onThink = function(self)
				-- call brain script
				local script = self.go.brainScript
				if script and script:isEnabled() and script.think then script.think(self) end
			end,
		},
		{
			class = "Script",
			name = "brainScript",
		},
		{
			class = "Sound",	-- for fly maneuver sounds that must be attached to lindworm
			parentNode = "liz_spine2",
		},
		{
			class = "GoromorgShield",
			radius = 5,
			energy = math.huge,
			offset = vec(2*3, 0, 9*3),
			visible = false,	-- initially shield is hidden
		},
		{
			class = "UggardianFlames",
			name = "deathParticles",
			particleSystem = "lindworm_death",
			enabled = false,
		},
		{
			class = "Light",
			name = "deathLight",
			offset = vec(0, 2, 0),
			color = vec(0.25, 0.45, 1.0),
			brightness = 0,
			range = 15,
			fadeOut = 0,
			enabled = false,
			onUpdate = function(self)
				local t = Time.currentTime()*4 + 123
				local noise = math.noise(t) + math.noise(t*2)
				self:setBrightness(10 + noise * 10)
			end,
		},
	},
}

Zo Kath Ra
Posts: 865
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Ask a simple question, get a simple answer

Post by Zo Kath Ra » Fri Nov 06, 2020 2:03 am

7Soul wrote:
Fri Nov 06, 2020 12:40 am
I'm having a problem with

Code: Select all

for _,item in e.monster:contents() do
Image

There's an "if e.monster" before it so e.monster isn't nil, I can even print(e.monster) right before this line
http://www.grimrock.net/forum/viewtopic ... 10#p121771

User avatar
7Soul
Posts: 170
Joined: Sun Oct 19, 2014 1:56 am
Location: Brazil

Re: Ask a simple question, get a simple answer

Post by 7Soul » Fri Nov 06, 2020 3:48 am

Even if I don't destroy anything, it still causes the same error
Join the LoG discord server: https://discord.gg/ArgAgNN :D

My Mods

User avatar
Isaac
Posts: 3005
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac » Fri Nov 06, 2020 4:38 am

Minmay would tell you the function is broken, and he's right. When the monster has no items, the function can crash the game. My workaround when I was using it, was to simply give the monster an item before calling the function. I defined an invisible item called "pocket_lint", and just ignored it when it was found. It IS a defective function; perhaps in other ways too. That's reason enough not to use it, but I have used it before—sparingly. ;)

User avatar
7Soul
Posts: 170
Joined: Sun Oct 19, 2014 1:56 am
Location: Brazil

Re: Ask a simple question, get a simple answer

Post by 7Soul » Fri Nov 06, 2020 6:47 am

Sometimes I feel like I use more hacks than actual game functions :P
Join the LoG discord server: https://discord.gg/ArgAgNN :D

My Mods

User avatar
THOM
Posts: 1181
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM » Fri Nov 06, 2020 9:34 am

ratman wrote:
Fri Nov 06, 2020 1:47 am
@ THOM:
here's my lindworm definition.
Okay - I think I must appologize - the changes made to the mosterdefinition are bigger than I stated before.

So here is my Lindworm definition.

Mind that it has
  • no flyManeuvers
  • no chargeAttack
  • no summonAttack
  • several altered stats
  • gives no EXP
But probably it gives you a better chance to get a working Lindworm.

Code: Select all

defineObject{
	name = "lindworm_fighter",
	baseObject = "base_monster",
	components = {
		{
			class = "Model",
			model = "assets/models/monsters/lindworm.fbx",
			storeSourceData = true,
			materialOverrides = { ["healing_crystal"] = "sx_invisible",       
                    	["master_key"] = "sx_invisible" },
			onInit = function(self)
				self.go.brainScript:loadFile("mod_assets/monsters/lindworm_brainscript.lua")
			end
		},
		{
			class = "Animation",
			animations = {
				idle = "assets/animations/monsters/lindworm/lindworm_idle.fbx",
				moveForward = "assets/animations/monsters/lindworm/lindworm_walk.fbx",
				turnLeft = "assets/animations/monsters/lindworm/lindworm_turn_left.fbx",
				turnRight = "assets/animations/monsters/lindworm/lindworm_turn_right.fbx",
				attack = "assets/animations/monsters/lindworm/lindworm_attack.fbx",
				attackFrontLeft = "assets/animations/monsters/lindworm/lindworm_attack_front_left.fbx",
				attackFrontRight = "assets/animations/monsters/lindworm/lindworm_attack_front_right.fbx",
				rangedAttack = "assets/animations/monsters/lindworm/lindworm_ranged_attack.fbx",
				wingAttack = "assets/animations/monsters/lindworm/lindworm_wing_attack.fbx",
				getHitFrontLeft = "assets/animations/monsters/lindworm/lindworm_get_hit_front_left.fbx",
				getHitFrontRight = "assets/animations/monsters/lindworm/lindworm_get_hit_front_right.fbx",
				getHitBack = "assets/animations/monsters/lindworm/lindworm_get_hit_back.fbx",
				getHitLeft = "assets/animations/monsters/lindworm/lindworm_get_hit_left.fbx",
				getHitRight = "assets/animations/monsters/lindworm/lindworm_get_hit_right.fbx",
				fall = "assets/animations/monsters/lindworm/lindworm_get_hit_front_left.fbx",
				--flyManeuver1 = "assets/animations/monsters/lindworm/lindworm_fly_maneuver_1.fbx",
				--flyManeuver2 = "assets/animations/monsters/lindworm/lindworm_fly_maneuver_2.fbx",
				--flyManeuver3 = "assets/animations/monsters/lindworm/lindworm_fly_maneuver_3.fbx",
				knockback = "assets/animations/monsters/lindworm/lindworm_knockback.fbx",
				--charge = "assets/animations/monsters/lindworm/lindworm_dash.fbx",
				roar = "assets/animations/monsters/lindworm/lindworm_roar.fbx",
				--summon = "assets/animations/monsters/lindworm/lindworm_summon.fbx",
				intro = "assets/animations/monsters/lindworm/lindworm_intro.fbx",
				death = "assets/animations/monsters/lindworm/lindworm_death.fbx",
			},
			currentLevelOnly = true,
			onAnimationEvent = function(self, event)
				--print("AnimationEvent: " .. event)
				local party = party.party
				local dx,dy = toLocal(self.go.x, self.go.y, self.go.facing, party.go.x, party.go.y)
				local dir = dy>0 and self.go.facing or dy<0 and (self.go.facing+2)%4 or dx>0 and (self.go.facing+1)%4 or (self.go.facing+3)%4
				local condition = {"left_hand_wound","right_hand_wound","leg_wound","feet_wound","head_wound","chest_wound"}
				
 				self.go.monster:setShape(event == "rear" and "1x1" or "cross")

				if event == "rear" then
					self.go.monster:setShape("1x1")
        			elseif event == "wing_attack" then
          				party:playScreenEffect("damage_screen")
          				party:shakeCamera(0.5, 0.3)
          				party:knockback(dir)
          				playSound("lindworm_wing_attack")
          					for i=1,4 do
            					local ch = party:getChampion(i)
            					local shield = iff(ch:hasCondition("protective_shield"), 0.8, 1)
            					ch:damage(rollDamage(self.go.wingAttack:getAttackPower()*shield), "physical")
            					ch:playDamageSound()
            					if math.random() < 0.6 then ch:setCondition(condition[math.random(#condition)]) end
          			end
				elseif event == "knockback" then
					if math.max(math.abs(party.go.x - self.go.x), math.abs(party.go.y - self.go.y)) < 2 then
						party:knockback(dir)
						party:shakeCamera(0.5, 0.3)
						party:playScreenEffect("damage_screen")
						for i=1,4 do
							local ch = party:getChampion(i)
							local shield = iff(ch:hasCondition("protective_shield"), 0.8, 1)
							if ch:isAlive() then
								ch:damage(rollDamage(30*shield), "physical")
								ch:playDamageSound()
							end
						end
					end

				elseif event == "begin_die" then
					self.go.deathLight:enable()
					self.go.deathParticles:enable()
				elseif event == "die" then
					self.go.monster:setMonsterFlag("CantDie", false)
				end
			end,
		},
		{
			class = "Monster",
			meshName = "lindworm_mesh",
			footstepSound = "ogre_footstep",
			hitSound = "lindworm_hit",
			hitEffect = "hit_dust",
			deathEffect = "death", --"lindworm_explode",
			capsuleHeight = 0.8,
			capsuleRadius = 0.25,
			collisionRadius = 3.5,
			collisionHeight = 5,
			health = 3000,
			protection = 10,
			exp = 0,
			immunities = { "assassination", "sleep", "frozen", "blinded", "knockback", "burning" },
			shape = "cross", --"1x1",
			juggernaut = true,
			onInit = function(self)
				self:performAction("intro")
				self:setMonsterFlag("CantDie", true)
			end,
			onDamage = function(self, damage, damageType)
				if (self:getHealth()-damage) <= 1 then 
					self:performAction("die")
        			end
			end,
			onDie = function(self)
				script_entity_286.script:dieLindworm()
			end,
		},
		{
			class = "MonsterMove",
			name = "move",
			sound = "lindworm_walk",
			cooldown = 2,
		},
		{
			class = "MonsterTurn",
			name = "turn",
			sound = "lindworm_walk",
		},
		{
			class = "MonsterAttack",
			name = "basicAttack",
			attackPower = 55,
			accuracy = 40,
			woundChance = 60,
			reach = 2,
			cooldown = 4,
			sound = "lindworm_attack",
			cameraShake = true,
			screenEffect = "damage_screen",
		},
		{
			class = "MonsterAttack",
			name = "attackFrontRight",
			animation = "attackFrontRight",
			attackPower = 45,
			accuracy = 30,
			woundChance = 60,
			reach = 2,
			cooldown = 4,
			sound = "lindworm_attack",
			onAttack = function(self)
				local party = party.party
				local cn = math.random(1,3)
				local woundChance = 60
				local condition = {"left_hand_wound","right_hand_wound","leg_wound","feet_wound","head_wound","chest_wound"}
				
				if cn == 3 then cn = 4 end
				local ch = party:getChampion(cn)
				local shield = iff(ch:hasCondition("protective_shield"), 0.8, 1) --// Shield Protection Bonus +25
				local avoid = iff(math.random()<(ch:getEvasion()*0.01), true, false)
				if not avoid then
					party:shakeCamera(0.5, 0.3)
					party:playScreenEffect("damage_screen")
					ch:damage(rollDamage(self:getAttackPower()*shield), "physical")
					ch:playDamageSound()
					if math.random() < (woundChance/100) then
						ch:setCondition(condition[math.random( #condition )])
					end
				end
			end,
		},
		{
			class = "MonsterAttack",
			name = "attackFrontLeft",
			animation = "attackFrontLeft",
			attackPower = 45,
			accuracy = 30,
			woundChance = 60,
			reach = 2,
			cooldown = 4,
			sound = "lindworm_attack",
			onAttack = function(self)
				--print("MonsterAttack attackFrontLeft")
				local party = party.party
				local cn = math.random(1,3)
				local ch = party:getChampion(cn)
				local woundChance = 60
				local condition = {"left_hand_wound","right_hand_wound","leg_wound","feet_wound","head_wound","chest_wound"}
				local shield = iff(ch:hasCondition("protective_shield"), 0.8, 1) --// Shield Protection Bonus +25
				local avoid = iff(math.random()<(ch:getEvasion()*0.01), true, false)
				if not avoid then
					party:shakeCamera(0.5, 0.3)
					party:playScreenEffect("damage_screen")
					ch:damage(rollDamage(self:getAttackPower()*shield), "physical")
					ch:playDamageSound()
					if math.random() < (woundChance/100) then
						ch:setCondition(condition[math.random( #condition )])
					end
				end
			end,
		},
		{
			class = "MonsterAttack",
			name = "wingAttack",
			animation = "wingAttack",
			attackPower = 60,
			accuracy = 30,
			reach = 2,
			cooldown = 1,
		},
		{
			class = "MonsterAttack",
			name = "rangedAttack",
			cooldown = 5,
			animation = "rangedAttack",
			minDistance = 2,
			sound = "lindworm_roar",
			onAttack = function(self)
				for i=-1,1 do
					local dx,dy = getForward(self.go.facing)
					local rdx,rdy = getForward((self.go.facing + 1) % 4)
					local x = self.go.x + dx*2 + rdx*i
					local y = self.go.y + dy*2 + rdy*i
					local spell = spawn("ice_shards", self.go.level, x, y, self.go.facing, self.go.elevation)
					if i ~= 0 then spell.tiledamager:setSound(nil) end
					spell.tiledamager:setAttackPower(20)
				end
			end,
		},
		{
			class = "RangedBrain",
			name = "brain",
			sight = 10,
         		morale = 100,
			seeInvisible = true,
			allAroundSight = true,
			onBloodied = function(self)
				self.go.move:setCooldown(1)
				self.go.basicAttack:setCooldown(2)
			end,
			onThink = function(self)
				-- call brain script
				local script = self.go.brainScript
				if script and script:isEnabled() and script.think then script.think(self) end
			end,
		},
		{
			class = "Script",
			name = "brainScript",
		},
		{
			class = "MonsterAction",
			name = "knockback",
			animation = "knockback",
			sound = "lindworm_knockback",
			cooldown = 2,
		},
		{
			class = "LindwormFly",
			name = "intro",
			animation = "intro",
			--animationSpeed = 10,
			relativeMoveX = 2,
			relativeMoveY = 9,
			turnDir = 0,
			cooldown = 0,
		},
		{
			class = "MonsterAction",
			name = "roar",
			animation = "roar",
			cooldown = 100,
		},
		{
			class = "MonsterAction",
			name = "takeoff",
			animation = "takeoff",
			cooldown = 20,
		},
		{
			class = "MonsterAction",
			name = "fly",
			animation = "fly",
		},
		{
			class = "MonsterAction",
			name = "land",
			animation = "land",
		},
		{
			class = "MonsterAction",
			name = "die",
			animation = "death",
		},
		{
			class = "Sound",	-- for fly maneuver sounds that must be attached to lindworm
			parentNode = "liz_spine2",
		},
		{
			class = "UggardianFlames",
			name = "deathParticles",
			particleSystem = "lindworm_death",
			enabled = false,
		},
		{
			class = "Light",
			name = "deathLight",
			offset = vec(0, 2, 0),
			color = vec(0.25, 0.45, 1.0),
			brightness = 0,
			range = 15,
			fadeOut = 0,
			enabled = false,
			onUpdate = function(self)
				local t = Time.currentTime()*4 + 123
				local noise = math.noise(t) + math.noise(t*2)
				self:setBrightness(10 + noise * 10)
			end,
		},
	},
}

defineAnimationEvent{
	animation = "assets/animations/monsters/lindworm/lindworm_attack.fbx",
	event = "attack",
	frame = 10,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/lindworm/lindworm_ranged_attack.fbx",
	event = "attack",
	frame = 35,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/lindworm/lindworm_attack_front_left.fbx",
	event = "attack",
	frame = 12,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/lindworm/lindworm_attack_front_right.fbx",
	event = "attack",
	frame = 12,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/lindworm/lindworm_knockback.fbx",
	event = "knockback",
	frame = 15,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/lindworm/lindworm_wing_attack.fbx",
	event = "attack",
	frame = 4,
}


defineAnimationEvent{
	animation = "assets/animations/monsters/lindworm/lindworm_wing_attack.fbx",
	event = "wing_attack",
	normalizedTime = 0.35,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/lindworm/lindworm_roar.fbx",
	event = "playSound:lindworm_roar",
	frame = 0,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/lindworm/lindworm_summon.fbx",
	event = "rear",
	frame = 10,
}



defineAnimationEvent{
	animation = "assets/animations/monsters/lindworm/lindworm_summon.fbx",
	event = "knockback",
	normalizedTime = 0.92,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/lindworm/lindworm_intro.fbx",
	event = "playSound:lindworm_intro",
	frame = 0,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/lindworm/lindworm_intro.fbx",
	event = "land",
	frame = 162,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/lindworm/lindworm_intro.fbx",
	event = "taunt_intro",
	frame = 180,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/lindworm/lindworm_death.fbx",
	event = "begin_die",
	normalizedTime = 0,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/lindworm/lindworm_death.fbx",
	event = "die",
	normalizedTime = 0.95,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/lindworm/lindworm_death.fbx",
	event = "playSound:lindworm_die",
	frame = 0,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/lindworm/lindworm_dash.fbx",
	event = "playSound:lindworm_dash",
	frame = 0,
}
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download

IttaBitta
Posts: 19
Joined: Thu Oct 22, 2020 12:14 am

Re: Ask a simple question, get a simple answer

Post by IttaBitta » Sat Nov 07, 2020 4:17 am

how do I spawn a stack of ammo? I can spawn a single pellet but I don't know how to make more :o
also if anyone knows those coinslot mods how do I make a coinslot reusable rather than being rendered inert after being paid once.

Post Reply