Page 1 of 1
Messages and item states
Posted: Sat Apr 07, 2007 12:12 pm
by Joramun
How do you make an item start "inactivated" like a teleporter not teleporting until you activate it, or even having a particular state where it calls the teleport function only when it recieves the M_ACTIVATE message ?
- I would gladly have to new messages : M_ENABLE, and M_DISABLE.
A disabled object would respond ONLY to the M_ENABLE message, by becoming enabled. It would otherwise : block dsb_message_chain (except the M_ENABLE message, maybe), be invisible in the dungeon, and overall considered as non existent in the game.
An enabled object, is just a normal object.
If you think that's there an existing way of doing what i imply, please explain !
Posted: Sat Apr 07, 2007 2:30 pm
by Joramun

Relaying messages :
make dsb_msg_chain(id, target) work
in a different way :
Code: Select all
when (id) receives a message (M) :
if (id.msg) equals (nil) then
relay (M) to (target)
else
relay (id.msg) to (target)
Then to make basic relay I just need a dummy item called "relay" that has a msg exvar.

The other solution is making a relay item that automatically chains its message toward all of his targets when activated.
Re: Messages and item states
Posted: Sat Apr 07, 2007 11:32 pm
by Sophia
Joramund wrote:How do you make an item start "inactivated"
Calling dsb_disable() on the instance as soon as it's spawned should do it, right?
Joramund wrote:If you think that's there an existing way of doing what i imply, please explain !
I don't really understand what you want, here.
However, maybe it's not needed any more. Look at 0.10, I added "x_relay" and "x_counter" types that should do what is needed for RTSB. (The x_ is because they're for emulation and I don't know how much use they'd be in from-scratch DSB dungeons)
Joramund wrote:make dsb_msg_chain(id, target) work in a different way
This is an interesting idea, but I'm a bit against it because that requires checking the "msg" exvar. Right now a msg chain is handled by the engine and is "blind"-- it will work regardless of exvars or anything else, in case the designer is ambitious and has created a totally new (and weird) messaging system.
So, I think "x_relay" should do for now.
But please let me know if you have any more questions/problems.

Re: Messages and item states
Posted: Sun Apr 08, 2007 12:31 pm
by Joramun
Sophia wrote:Joramund wrote:How do you make an item start "inactivated"
Calling dsb_disable() on the instance as soon as it's spawned should do it, right?
Sophia wrote:Joramund wrote:If you think that's there an existing way of doing what i imply, please explain !
I don't really understand what you want, here.
The confusion comes from the fact that I thought of a "deactivated" item as an item in its alternate state, while "disabled" meant invisible in the dungeon. But since there is no such difference in dsb, my idea was pointless. Sorry
Sophia wrote:However, maybe it's not needed any more. Look at 0.10, I added "x_relay" and "x_counter" types that should do what is needed for RTSB. (The x_ is because they're for emulation and I don't know how much use they'd be in from-scratch DSB dungeons)
That rocks. I should be able to release RTSB and the DM dungeon really soon !