"opby" question
Moderator: Sophia
Forum rules
Please read the Forum rules and policies before posting.
Please read the Forum rules and policies before posting.
"opby" question
Hi,Sophia.
I'd like to continuously sound a Waterdrop-SE When the dungeon is begging (before a champion is ressurected or reincarnated)
So,How to check "Whether or not Theron?" when stepping on the Invisible-trigger?(like a "opby = party_empty" in RTC)
I'd like to continuously sound a Waterdrop-SE When the dungeon is begging (before a champion is ressurected or reincarnated)
So,How to check "Whether or not Theron?" when stepping on the Invisible-trigger?(like a "opby = party_empty" in RTC)
- Sophia
- Concise and Honest
- Posts: 4306
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Re: "opby" question
The basic trigger can't be stepped on by an empty party. To make this possible, you'll need to create an objects.lua in your own custom dungeon's folder and add an object like this:
Then use your new "trigger_noparty" wherever you need it to be set off by an empty party and it will then allow opby_party to work even without characters in the party.
If you want a trigger that is triggered only by an empty party, that's a bit more tricky.
I won't bore you with all the details unless this is what you actually need.
Code: Select all
obj.trigger_noparty = clone_arch(obj.trigger, {
no_party_triggerable = true
} )
If you want a trigger that is triggered only by an empty party, that's a bit more tricky.

I won't bore you with all the details unless this is what you actually need.
Re: "opby" question
Yeah, This is a good enough answer!!
The code was worked collectly in my custom dungeon.
Thanx!!


The code was worked collectly in my custom dungeon.
Thanx!!
Maybe clone_arch isn't a standard Lua function. But it is useful.ian_scho wrote:clone_arch Isn't a standard lua funcion, is it?

- Sophia
- Concise and Honest
- Posts: 4306
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Re: "opby" question
No, it's not. Lua has no built-in way to do a shallow copy of a table, actually-- which is all clone_arch actually does, for the most part. It lets you merge in a second table, too, because it's essentially automating the cut-and-paste-and-make-changes you'd have to do to clone an arch by hand. It just doesn't have a dsb_ prefix because it's defined in base/util.lua and thus isn't actually part of the DSB core as such.ian_scho wrote:clone_arch Isn't a standard lua funcion, is it?
Re: "opby" question
Sorry for dumbness, but is it possible to make a trigger, that is operated ONLY by a specific character? Like a floor trigger, that opens a door only when Zed steps on it?
Edit: hmm, it could be done by adding to Zed`s inventory a special, Zed-devoted item, that doesn`t exist elsewhere in the dungeon. But what if a player throws it out?
Edit: hmm, it could be done by adding to Zed`s inventory a special, Zed-devoted item, that doesn`t exist elsewhere in the dungeon. But what if a player throws it out?
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
- Sophia
- Concise and Honest
- Posts: 4306
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Re: "opby" question
This is now much more easily doable in DSB 0.42 with the "trigger_controller" arch.
Re: "opby" question
what if I want to build a counter, or any trigger, that works ONCE ONLY? I used to do like that in CSbuild, because there was special "OO" option. I noticed, that adding "disable_self" or "destroy" exvars doesn`t work that way.
Sorry my questions are stupid, but it`s hard to switch from one editor to another without pain
Sorry my questions are stupid, but it`s hard to switch from one editor to another without pain

Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
Re: "opby" question
I suggest to you try to use "M_RESET" exver with trigger(counter or msg_handler) objects.
If you send "M_RESET" msg to object with "disable" which is worked,
The "inactive" object would reset "active" and work again.
If you send "M_RESET" msg to object with "disable" which is worked,
The "inactive" object would reset "active" and work again.
Re: "opby" question
how to add the "x_relay" trigger? It`s not in FLOOR FLATS/MECHANICS section
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
Re: "opby" question
Qwerty, what I mean is I need a trigger, that operates OO (once_only). For example a doorbutton: you add special "OO" exvar and the doorbutton will work only once and won`t work any more later. For example: if you operate doorbutton with OO flag when the door are closed, the only thing you can do is to open it once and nothing more will happen; if they`re opened, the doorbutton will just close it (and won`t work later). That`s the exvar I need. I noticed that disable_self doesn`t work this way.
EDIT: I got it now. "disable_self" exvar works only with opby items, never with triggers like doorbutton etc. However, objects like doorbuttons can be destroyed by using ANY additional message as a target on them (which means doorbutton will just disappear after one use).
EDIT: I got it now. "disable_self" exvar works only with opby items, never with triggers like doorbutton etc. However, objects like doorbuttons can be destroyed by using ANY additional message as a target on them (which means doorbutton will just disappear after one use).
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
Re: "opby" question
I noticed one more: I assume open door are in ACTIVE state, while closed door are in INACTIVE state. But when you change a message sent by a doorbutton from "toggle" (currently opposite state, which is either activate or deactivate) to "deactivate", it will work just like it still sends "toggle" message! When a doorbutton sends "dectivate" message to closed door, it should open. But when a doorbutton sends "deactivate" to open door, nothing should happen! I don`t understand that.
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
- Sophia
- Concise and Honest
- Posts: 4306
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Re: "opby" question
Doorbuttons don't use the normal opby system so they're unfortunately not that easy to make work once only like most floor triggers and buttons. I'm not quite sure what use it'd be to disable some of the mechanics archs like this...Adamo wrote:Qwerty, what I mean is I need a trigger, that operates OO (once_only).
Don't use it. It's just for porting RTC dungeons.Adamo wrote:how to add the "x_relay" trigger? It`s not in FLOOR FLATS/MECHANICS section
The "msg_sender" can do everything the "x_relay" can and more. Use it instead.

It's the other way around.Adamo wrote:I noticed one more: I assume open door are in ACTIVE state, while closed door are in INACTIVE state.

Re: "opby" question
Sophia wrote:
I tried to change a destination of the DOORBUTTON from the DOOR, as usual, to some other counter or something.. then that will send a message back to a DOOR.. but counters or msg_senders would also have to work once only.. and they floorFlats/Mechanics doesn`t accept disable_self exvarDoorbuttons don't use the normal opby system so they're unfortunately not that easy to make work once only like most floor triggers and buttons. I'm not quite sure what use it'd be to disable some of the mechanics archs like this...
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
- Sophia
- Concise and Honest
- Posts: 4306
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Re: "opby" question
This code is experimental, I'm not sure if it'll break something down the line.
But, try replacing doorbutton_push found in base/triggers.lua with this:
This should make disable_self work for doorbuttons as well.
But, try replacing doorbutton_push found in base/triggers.lua with this:
Code: Select all
function doorbutton_push(self, id, what)
if (exvar[id].disabled) then
return false
end
dsb_sound(snd.click)
got_triggered(id, what)
end