Statue Comes to life

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Ciccipicci
Posts: 154
Joined: Mon Oct 08, 2012 12:55 am

Re: Statue Comes to life

Post by Ciccipicci »

Neikun wrote:In my monster code I gave it warden sound effects.

@Ciccipicci, no new materials are needed. (Don't you recognize the temple floor material?)
I have mine saved in my models folder, so my script looks like this:

Code: Select all

defineObject{
	name = "stone_ogre",
	class = "Monster",
	model = "mod_assets/models/stone_ogre.fbx",
	meshName = "tunnel_ogre_mesh",
	animations = {
		idle = "assets/animations/monsters/tunnel_ogre/tunnel_ogre_idle.fbx",
		moveForward = "assets/animations/monsters/tunnel_ogre/tunnel_ogre_walk.fbx",
		turnLeft = "assets/animations/monsters/tunnel_ogre/tunnel_ogre_turn_left.fbx",
		turnRight = "assets/animations/monsters/tunnel_ogre/tunnel_ogre_turn_right.fbx",
		attack = "assets/animations/monsters/tunnel_ogre/tunnel_ogre_attack.fbx",
		attack2 = "assets/animations/monsters/tunnel_ogre/tunnel_ogre_attack_stab.fbx",
		--attack3 = "assets/animations/monsters/tunnel_ogre/tunnel_ogre_attack_two_handed.fbx",
		--attack4 = "assets/animations/monsters/tunnel_ogre/tunnel_ogre_attack_leap.fbx",
		turnAttackLeft =  "assets/animations/monsters/tunnel_ogre/tunnel_ogre_attack_left.fbx",
		turnAttackRight =  "assets/animations/monsters/tunnel_ogre/tunnel_ogre_attack_right.fbx",
		getHitFrontLeft = "assets/animations/monsters/tunnel_ogre/tunnel_ogre_get_hit_front_left_02.fbx",
		getHitFrontRight = "assets/animations/monsters/tunnel_ogre/tunnel_ogre_get_hit_front_right_02.fbx",
		getHitBack = "assets/animations/monsters/tunnel_ogre/tunnel_ogre_get_hit_back_02.fbx",
		getHitLeft = "assets/animations/monsters/tunnel_ogre/tunnel_ogre_get_hit_left_02.fbx",
		getHitRight = "assets/animations/monsters/tunnel_ogre/tunnel_ogre_get_hit_right_02.fbx",
		fall = "assets/animations/monsters/tunnel_ogre/tunnel_ogre_get_hit_back_02.fbx",
		rushBegin = "assets/animations/monsters/tunnel_ogre/tunnel_ogre_rush_begin.fbx",
		rushContinue1 = "assets/animations/monsters/tunnel_ogre/tunnel_ogre_rush_continue_right_step.fbx",
		rushContinue2 = "assets/animations/monsters/tunnel_ogre/tunnel_ogre_rush_continue_left_step.fbx",
		rushHit1 = "assets/animations/monsters/tunnel_ogre/tunnel_ogre_rush_hit_right_step.fbx",
		rushHit2 = "assets/animations/monsters/tunnel_ogre/tunnel_ogre_rush_hit_left_step.fbx",
	},
	moveSound = "warden_walk",
	footstepSound = "warden_footstep",
	attackSound = "warden_attack",
	impactSound = "warden_impact",
	hitSound = "ogre_hit",
	dieSound = "ogre_die",
	rushBeginSound = "ogre_rush_begin",
	--soundClipDistance = 8,
	hitEffect = "hit_blood",
	capsuleHeight = 0.6,
	capsuleRadius = 0.6,
	health = 700,
	sight = 4,
	attackPower = 80,
	accuracy = 30,
	protection = 17,
	evasion = -10,
	coolDown = { 2, 3 },
	movementCoolDown = 2,
	noRecoilInterval = { 0.1, 1.0 }, -- interval must end at 1, otherwise turn attack can be interrupted (looks ugly)
	exp = 750,
	lootDrop = { 100, "ogre_hammer" },	
	healthIncrement = 50,
	attackPowerIncrement = 10,
	protectionIncrement = 1,
	brain = "Ogre",
	onDealDamage = function(self, champion, damage)
		party:shakeCamera(0.5, 0.3)
		party:playScreenEffect("damage_screen")
	end
}
Yeah I imagined that...but I'm quite a noob with lua code and I'll thank you about your patience!
User avatar
HaunterV
Posts: 676
Joined: Mon Apr 16, 2012 9:54 pm
Location: Barrie, Ontario, Canada

Re: Statue Comes to life

Post by HaunterV »

Grimwold wrote:
HaunterV wrote:
onMove; onTurn; onAttack all return false.
Just these need to return false? or are there other things as well?
Yeah, those 3 should do it... it doesn't have ranged attack which is the only other relevant hook.

Give it a try with a simple cloned monster by adding the following to the definition.

Code: Select all

onMove = function(monster,direction)
  return false
end
onTurn = function(monster,direction)
  return false
end
onAttack  = function(monster,attack)
  return false
end
That monster will never move, turn or attack!


Of course for your actual statue you could set up a variable in a script entity (something like statue = 1) and each hook would check the value of that variable...

Code: Select all

statue =1

function checkStatue()
if statue == 1 then 
  return false 
elseif statue == 0 then
  return true
end
so when you want it to turn from a statue to a monster all you have to do is change the variable.

Code: Select all

function transformStatue()
  statue = 0
end

am ito understand the switching the variable will make the monster start moving again? like i wont need to do the puff of smoke swap out prop for monster thing? aweseome.
Grimrock Community 'FrankenDungeon 2012. Submit your entry now!: http://tinyurl.com/cnupr7h
SUBMIT YOUR ASSETS! Community Asset Pack (C.A.P.): http://tinyurl.com/bqvykrp
Behold! The HeroQuest Revival!: http://tinyurl.com/cu52ksc
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: Statue Comes to life

Post by Grimwold »

HaunterV wrote: am ito understand the switching the variable will make the monster start moving again? like i wont need to do the puff of smoke swap out prop for monster thing? aweseome.
Yeah, that's the idea... as long as the hooks (onMove; onTurn; onAttack) are calling the checkStatue() function, which will need to be in a script entity in your dungeon along with the variable and the transform function, then a simple change to the variable will bring it to life.
Last edited by Grimwold on Thu Oct 25, 2012 2:36 pm, edited 1 time in total.
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: Statue Comes to life

Post by Grimwold »

actually I've just tested this.. and while the Ogre doesn't move turn or attack, he still does his idle animations....

After further checking, there doesn't seem to be a way to prevent idle animations purely from the monster definition.. it has to have an animation file for the idle state... but perhaps someone with more modelling talent than I could create a static 'animation' for the ogre.
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Statue Comes to life

Post by Komag »

sounds like the statue swap approach might be easier after all!
Finished Dungeons - complete mods to play
User avatar
HaunterV
Posts: 676
Joined: Mon Apr 16, 2012 9:54 pm
Location: Barrie, Ontario, Canada

Re: Statue Comes to life

Post by HaunterV »

would some sort of Idle animation = false script work you think?
Komag wrote:sounds like the statue swap approach might be easier after all!
looking like
Grimrock Community 'FrankenDungeon 2012. Submit your entry now!: http://tinyurl.com/cnupr7h
SUBMIT YOUR ASSETS! Community Asset Pack (C.A.P.): http://tinyurl.com/bqvykrp
Behold! The HeroQuest Revival!: http://tinyurl.com/cu52ksc
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: Statue Comes to life

Post by Grimwold »

HaunterV wrote:would some sort of Idle animation = false script work you think?
I'm not sure there's a way to do it.. looking at the basic ogre definition from the asset pack, what we have is:

Code: Select all

idle = "assets/animations/monsters/tunnel_ogre/tunnel_ogre_idle.fbx",
I've tried deleting the line but the editor complains.. It also complained when I left it blank. I set it to one of the other animations, like tunnel_ogre_walk, and it just repeatedly did that animation. So it looks like we need an animation file that essentially does nothing.
User avatar
HaunterV
Posts: 676
Joined: Mon Apr 16, 2012 9:54 pm
Location: Barrie, Ontario, Canada

Re: Statue Comes to life

Post by HaunterV »

Xanathar is working with animations. maybe he'll have an idea.
Grimrock Community 'FrankenDungeon 2012. Submit your entry now!: http://tinyurl.com/cnupr7h
SUBMIT YOUR ASSETS! Community Asset Pack (C.A.P.): http://tinyurl.com/bqvykrp
Behold! The HeroQuest Revival!: http://tinyurl.com/cu52ksc
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: Statue Comes to life

Post by msyblade »

You can make him stay in idle simply by using blockers (Like say, for a shopkeeper). Perhaps you can modify the freeze spell effect and alter the color change to a drab gray, triggering it to end at will.
Last edited by msyblade on Fri Oct 26, 2012 3:15 pm, edited 1 time in total.
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: Statue Comes to life

Post by Neikun »

The problem with staying idle is that it's not very statue like.
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
Post Reply