Page 269 of 396

Re: Ask a simple question, get a simple answer

Posted: Fri Nov 16, 2018 6:11 am
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?

Re: Ask a simple question, get a simple answer

Posted: Sat Nov 17, 2018 4:58 am
by minmay
because the forest_oak model has a mesh node named lod1_mesh and yours does not

Re: Ask a simple question, get a simple answer

Posted: Sat Nov 17, 2018 9:40 pm
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?

Re: Ask a simple question, get a simple answer

Posted: Sat Nov 17, 2018 10:41 pm
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!

Re: Ask a simple question, get a simple answer

Posted: Sat Nov 17, 2018 11:09 pm
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.

Re: Ask a simple question, get a simple answer

Posted: Sun Nov 18, 2018 2:04 am
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

Re: Ask a simple question, get a simple answer

Posted: Mon Nov 19, 2018 4:24 pm
by KhrougH
can someone explain what "chainindex" is in the function :
onAttack = function(self, champion, slot, chainIndex)
or
[itemcomponent].onAttack(self, champion, slot, chainIndex)
???

Re: Ask a simple question, get a simple answer

Posted: Mon Nov 19, 2018 8:56 pm
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)

Re: Ask a simple question, get a simple answer

Posted: Tue Nov 20, 2018 3:56 am
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.

Re: Ask a simple question, get a simple answer

Posted: Sat Nov 24, 2018 1:08 am
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...