Ask a simple question, get a simple answer
- AndakRainor
- Posts: 674
- Joined: Thu Nov 20, 2014 5:18 pm
Re: Ask a simple question, get a simple answer
Is there a way to define a material with transparency without it being visible in the dark ? I tried to do it for a custom monster based on the summon_stone, replacing its material with an ice version. It seems no blendMode except Opaque (or Modulative which is also useless) works correctly in the dark.
Re: Ask a simple question, get a simple answer
Blend modes other than Opaque do not support lighting. Lighting wouldn't even be meaningful for blend modes other than Opaque and Translucent.
The alphaTest field in the material definition exists so that you can use 1-bit alpha with the Opaque blend mode; pixels with alpha at or below the threshold (I think it's 127) are treated as completely transparent, pixels with alpha above the threshold are treated as completely opaque. Shadowmaps take it into account too.
If you want to use the Translucent blend mode with lighting, then the answer is no, sorry, you can't. Yes, it's quite inconvenient.
If you want to use the Additive, Modulative, or Screen blend modes with lighting, you need to learn what those words actually mean, because it wouldn't make any sense to try to apply lighting to them; you should think of them as screens that do arithmetic on pixels behind them, not as physical surfaces.
The alphaTest field in the material definition exists so that you can use 1-bit alpha with the Opaque blend mode; pixels with alpha at or below the threshold (I think it's 127) are treated as completely transparent, pixels with alpha above the threshold are treated as completely opaque. Shadowmaps take it into account too.
If you want to use the Translucent blend mode with lighting, then the answer is no, sorry, you can't. Yes, it's quite inconvenient.
If you want to use the Additive, Modulative, or Screen blend modes with lighting, you need to learn what those words actually mean, because it wouldn't make any sense to try to apply lighting to them; you should think of them as screens that do arithmetic on pixels behind them, not as physical surfaces.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
- AndakRainor
- Posts: 674
- Joined: Thu Nov 20, 2014 5:18 pm
Re: Ask a simple question, get a simple answer
Well I never used modulative blending before, I know what the others do and why an additive mode will never be as dark as its background
So I see modulative is about multiplying colors noted as floats in range 0 to 1... So this one only makes things darker, not what I would need for ice.
I tested the 4 modes listed in the github wiki, just to see if the names fit them well! I never heard about a screen blend mode before, I guess it can be found in the assets pack.
Too bad we can't write shaders! I wrote one for opengl some time ago with lightning and transparency, so I thougth that would be included in grimrock... The only problem with it is not lightning but well planed rendering order, so...
But no problem, easy solution; my ice golem will get a light source to hide its misery
edit: I won't search into it too much for having messed with it before, but there is at least one shader with lightning and transparency in the game : water! (Unusable and the only one I guess...)
So I see modulative is about multiplying colors noted as floats in range 0 to 1... So this one only makes things darker, not what I would need for ice.
I tested the 4 modes listed in the github wiki, just to see if the names fit them well! I never heard about a screen blend mode before, I guess it can be found in the assets pack.
Too bad we can't write shaders! I wrote one for opengl some time ago with lightning and transparency, so I thougth that would be included in grimrock... The only problem with it is not lightning but well planed rendering order, so...
But no problem, easy solution; my ice golem will get a light source to hide its misery
edit: I won't search into it too much for having messed with it before, but there is at least one shader with lightning and transparency in the game : water! (Unusable and the only one I guess...)
Re: Ask a simple question, get a simple answer
The water shader doesn't use lighting either. You're just seeing the reflections/refactions of things that do use lighting.AndakRainor wrote:edit: I won't search into it too much for having messed with it before, but there is at least one shader with lightning and transparency in the game : water! (Unusable and the only one I guess...)
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
- AndakRainor
- Posts: 674
- Joined: Thu Nov 20, 2014 5:18 pm
Re: Ask a simple question, get a simple answer
I am failing at defining a pit that should kill the party and does not lead to the map below (there is none).
Also, I would like it to be placed by a custom tile, with no model for the tile (like the void tile) nor for the pit (got bugs with shafts the required builder tries to place).
Is there any hope ?
Also, I would like it to be placed by a custom tile, with no model for the tile (like the void tile) nor for the pit (got bugs with shafts the required builder tries to place).
Is there any hope ?
- AndakRainor
- Posts: 674
- Joined: Thu Nov 20, 2014 5:18 pm
Re: Ask a simple question, get a simple answer
The Shaman Staff item has this line:
I don't see anything else in the definition that implements this effect. I think gameEffect is only a gui description, so my question is, how does this work, and is there any other similar effect that can be used for a custom item ?
Code: Select all
gameEffect = "Earthbound (Poison spells deal 20% more damage)",
Re: Ask a simple question, get a simple answer
It's hardcoded. If the champion has an item defined as "shaman_staff" equipped when they cast a poison spell, they get the bonus. You'd have to reimplement the standard spells to make a similar effect for any other item.
Note that Zhandul's Orb actually has no special effect in Grimrock 2, it doesn't make fire spells any more powerful.
Note that Zhandul's Orb actually has no special effect in Grimrock 2, it doesn't make fire spells any more powerful.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
- zimberzimber
- Posts: 432
- Joined: Fri Feb 08, 2013 8:06 pm
Re: Ask a simple question, get a simple answer
Got two questions here:
1) Where are the condition definitions located in the asset pack? (like poisoned or diseased)
2) Is it possible for a condition to receive and store data, and do something based on the data stored upon its expiration?
For example - New condition named Hex. Upon receiving it, Hex checks the champions health and stores it. When it expires, it deals damage or heals the champion based on the difference between the health they had upon receiving the condition and their current health.
1) Where are the condition definitions located in the asset pack? (like poisoned or diseased)
2) Is it possible for a condition to receive and store data, and do something based on the data stored upon its expiration?
For example - New condition named Hex. Upon receiving it, Hex checks the champions health and stores it. When it expires, it deals damage or heals the champion based on the difference between the health they had upon receiving the condition and their current health.
My asset pack [v1.10]
Features a bit of everything!
Features a bit of everything!
Re: Ask a simple question, get a simple answer
They aren't. Custom conditions were added in 2.2.4.zimberzimber wrote:Got two questions here:
1) Where are the condition definitions located in the asset pack? (like poisoned or diseased)
Store the data in a ScriptComponent somewhere.zimberzimber wrote:2) Is it possible for a condition to receive and store data, and do something based on the data stored upon its expiration?
For example - New condition named Hex. Upon receiving it, Hex checks the champions health and stores it. When it expires, it deals damage or heals the champion based on the difference between the health they had upon receiving the condition and their current health.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
- zimberzimber
- Posts: 432
- Joined: Fri Feb 08, 2013 8:06 pm
Re: Ask a simple question, get a simple answer
Alright, is there somewhere I can view an example of a condition to use as a reference for creating a new one? (if possible)minmay wrote:They aren't. Custom conditions were added in 2.2.4.
My asset pack [v1.10]
Features a bit of everything!
Features a bit of everything!