Page 115 of 396
Re: Ask a simple question, get a simple answer
Posted: Sun Mar 13, 2016 2:07 pm
by AndakRainor
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
Posted: Sun Mar 13, 2016 2:27 pm
by minmay
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.
Re: Ask a simple question, get a simple answer
Posted: Sun Mar 13, 2016 6:33 pm
by AndakRainor
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...)
Re: Ask a simple question, get a simple answer
Posted: Mon Mar 14, 2016 12:06 am
by minmay
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...)
The water shader doesn't use lighting either. You're just seeing the reflections/refactions of things that do use lighting.
Re: Ask a simple question, get a simple answer
Posted: Sat Mar 26, 2016 5:43 pm
by AndakRainor
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 ?
Re: Ask a simple question, get a simple answer
Posted: Wed Mar 30, 2016 12:39 am
by AndakRainor
The Shaman Staff item has this line:
Code: Select all
gameEffect = "Earthbound (Poison spells deal 20% more damage)",
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 ?
Re: Ask a simple question, get a simple answer
Posted: Wed Mar 30, 2016 1:02 am
by minmay
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.
Re: Ask a simple question, get a simple answer
Posted: Wed Mar 30, 2016 12:32 pm
by zimberzimber
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.
Re: Ask a simple question, get a simple answer
Posted: Wed Mar 30, 2016 1:00 pm
by minmay
zimberzimber wrote:Got two questions here:
1) Where are the condition definitions located in the asset pack? (like poisoned or diseased)
They aren't. Custom conditions were added in 2.2.4.
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.
Store the data in a ScriptComponent somewhere.
Re: Ask a simple question, get a simple answer
Posted: Wed Mar 30, 2016 6:00 pm
by zimberzimber
minmay wrote:They aren't. Custom conditions were added in 2.2.4.
Alright, is there somewhere I can view an example of a condition to use as a reference for creating a new one? (if possible)