Affecting object transparency?

Questions about how to create your own dungeons and replacement graphics and sounds.

Moderator: George Gilbert

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Affecting object transparency?

Post 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.... ;)
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post 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?
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post 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.
User avatar
linflas
My other avatar is gay
Posts: 2445
Joined: Tue Nov 04, 2003 9:58 pm
Location: Lille, France
Contact:

Post by linflas »

then don't clone a fake wall but another flooritem ?
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post 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
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post 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.
User avatar
Daecon
Expert
Posts: 329
Joined: Tue May 16, 2006 1:56 pm
Location: Upper Hutt, New Zealand

Post 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?
Child of Darkness,
Child of Light,
Cast your Influence,
Cast your Might!
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post 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.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post 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...
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

Yeah, true, but I don't think that matters really. It doesn't need to be 100% realistic.
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Re: Actions to affect object transparency?

Post 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.
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Actions to affect object transparency?

Post 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?
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Re: Actions to affect object transparency?

Post 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 :wink:
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

OK, fair enough! I shall go away now... *shuffles off stage left*
Post Reply