(fixed) Weird trigger bug

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting. You may Image to help finance the hosting costs of this forum.
Post Reply
User avatar
Joramun
Mon Master
Posts: 927
Joined: Thu May 25, 2006 7:05 pm
Location: The Universe

(fixed) Weird trigger bug

Post by Joramun »

For some reason "opby_class" doesn't work in the following situation:
A trigger inside a wall, an alcove, when putting the right item in the alcove.
I use that because I want to use "const_weight" and alcoves don't have this option.

I looked in the base code and did not find the reason.
I carefully checked, compiled and tried to modify the situation. It works with :
opby="waterskin"
but not with:
opby_class="WATERSKIN"
What Is Your Quest ?
User avatar
Sophia
Concise and Honest
Posts: 4307
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: (fixed) Weird trigger bug

Post by Sophia »

I don't know how this one managed to survive for so long. :shock:

Around line 421 of triggers.lua, replace this:

Code: Select all

if (thing_arch.class == obj[exvar[id].opby_class]) then
with:

Code: Select all

if (thing_arch.class == exvar[id].opby_class) then
User avatar
Joramun
Mon Master
Posts: 927
Joined: Thu May 25, 2006 7:05 pm
Location: The Universe

Re: (fixed) Weird trigger bug

Post by Joramun »

Bleh, i didn't even see it.
What Is Your Quest ?
User avatar
ian_scho
High Lord
Posts: 2807
Joined: Fri Apr 07, 2006 8:30 am
Location: Zaragoza, Spain

Re: (fixed) Weird trigger bug

Post by ian_scho »

There are two more references to this 'obj' object in the lines above the code. It also appears in the blocker_no_monsters function. Is it some kind of magic über object that exists globally?!
User avatar
Sophia
Concise and Honest
Posts: 4307
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: (fixed) Weird trigger bug

Post by Sophia »

obj is just the table of all objects, as defined in objects.lua.
For any arch name, obj[arch_name] is just a reference to its table entry.

So yes, I guess it kind of is. :P
User avatar
ian_scho
High Lord
Posts: 2807
Joined: Fri Apr 07, 2006 8:30 am
Location: Zaragoza, Spain

Re: (fixed) Weird trigger bug

Post by ian_scho »

<The sound of the palm slapping a forehead> Doh! Oh I knew that. gfx is for graphics and snd is for sound, etc. Thanks!
Post Reply