[ASSET] - DM SKELETON RAISING FROM COFFIN
Re: [ASSET] - Surprise by Leki
Do you have the same result if onDie refers to an ingame script with object as parameter ?
- Dr.Disaster
- Posts: 2876
- Joined: Wed Aug 15, 2012 11:48 am
Re: [ASSET] - Surprise by Leki
This is germanny's big mushroom definition.
When the big mushroom is destroyed by the party it leaves it with some mushroom slices.
Maybe just replacing your "coffin" with "self" does the trick.
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,
}
Re: [ASSET] - Surprise 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
Dawn of Lore
Re: [ASSET] - Surprise by Leki
"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.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.Maybe just replacing your "coffin" with "self" does the trick.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, }
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
Dawn of Lore
Re: [ASSET] - Surprise by Leki
Diarmuid wrote:Probably destroy and spawn might need to be on two different frames?Dr.Disaster wrote:Seems right to me. Maybe something wrong in the coffin definition so the game thinks it's not a blockage?
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
Dawn of Lore
Re: [ASSET] - DM SKELETON
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
Dawn of Lore
Re: [ASSET] - Surprise by Leki
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.Leki wrote:Diarmuid wrote:Probably destroy and spawn might need to be on two different frames?Dr.Disaster wrote:Seems right to me. Maybe something wrong in the coffin definition so the game thinks it's not a blockage?
Maybe - can you show me? Because I got crash calling func outside onDie frame...
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.
Re: [ASSET] - DM SKELETON
This is the (partly) definition of my newly created 'coffin in recess'. It works for me, snail spawns with no errors!
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 :/
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,
}
*EDIT
BIG SORRY xD
After restarting the editor, i have 'invalid spawn..' too :/
Dungeon Master Resource Pack worker and passionated Beer drinker
Re: [ASSET] - DM SKELETON
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
- 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
Re: [ASSET] - DM SKELETON
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

I'm the Gate I'm the Key.
Dawn of Lore
Dawn of Lore