No they don't.zimberzimber wrote:Icon atlases also require a ^2 dimension though.
Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
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
Game crashed when I attempted to use a non ^2 dimension for an atlas though, same errorminmay wrote:No they don't.zimberzimber wrote:Icon atlases also require a ^2 dimension though.
My asset pack [v1.10]
Features a bit of everything!
Features a bit of everything!
Re: Ask a simple question, get a simple answer
You are probably trying to use DXT compression on an image without width and height divisible by 4 again. Save it in RGBA8 uncompressed with no mipmaps. Which you should have always been doing in the first place for GUI elements, since they don't use mipmaps and, again, DXT compression on GUI elements looks fricking awful.
Edit: To be 100% clear. This is not a Grimrock limitation. S3 texture compression (which is what we mean when we say "DXT") is based on blocks of 4x4 pixels. A DXT compressed texture definitionally does not support dimensions that are not divisible by 4. When you save a 254x255 DXT1 image with Paint.net or the GIMP plugin or whatever, the definition of the decompression algorithm is no longer sufficient to decompress the image, so you are trying to rely on DirectX, OpenGL, and the GPU all using the same nonstandard decompression method that Paint.net does. (Spoiler alert: they don't)
DXT looks awful for most 2D images because it blurs pixels and greatly reduces color resolution. The lack of color resolution is the main reason it gives terrible results for RGB normal maps; the green/alpha format used by Grimrock 2 is a workaround to get better color resolution. Most 2D stuff and especially GUI elements relies on sharp lines and crisp colors. 3D textures, on the other hand, rarely need sharp lines or full 24-bit color resolution because the colors are getting transformed by perspective and lights and filtering in the 3D world anyway.
Edit: To be 100% clear. This is not a Grimrock limitation. S3 texture compression (which is what we mean when we say "DXT") is based on blocks of 4x4 pixels. A DXT compressed texture definitionally does not support dimensions that are not divisible by 4. When you save a 254x255 DXT1 image with Paint.net or the GIMP plugin or whatever, the definition of the decompression algorithm is no longer sufficient to decompress the image, so you are trying to rely on DirectX, OpenGL, and the GPU all using the same nonstandard decompression method that Paint.net does. (Spoiler alert: they don't)
DXT looks awful for most 2D images because it blurs pixels and greatly reduces color resolution. The lack of color resolution is the main reason it gives terrible results for RGB normal maps; the green/alpha format used by Grimrock 2 is a workaround to get better color resolution. Most 2D stuff and especially GUI elements relies on sharp lines and crisp colors. 3D textures, on the other hand, rarely need sharp lines or full 24-bit color resolution because the colors are getting transformed by perspective and lights and filtering in the 3D world anyway.
Last edited by minmay on Wed Dec 07, 2016 2:39 am, edited 2 times in total.
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.
Re: Ask a simple question, get a simple answer
Are you sure that it just wasn't dxt ~non divisible by 4?
A single row atlas is not likely to be a power of two image; being too small, or way too big.
A single row atlas is not likely to be a power of two image; being too small, or way too big.
-
- Posts: 24
- Joined: Sat Nov 26, 2016 12:12 pm
Re: Ask a simple question, get a simple answer
Hello! Its not the best english, apology! I have a simple question and maybe somebody have a simple answer. Its about a local variable (LV). Its NOT about the code below, its about "how to" use the local variable in cases like this.
The Counter is set to 1. The LV then should be 1 too. Now i want to call a function named action1(). My question is: How can i use the LV to call the function same as the Value of the counter? Counter is at 2 > call function action2() and so on.
Thank you for reading and any help
The Counter is set to 1. The LV then should be 1 too. Now i want to call a function named action1(). My question is: How can i use the LV to call the function same as the Value of the counter? Counter is at 2 > call function action2() and so on.
Code: Select all
function doNext()
local next = nextcounter.counter:getValue()
action..next() << dont work this way.
action(next) << dont work this way either.
end
function action1()
hudPrint("Hi")
end
function action2()
hudPrint("Bye")
end
Re: Ask a simple question, get a simple answer
Looks like you need to review the syntax of Lua. This is what you wanted:
Code: Select all
function doNext()
local next = nextcounter.counter:getValue()
self["action"..next]()
end
function action1()
hudPrint("Hi")
end
function action2()
hudPrint("Bye")
end
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.
-
- Posts: 24
- Joined: Sat Nov 26, 2016 12:12 pm
Re: Ask a simple question, get a simple answer
Yes, that is exactly what i was looking for Thanks alot! And about the Syntax, i searched yesterday already for a solution on sites like lua-users.org and lua.org but i never used a local variable for things like that and i simply didnt know how to "write" it. Local Variables for me was restricted to things like:minmay wrote:Looks like you need to review the syntax of Lua.
Code: Select all
for i=1,100 do
local mylevers = findEntity("nicelever"..i)
if mylevers.lever:isActivated() then
mylevers.lever:toggle()
Im used to write more like this:
Code: Select all
function checkaction()
if nextcounter.counter:getValue() == 1 then
action1()
elseif
...bla bla
- zimberzimber
- Posts: 432
- Joined: Fri Feb 08, 2013 8:06 pm
Re: Ask a simple question, get a simple answer
3 monster related questions:
1) How do I deal damage directly to a monster through a script? (aka champion:damage(num, string) but for monsters)
Setting health to a lower value doesn't count. :v
2) What monster flags are there, and what is their effect?
I recall there was something about not missing attacks, attacks/damagers trearing the monster as if its not there, but I can't find the thread where I saw it.
3) Are there any other monster shapes other than "1x1" and "cross"?
1) How do I deal damage directly to a monster through a script? (aka champion:damage(num, string) but for monsters)
Setting health to a lower value doesn't count. :v
2) What monster flags are there, and what is their effect?
I recall there was something about not missing attacks, attacks/damagers trearing the monster as if its not there, but I can't find the thread where I saw it.
3) Are there any other monster shapes other than "1x1" and "cross"?
My asset pack [v1.10]
Features a bit of everything!
Features a bit of everything!
- Zo Kath Ra
- Posts: 937
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: Ask a simple question, get a simple answer
viewtopic.php?f=22&t=7951&start=1220#p106377zimberzimber wrote:2) What monster flags are there, and what is their effect?
I recall there was something about not missing attacks, attacks/damagers trearing the monster as if its not there, but I can't find the thread where I saw it.
Can be found by searching the forum for...
getMonsterFlag
Re: Ask a simple question, get a simple answer
This functionality doesn't exist in the user scripting interface.zimberzimber wrote:1) How do I deal damage directly to a monster through a script? (aka champion:damage(num, string) but for monsters)
Setting health to a lower value doesn't count. :v
viewtopic.php?f=22&t=7951&p=106377#p106377zimberzimber wrote:2) What monster flags are there, and what is their effect?
"3x3" but I haven't tested how well it works.zimberzimber wrote:3) Are there any other monster shapes other than "1x1" and "cross"?
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.