Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
The script was very helpful and it was easy to modify, so it spawns 3 different kind of Floors. It was exactly, what i needed.
thank you
thank you
In order to get to the other side of the pit you have to get hit by the fireball and die....
Yep.....moving on!
Yep.....moving on!
-
- Posts: 24
- Joined: Sat Nov 26, 2016 12:12 pm
Re: Ask a simple question, get a simple answer
Hello... i need some help with a local variable. I searched the Lua Tutorials but i don't find any answer. Thats maybe because there are not about Grimrock... Anyway, heres the problem:
This is working of course:
As String it dont work but thats not what i want anyway:
This is what i need:
As string its possible to have "lever_1" as a result but you cant access ".lever" from string. So i need the real (don't know how to call it) thing.
I tried the stuff from the Lua Local Variable Tutorials but nothing worked. Im kinda out of ideas. Someone here to give me a hint? Please...
This is working of course:
Code: Select all
function test()
local a = lever_1
a.lever:toggle()
end
Code: Select all
function test2()
local a = "lever_"
local b = "1" (tried a number with tostring() and a string with tonumber())
local c = a..b
c.lever:toggle()
end
Code: Select all
function test3()
local a = lever_
local b = 1
local c = a..b
c.lever:toggle()
end
I tried the stuff from the Lua Local Variable Tutorials but nothing worked. Im kinda out of ideas. Someone here to give me a hint? Please...
Sorry for my poor english... hope you understand what i try to say!
Re: Ask a simple question, get a simple answer
Try this:
** The official LoG2 script reference is good, but a bit out of date. There is an up-to-date reference on Github:
https://github.com/JKos/log2doc/wiki
Code: Select all
function test3()
local b = 1
local c = findEntity("lever_"..b) --returns nil if nonexistent
if c ~= nil then
c.lever:toggle()
end
end
https://github.com/JKos/log2doc/wiki
-
- Posts: 24
- Joined: Sat Nov 26, 2016 12:12 pm
Re: Ask a simple question, get a simple answer
Yes that is what i tried to achieve! Thanks for your help! About the reference (both), i use them but only for "what can i do with .particle:" or something... but are there any infos about variables on those sites? Hmm... But anyway: Thanks again! Its a nice helpful Community here! Thank you!Isaac wrote:Try this:
Sorry for my poor english... hope you understand what i try to say!
Re: Ask a simple question, get a simple answer
Grimrock (afaik) uses a limited version of Lua 5.1ColdDeadStone wrote:Yes that is what i tried to achieve! Thanks for your help! About the reference (both), i use them but only for "what can i do with .particle:" or something... but are there any infos about variables on those sites? Hmm... But anyway: Thanks again! Its a nice helpful Community here! Thank you!Isaac wrote:Try this:
There is information on Lua here: https://www.lua.org/manual/5.1/
Most of it works, but Grimrock 1 & 2 do not support certain functions, and they do not have the conventional way to store global variables; though technically it is not impossible to have them. One limited method for LoG2 is seen in the water script of its asset pack, but those values don't get stored in the saved games, and need replaced at every reload; or they won't be there.
*If you don't have the asset pack, then you should, because with it you can read all of its scripts, and learn from them.
Assets for LoG2 http://www.grimrock.net/modding/grimrock-2-asset-pack/
Among the members here, minmay probably has the best grasp on the limits of the Grimrock Lua interpreters.
Re: Ask a simple question, get a simple answer
Simple question: When you hudprint a text ingame. Is there a way to change the text color (instead of the normal white) ?
- AndakRainor
- Posts: 674
- Joined: Thu Nov 20, 2014 5:18 pm
Re: Ask a simple question, get a simple answer
No! You can't do that with hudPrint.kelly1111 wrote:Simple question: When you hudprint a text ingame. Is there a way to change the text color (instead of the normal white) ?
Re: Ask a simple question, get a simple answer
Hey guys,
i´m a bit confused about the castle tileset. The walls do overlap, when i have more than 1 Level. Even in a brand new Project i have this strange bug... Am i missing something here?
i´m a bit confused about the castle tileset. The walls do overlap, when i have more than 1 Level. Even in a brand new Project i have this strange bug... Am i missing something here?
In order to get to the other side of the pit you have to get hit by the fireball and die....
Yep.....moving on!
Yep.....moving on!
Re: Ask a simple question, get a simple answer
Levels in Grimrock have a module height; this is usually set to 3, but the castle levels have it set to 4; it is per-floor. The castle assets are built to that height. To change the module height on your castle levels, right-click on the map name in the project panel, and choose properties. There you can name your floors, set their position, in relation to other floors, set the module height, and choose what background audio track plays while on the map (if any).Xardas wrote:Hey guys,
i´m a bit confused about the castle tileset. The walls do overlap, when i have more than 1 Level. Even in a brand new Project i have this strange bug... Am i missing something here?
Re: Ask a simple question, get a simple answer
The castle tileset is a bit larger than the others.
You have to open the level properties by doing a right click on the level's name. Then change Module Height from 3 to 4.
You have to open the level properties by doing a right click on the level's name. Then change Module Height from 3 to 4.