Page 1 of 1

Does DSB has object "lifetime" like RTC?

Posted: Tue Nov 19, 2013 11:23 am
by Qwerty
As a subject, RTC can add "lifetime" to new object that item is disappeared or be executed action when its lifetime is expired. I made a code that magical item appears when you cast specify magic, and disappears when spell duration is expired.

Here are two different sample codes.(Behavior is almost same.)

Sample code:
http://www.mediafire.com/download/36ydm ... ample1.zip
http://www.mediafire.com/download/ui5c4 ... ample2.zip

I wish I could made these codes with adding lifetime like RTC, But I am not sure if DSB has it and tweak it.

Re: Does DSB has object "lifetime" like RTC?

Posted: Tue Nov 19, 2013 8:53 pm
by Sophia
You'll want to use an expire message. You have to do a bit more work than in RTC, but it's also more flexible.

http://www.dungeon-master.com/forum/vie ... 0&#p135970

By default, an object receiving an expire message simply disappears, which is often what you want, but you can write code to do anything else, too.

Re: Does DSB has object "lifetime" like RTC?

Posted: Wed Nov 20, 2013 11:35 am
by Qwerty
Wow! This is what I REALLY want to! :shock: Thanks to add utility on_events for DSB!

P.S.
What a shame! Item disappearance with these on-events has some trouble while watching the item on eye-icon.

Code: Select all

PROGRAM CRASH!
Location: 0 0 0
Reason: Segmentation Fault
Stack Dump:
DSBmain
DSBgameloop
render_inventory_view

Re: Does DSB has object "lifetime" like RTC?

Posted: Wed Nov 20, 2013 10:05 pm
by Sophia
It keeps trying to view the item even though it is now nonexistent. I'll fix that.