[ASSET] - DM SKELETON RAISING FROM COFFIN

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
lexdr
Posts: 108
Joined: Thu Dec 26, 2013 3:29 pm
Location: France

Re: [ASSET] - Surprise by Leki

Post by lexdr »

Do you have the same result if onDie refers to an ingame script with object as parameter ?
User avatar
Dr.Disaster
Posts: 2876
Joined: Wed Aug 15, 2012 11:48 am

Re: [ASSET] - Surprise by Leki

Post by Dr.Disaster »

This is germanny's big mushroom definition.
When the big mushroom is destroyed by the party it leaves it with some mushroom slices.

Code: Select all

defineObject{
	name = "dm_bigmushrooms",
	class = "Blockage",
	model = "mod_assets/dmcsb_pack/models/env/dm_floordeco_bigmushrooms.fbx",
	brokenModel = "mod_assets/dmcsb_pack/models/env/dm_bigmushrooms_broken.fbx",
	placement = "floor",
	health = 15,
	evasion = -1000,
	hitSound = "dm_chop",
	hitEffect = "hit_goo",
	editorIcon = 56,
	onDie = function(self)
		playSound("dm_bumper")
		slices = math.random(1,3)
      for i = 1,slices do
          spawn("dm_mushroom_slice", self.level, self.x, self.y, i%4)
      end
	end,
}
Maybe just replacing your "coffin" with "self" does the trick.
User avatar
Leki
Posts: 550
Joined: Wed Sep 12, 2012 3:49 pm

Re: [ASSET] - Surprise by Leki

Post by Leki »

lexdr wrote:Do you have the same result if onDie refers to an ingame script with object as parameter ?

Dunno that, because I wanna it "independent" I mean I wanna solution for object definition script. But destroy() in ingame script is usually ok as I know...
I'm the Gate I'm the Key.
Dawn of Lore
User avatar
Leki
Posts: 550
Joined: Wed Sep 12, 2012 3:49 pm

Re: [ASSET] - Surprise by Leki

Post by Leki »

Dr.Disaster wrote:This is germanny's big mushroom definition.
When the big mushroom is destroyed by the party it leaves it with some mushroom slices.

Code: Select all

defineObject{
	name = "dm_bigmushrooms",
	class = "Blockage",
	model = "mod_assets/dmcsb_pack/models/env/dm_floordeco_bigmushrooms.fbx",
	brokenModel = "mod_assets/dmcsb_pack/models/env/dm_bigmushrooms_broken.fbx",
	placement = "floor",
	health = 15,
	evasion = -1000,
	hitSound = "dm_chop",
	hitEffect = "hit_goo",
	editorIcon = 56,
	onDie = function(self)
		playSound("dm_bumper")
		slices = math.random(1,3)
      for i = 1,slices do
          spawn("dm_mushroom_slice", self.level, self.x, self.y, i%4)
      end
	end,
}
Maybe just replacing your "coffin" with "self" does the trick.
"dm_mushroom_slice" is an item I guess, so it works, but I need to spawn a monster - which shows warrning that monster is in invalid location. The strange thing is that with print(findEntity(....)) in onDie function you cannot see spawned monster in the cell, but the monster is there and works without problem.

I also tried to make monster with onDie / onDamage hook - it worked for a while, then I tried again (no changes n script) and it crashed. Maybe ecause
I'm the Gate I'm the Key.
Dawn of Lore
User avatar
Leki
Posts: 550
Joined: Wed Sep 12, 2012 3:49 pm

Re: [ASSET] - Surprise by Leki

Post by Leki »

Diarmuid wrote:
Dr.Disaster wrote:Seems right to me. Maybe something wrong in the coffin definition so the game thinks it's not a blockage?
Probably destroy and spawn might need to be on two different frames?

Maybe - can you show me? Because I got crash calling func outside onDie frame...
I'm the Gate I'm the Key.
Dawn of Lore
User avatar
Leki
Posts: 550
Joined: Wed Sep 12, 2012 3:49 pm

Re: [ASSET] - DM SKELETON

Post by Leki »

No destroy in hooks, so I must use timer or another dirty solution, if I don't wanna touch onDrawGui... omfg...
I'm the Gate I'm the Key.
Dawn of Lore
User avatar
Diarmuid
Posts: 807
Joined: Thu Nov 22, 2012 6:59 am
Location: Montreal, Canada
Contact:

Re: [ASSET] - Surprise by Leki

Post by Diarmuid »

Leki wrote:
Diarmuid wrote:
Dr.Disaster wrote:Seems right to me. Maybe something wrong in the coffin definition so the game thinks it's not a blockage?
Probably destroy and spawn might need to be on two different frames?

Maybe - can you show me? Because I got crash calling func outside onDie frame...
Yeah, an object cannot be destroyed from it's own hook - same if you try to destroy for example a pressure plate from it's activate call.

Well you need a way to delay the destroy function. It's best if you have LoG framework installed, becase it has a delay implemented. If not, you'll need a delay script - I can make a quick one.
User avatar
germanny
Posts: 530
Joined: Sat Apr 07, 2012 10:52 pm
Location: Kiel, Germany

Re: [ASSET] - DM SKELETON

Post by germanny »

This is the (partly) definition of my newly created 'coffin in recess'. It works for me, snail spawns with no errors!

Code: Select all

defineObject{
	name = "dm_coffin_recess",
	class = "Blockage",
	model = "mod_assets/dmcsb_pack/models/env/dm_coffin_recess.fbx",
	brokenModel = "mod_assets/dmcsb_pack/models/env/dm_coffin_recess_broken.fbx",
	placement = "floor",
	health = 20,
	evasion = -1000,
	hitSound = "dm_chop",
	hitEffect = "hit_wood",
	editorIcon = 56,

	onDie = function(self)
		  party:shakeCamera(0.05,0.05)
		  playSound("dm_woodbreak")
                spawn("snail",self.level,self.x,self.y,self.facing)
		  end,
}
No need of destroying the coffin, because when the 'broken' model replaces the original automatically with onDie(), the status as blockage seems gone and didn´t exist anymore at this position!
*EDIT
BIG SORRY xD
After restarting the editor, i have 'invalid spawn..' too :/
Dungeon Master Resource Pack worker and passionated Beer drinker
User avatar
germanny
Posts: 530
Joined: Sat Apr 07, 2012 10:52 pm
Location: Kiel, Germany

Re: [ASSET] - DM SKELETON

Post by germanny »

Ok, i fumbled around.. and i 'quick' solved it in this way:
- make a field somewhere outside dungeon clear - say it´s loc. is 0,0
- set the monster in it
- set a teleporter there, settings: deactivated,invisible, silent, triggered by monster, set facing as destination should have.
- set teleporters target to desired pos. at the coffin
Or
spawn the monster over the teleporter..

This is quick, as said^^
I set 'teleporter_x:activate()' inside the object def. onDie().
This works, but in real it must be done in the dungeon via script entity. But i can´t attach a script to a blockage.
Changing to altar is FUD, as an altar can´t be destroyed. Damn .. AH xD
Dungeon Master Resource Pack worker and passionated Beer drinker
User avatar
Leki
Posts: 550
Joined: Wed Sep 12, 2012 3:49 pm

Re: [ASSET] - DM SKELETON

Post by Leki »

Yes, there is no problem to teleport objects out of the player view - place them on plate then do damage/destroy them there and spawn new guy on the right position, but my goal was to achieve this without this "ingame coffins manager script"... But there is no way to make it as simple and elegant "plugin" am afraid :cry:
I'm the Gate I'm the Key.
Dawn of Lore
Post Reply