Ask a simple question, get a simple answer

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
KhrougH
Posts: 68
Joined: Tue Sep 04, 2018 11:45 pm
Location: Roma

Re: Ask a simple question, get a simple answer

Post by KhrougH »

minmay wrote: Fri Nov 16, 2018 2:23 am dissolveStart and dissolveEnd are nil by default. If your model has a mesh node called lod1_mesh, it will start to fade in at a distance from the camera equal to dissolveStart*3 meters, and finish fading in at dissolveEnd*3 meters. Meanwhile, the rest of the mesh nodes will fade out.

So there are two ways it is typically used: to switch to a lower-detail mesh at long distances (used for the vanilla game's trees), and to disappear completely at long distances (used for the vanilla game's grass, heather, etc.). If you want neither, leave dissolveStart and dissolveEnd nil, and no fading will occur.
that's true.
may i ask you why the forest_oak (an ingame asset) doesn't disappear with the same settings?
[...]
All those moments will be lost in time, like tears in rain.
Time to die.
minmay
Posts: 2770
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

because the forest_oak model has a mesh node named lod1_mesh and yours does not
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.
User avatar
KhrougH
Posts: 68
Joined: Tue Sep 04, 2018 11:45 pm
Location: Roma

Re: Ask a simple question, get a simple answer

Post by KhrougH »

minmay wrote: Sat Nov 17, 2018 4:58 am because the forest_oak model has a mesh node named lod1_mesh and yours does not
Ok ... Importing some LoG2 models I noticed that they have some node (an "xyz" thing) that changes some information... Also dimentions!!!.

So the best way to make a new asset is importing an already existing LoG2 model close to the one i want to make and using the same nodes. Isn't it?

Than i wonder why LoG2 developers used nodes and sub-nodes for modify the model insted modify the model under the first node.
Maybe tuose sub nodes has more informations?

I did the same with an axe and i imported a couple of LoG2 axe models and they have 3 nodes as first node and than 1 sub-node... And THAN the model. So. Why having a node if the node doesn't contain any model?
[...]
All those moments will be lost in time, like tears in rain.
Time to die.
User avatar
KhrougH
Posts: 68
Joined: Tue Sep 04, 2018 11:45 pm
Location: Roma

Re: Ask a simple question, get a simple answer

Post by KhrougH »

akroma222 wrote: Fri Nov 16, 2018 3:21 am
Hey KhrougH,

It's an extremelyuseful thread indeed .... and
Here is a detailed answer to your local / global table Q (minmays response at the end)
viewtopic.php?f=22&t=18236&p=116703&hil ... ig#p116703
And further explanations / examples in .rhavin 's thread (answers provided by Isaac & minmay)
viewtopic.php?f=22&t=18159&p=115633&hil ... ig#p115637

Searching the forum for "Config" will set you on the right track ;)
(And Config. is how I usually ref global tables - but do read into it as it is not as simple at that)

Enjoy & happy reading! 8-)
I read all the threads you suggested me but i mostly can't understand. My Lua skills are really weak. All the Lua i Know is only about LoG2 and even in this case i have a "long way to the top".
So i try to explain what i understood:
If i use the word Config. before my table name (example : Config.mytable = {} ) i can solve my problem and i can use the stings "table.insert(Config.mytable, "myInfo")" and "table.remove(Config.mytable, n)"
And this happens because "Config" brings mytable at an upper level ... Maybe at the Global level.
Isn't it?
Is it so simple or i missed something?

P.S.
all this is considered in a defineObject script!
[...]
All those moments will be lost in time, like tears in rain.
Time to die.
User avatar
Isaac
Posts: 3179
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

Anything you put in the Config object is not saved in the user save-games, and is not restored after restarting the game; it is present between reloads, while the game is running. So by itself it is not suitable for permanent storage, but can be useful temporary storage.
User avatar
KhrougH
Posts: 68
Joined: Tue Sep 04, 2018 11:45 pm
Location: Roma

Re: Ask a simple question, get a simple answer

Post by KhrougH »

Isaac wrote: Sat Nov 17, 2018 11:09 pm Anything you put in the Config object is not saved in the user save-games, and is not restored after restarting the game; it is present between reloads, while the game is running. So by itself it is not suitable for permanent storage, but can be useful temporary storage.
Than is not my case.
I could make something like
onSave
memory=mytable
...
onLoad
mytable=memory

:?

Sorry, i'm definitely confused
[...]
All those moments will be lost in time, like tears in rain.
Time to die.
User avatar
KhrougH
Posts: 68
Joined: Tue Sep 04, 2018 11:45 pm
Location: Roma

Re: Ask a simple question, get a simple answer

Post by KhrougH »

can someone explain what "chainindex" is in the function :
onAttack = function(self, champion, slot, chainIndex)
or
[itemcomponent].onAttack(self, champion, slot, chainIndex)
???
[...]
All those moments will be lost in time, like tears in rain.
Time to die.
User avatar
Zo Kath Ra
Posts: 931
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Ask a simple question, get a simple answer

Post by Zo Kath Ra »

KhrougH wrote: Mon Nov 19, 2018 4:24 pm can someone explain what "chainindex" is in the function :
onAttack = function(self, champion, slot, chainIndex)
or
[itemcomponent].onAttack(self, champion, slot, chainIndex)
???
You can create weapons with chained attacks.
It's explained at 16:55 of this video:
https://www.youtube.com/watch?v=7L8Epms ... c&index=13

chainIndex is just the number of the current attack in the attack chain.
(starts with 0)
User avatar
KhrougH
Posts: 68
Joined: Tue Sep 04, 2018 11:45 pm
Location: Roma

Re: Ask a simple question, get a simple answer

Post by KhrougH »

Zo Kath Ra wrote: Mon Nov 19, 2018 8:56 pm
KhrougH wrote: Mon Nov 19, 2018 4:24 pm can someone explain what "chainindex" is in the function :
onAttack = function(self, champion, slot, chainIndex)
or
[itemcomponent].onAttack(self, champion, slot, chainIndex)
???
You can create weapons with chained attacks.
It's explained at 16:55 of this video:
https://www.youtube.com/watch?v=7L8Epms ... c&index=13

chainIndex is just the number of the current attack in the attack chain.
(starts with 0)
Ohhh... Than is like a "caller" , a "hook"... A self hook that calls in chain another attack.
[...]
All those moments will be lost in time, like tears in rain.
Time to die.
User avatar
THOM
Posts: 1267
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

Is there a way to let a champion starve?

I can surely alter his food value by using
:setFood(amount)
:modifyFood(food)

but that doesn't seem to affect the food bar. It doesn't change...
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
Post Reply

Return to “Mod Creation”