What is the least trouble-prone, least headache-inducing way to temporarily make an instance stay on the same tile as the party (move with the party when it changes tile for any reason, including walking, falling dow a pit, taking stairs, getting teleported, acts of code, etc...) while changing the base code as little as possible?
The objective is to create an overlay like the ones in CSBWin, using a custom haze that is only visible when the party stands on it (and has a front0 view that displays the overlay.) If there is a better way to make overlays in DSB, I'm open to hearing about that as well.
Note: the overlay would need to be applied when the party does certain things (say, for instance, when a particular spell is cast) and would be removed under some conditions (time deadline in general, but anything is possible). Consequently, the property is not confined to a given area of the dungeon, and I am not going to tile the entire dungeon with the custom haze!
Attaching an instance to the party
Moderator: Sophia
Forum rules
Please read the Forum rules and policies before posting. You may
to help finance the hosting costs of this forum.
Please read the Forum rules and policies before posting. You may

- Sophia
- Concise and Honest
- Posts: 4306
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Well, to make an instance move with the party, you could always override sys_party_move. However, in this case, there's a better way. 
What you really want is a party condition.
When this condition is set, gfx.overlay will be drawn on top of the party's viewport. The overlay includes support for alpha channels if you want transparent parts.
Also, every update_freq tick, it will execute update_func. If you don't need an update, just set update to 0 and the function to nil.
To set (that is, "enable") the condition, do:
Value is a "strength" for the condition. If value is 0, the condition is cleared.
This is how poisoning, magic shields, etc. are handled. Check base/conditions.lua for more information.

What you really want is a party condition.
Code: Select all
C_NEW_COND = dsb_add_condition(PARTY, nil, gfx.overlay, update_freq, update_func)
Also, every update_freq tick, it will execute update_func. If you don't need an update, just set update to 0 and the function to nil.
To set (that is, "enable") the condition, do:
Code: Select all
dsb_set_condition(PARTY, C_NEW_COND, value)
This is how poisoning, magic shields, etc. are handled. Check base/conditions.lua for more information.