Page 1 of 1
Affecting object transparency?
Posted: Mon Aug 14, 2006 1:48 pm
by Gambit37
Would it be possible to add an action that can change an object's transparency value?
For example, it could be used in a spell that allows illusion walls to temporarily be made partially see-through....

Posted: Mon Aug 14, 2006 3:47 pm
by beowuuf
You could do this by making a spell that swaps wall_fake to wall_fake_partially see through, and at the end of the duration swaps them all back again, couldn't you?
Posted: Mon Aug 14, 2006 4:01 pm
by Gambit37
It's not possible to affect the rendering of cloned fake walls (because they are rendered exactly the same as normal walls and those bitmaps are always solid), hence the need for a more general action.
Posted: Wed Aug 16, 2006 11:59 am
by linflas
then don't clone a fake wall but another flooritem ?
Posted: Wed Aug 16, 2006 12:50 pm
by beowuuf
Yeah, a haze would be best, since you could walk through them anyway... I jknow the fake wall hand action would be neutralised, but then you don't need it, as it's see throughable now
Posted: Wed Aug 16, 2006 2:56 pm
by Gambit37
You miss the point of my post -- I'm looking for a generic action that can altar the transparency of any object, whether it be floor item, wall, object, monster, etc -- the illusion wall was just an example.
Posted: Wed Aug 16, 2006 4:21 pm
by Daecon
But then what would be seen "behind" it, or would only the image "on top" be made transparent?
If you had a monster in front of another monster, would they both be transparent, or just the monster in front?
Posted: Wed Aug 16, 2006 7:40 pm
by Gambit37
It wouldn't matter -- the action would be used to target say, all illusion walls, or one specific monster, or all worm rounds, or whatever -- if semi-transparent objects end up over others, so be it -- RTC draws everything from the back to the front anyway, so it would be handled automatically.
Presumably.
Posted: Wed Aug 16, 2006 7:56 pm
by beowuuf
Transparent wall with alcove - i don't think the engine knows how to draw the object on the other sides, does it? I could be wrong...
Posted: Wed Aug 16, 2006 9:31 pm
by Gambit37
Yeah, true, but I don't think that matters really. It doesn't need to be 100% realistic.
Re: Actions to affect object transparency?
Posted: Sat Aug 26, 2006 6:20 pm
by George Gilbert
In summary, everything suggested here can already be done!
Gambit37 wrote:Would it be possible to add an action that can change an object's transparency value?
On purely semantic terms - No - an object is immutable. Remember the difference between "object" and "item" - an object is a theoretical concept, an abstract form that can't be altered. An item is a specific instance of something that can be changed.
What you can do though is SWAP a specific item with a given object type into another one with a different object type (the first object type having opaque bitmaps, the second having transparent). That would give you the effect you want.
Gambit37 wrote:For example, it could be used in a spell that allows illusion walls to temporarily be made partially see-through.... ;)
Just have the wall on the same tile as a WALLSET_ALT and swap the WALLSET_ALT type on the casting of the spell between a wallset with opaque bitmaps and one with transparent ones...that way only the tiles you want will change - nothing to do with the properties of the fake wall per se.
Re: Actions to affect object transparency?
Posted: Sun Aug 27, 2006 11:35 am
by Gambit37
Does it really have to be that complicated? Is it really not possible to have a general action to do this arbitrarily to any item?
George Gilbert wrote:What you can do though is SWAP a specific item with a given object type into another one with a different object type (the first object type having opaque bitmaps, the second having transparent). That would give you the effect you want.,
It's exactly this unnecessary bloating of duplicated resources that I'm trying to avoid. You have a transparency flag in the engine already to render things 50% opaque -- why can't we simply invoke that using an action?
George Gilbert wrote:Just have the wall on the same tile as a WALLSET_ALT and swap the WALLSET_ALT type on the casting of the spell between a wallset with opaque bitmaps and one with transparent ones...that way only the tiles you want will change - nothing to do with the properties of the fake wall per se.
This is a nice solution but it again means duplicated bitmaps -- unless RTC is clever enough not to import duplicates when the difference is only the transparency flag?
Re: Actions to affect object transparency?
Posted: Sun Aug 27, 2006 1:43 pm
by George Gilbert
Gambit37 wrote:Does it really have to be that complicated? Is it really not possible to have a general action to do this arbitrarily to any item?
No, for all sorts of reasons.
Firstly, because the bitmaps are a separate resource from objects. This means that multiple objects can use the same bitmap (e.g. the clothing bitmaps in DM). If you toggled the transparancy of one, then all the others would change too.
Secondly, because the objects are a separate resource from items. So if you had several items all of the same object type toggling one item would change all the others too.
Thirdly, because the all the images are cached as the game is being played. Changing the properties of an individual bitmap mid-way through would cause all sorts of performance problems.
Fourthly (and this one is specific to your example), the fake wall object doesn't have any bitmaps associated with it, so there's nothing to toggle.
I'm sure there are probably others, but that'll do for now

Posted: Sun Aug 27, 2006 1:56 pm
by Gambit37
OK, fair enough! I shall go away now... *shuffles off stage left*