Page 173 of 400

Re: Ask a simple question, get a simple answer

Posted: Wed Dec 07, 2016 12:18 am
by minmay
zimberzimber wrote:Icon atlases also require a ^2 dimension though.
No they don't.

Re: Ask a simple question, get a simple answer

Posted: Wed Dec 07, 2016 12:20 am
by zimberzimber
minmay wrote:
zimberzimber wrote:Icon atlases also require a ^2 dimension though.
No they don't.
Game crashed when I attempted to use a non ^2 dimension for an atlas though, same error

Re: Ask a simple question, get a simple answer

Posted: Wed Dec 07, 2016 1:03 am
by minmay
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.

Re: Ask a simple question, get a simple answer

Posted: Wed Dec 07, 2016 1:04 am
by Isaac
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.

Re: Ask a simple question, get a simple answer

Posted: Mon Dec 12, 2016 2:01 pm
by ColdDeadStone
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.

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
Thank you for reading and any help :)

Re: Ask a simple question, get a simple answer

Posted: Mon Dec 12, 2016 7:36 pm
by minmay
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

Re: Ask a simple question, get a simple answer

Posted: Mon Dec 12, 2016 8:44 pm
by ColdDeadStone
minmay wrote:Looks like you need to review the syntax of Lua.
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:

Code: Select all

for i=1,100 do
local mylevers = findEntity("nicelever"..i)
if mylevers.lever:isActivated() then
mylevers.lever:toggle()
instead of write 100 times nicelever1.lever:toggle() ...

Im used to write more like this:

Code: Select all

function checkaction()
if nextcounter.counter:getValue() == 1 then
action1()
elseif
...bla bla
I thought that was good idea to have more control but it wasnt a good idea... Now i rewrite everything in my "dungeon" but got stucked on this one. Anyway, thanks alot for helping and have a nice Day! :)

Re: Ask a simple question, get a simple answer

Posted: Tue Dec 13, 2016 10:48 am
by zimberzimber
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"?

Re: Ask a simple question, get a simple answer

Posted: Tue Dec 13, 2016 11:13 am
by Zo Kath Ra
zimberzimber 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.
viewtopic.php?f=22&t=7951&start=1220#p106377

Can be found by searching the forum for...
getMonsterFlag

Re: Ask a simple question, get a simple answer

Posted: Tue Dec 13, 2016 12:04 pm
by minmay
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
This functionality doesn't exist in the user scripting interface.
zimberzimber wrote:2) What monster flags are there, and what is their effect?
viewtopic.php?f=22&t=7951&p=106377#p106377
zimberzimber wrote:3) Are there any other monster shapes other than "1x1" and "cross"?
"3x3" but I haven't tested how well it works.