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.
Does DSB has object "lifetime" like RTC?
Moderator: Sophia
Forum rules
Please read the Forum rules and policies before posting.
Please read the Forum rules and policies before posting.
- Sophia
- Concise and Honest
- Posts: 4240
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Re: Does DSB has object "lifetime" like RTC?
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.
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?
Wow! This is what I REALLY want to! 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.
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
- Sophia
- Concise and Honest
- Posts: 4240
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Re: Does DSB has object "lifetime" like RTC?
It keeps trying to view the item even though it is now nonexistent. I'll fix that.