DM :
The ending was already in, in the fuse method !
Sophia, can you add a call to dsb_endgame() after the end of the fuse animation in the base code ?
CSB :
I'll add the endgame_pad functionality...
It will actually just be a trigger with :
exvar[trig].func = dsb_delay_func( 100,dsb_endgame() )
I don't see the point in adding the corresponding archtype or modifying RTSB just for that feature though.
If someone ask for it, I'll modify RTSB, but not just for me...
DSB and CSB finalization
Moderator: Sophia
Forum rules
Please read the Forum rules and policies before posting.
Please read the Forum rules and policies before posting.
- linflas
- My other avatar is gay
- Posts: 2445
- Joined: Tue Nov 04, 2003 9:58 pm
- Location: Lille, France
- Contact:
Re: DSB and CSB finalization
if that is done in the base code, then fusing some lord chaos in a custom dungeon will mean end of game all the time ! and if you want to have *something* after lord chaos fusing ?Joramund wrote:DM :
The ending was already in, in the fuse method !
Sophia, can you add a call to dsb_endgame() after the end of the fuse animation in the base code ?
Don't be mad at me
Ok, then, I need to find a work around... creating a whole new lordchaos seems a bit of overdoing it, though.
Maybe : just add an exvar "endboss", and check for the exvar to be true in the fuse method...
That makes me think about something :
Is it possible to define "generic hooks" ?
For example, when a system hook like "on_die" is called,
To have in startup.lua something like :
global_hooks.on_die=func(id,arch)
And the function to be called everytime such a hook is called, whatever the archetype...
If I'm not making any sense or if it has some consequences I do not foresee, just stop me.
Ok, then, I need to find a work around... creating a whole new lordchaos seems a bit of overdoing it, though.
Maybe : just add an exvar "endboss", and check for the exvar to be true in the fuse method...
That makes me think about something :
Is it possible to define "generic hooks" ?
For example, when a system hook like "on_die" is called,
To have in startup.lua something like :
global_hooks.on_die=func(id,arch)
And the function to be called everytime such a hook is called, whatever the archetype...
If I'm not making any sense or if it has some consequences I do not foresee, just stop me.
What Is Your Quest ?
Re: DSB and CSB finalization
Ok I had a bug, so I changed the line into that :
Second : I could have done :
exvar[trig] = { func= dsb_delay_func , func_data = { 100, dsb_game_end } }
But I wasn't sure it would work anyway...
First : because with parenthesis, it results in immediate execution of the function, and the exvar is just set to the return value of dsb_game_end()Joramund wrote:DM :
exvar[trig].func = dsb_game_end
Second : I could have done :
exvar[trig] = { func= dsb_delay_func , func_data = { 100, dsb_game_end } }
But I wasn't sure it would work anyway...
What Is Your Quest ?
- Sophia
- Concise and Honest
- Posts: 4240
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Most of the role of these "generic" functions you mention is carried out by various sys_ functions. For example, when any monster dies, sys_kill_monster is called.
Or is that not what you meant?
Anyway, Linflas is right, adding the endgame right into the fuse animation seems to restrict flexibility. This is why I just added the function call for the time being, so we could figure out the best way to actually use it in practice.
Or is that not what you meant?
Anyway, Linflas is right, adding the endgame right into the fuse animation seems to restrict flexibility. This is why I just added the function call for the time being, so we could figure out the best way to actually use it in practice.
About CSB : well, the 'func' exvar works fine.
About DM :
I need to find a way to throw the end of the game once lordchaos is dead.
Generic functions :
I'm not sure we're talking exactly about the same thing :
At least two functions are called when a monster dies :
- sys_kill_monster (for all monster archtypes)
- on_die (for specified monster archtypez)
What I would have, is at least one or two other ways to call functions when a given monster dies :
- a hook for a function defined for a specified monster instance
- a hook for a function like sys_kill_monster, but not meant to override it, just to do additional stuff.
(This reasoning can apply to any archtype and event in the game, not just a monster death)
About DM :
I need to find a way to throw the end of the game once lordchaos is dead.
Generic functions :
I'm not sure we're talking exactly about the same thing :
At least two functions are called when a monster dies :
- sys_kill_monster (for all monster archtypes)
- on_die (for specified monster archtypez)
What I would have, is at least one or two other ways to call functions when a given monster dies :
- a hook for a function defined for a specified monster instance
- a hook for a function like sys_kill_monster, but not meant to override it, just to do additional stuff.
(This reasoning can apply to any archtype and event in the game, not just a monster death)
What Is Your Quest ?
You know, there's nothing wrong with overriding the base functions. The easy way to override and still get all the old functionality is to assign the old function to a variable before creating your new override.- a hook for a function like sys_kill_monster, but not meant to override it, just to do additional stuff.
For example, this code will override sys_kill_monster without having to rewrite everything the old function did.
Code: Select all
old_kill_monster = sys_kill_monster --set old sys_func to variable
function sys_kill_monster(id)
old_kill_monster(id) --call old sys_func
-- Insert your code here ---
-- For example:
-- dsb_write(debug_color, "DIE MONSTER DIE!")
end
- Parallax
- DMwiki contributor
- Posts: 424
- Joined: Mon Aug 28, 2006 7:56 pm
- Location: Back in New Jersey
If you are looking for just one particular instance of a certain archetype to die, you can either:
- Make that monster a different archetype, that is just like the original archetype, but with its own on_die event OR
- Preface the on_die function with
if id=Special_Monster_735_Mr_Snowflake then
and handle your special case from there.
- Make that monster a different archetype, that is just like the original archetype, but with its own on_die event OR
- Preface the on_die function with
if id=Special_Monster_735_Mr_Snowflake then
and handle your special case from there.