Page 161 of 396

Re: Ask a simple question, get a simple answer

Posted: Sat Oct 22, 2016 1:15 am
by AndakRainor
minmay wrote:
zimberzimber wrote:Well, removing and re-adding the surface component works if it holds a single item :lol:
Actually, it doesn't. This taints the item and will cause a crash as soon as the user tries to save the game or pick up the item.
If I remember correctly, you could destroy the object with the surface component and spawn another one and be save game friendly.

Re: Ask a simple question, get a simple answer

Posted: Sat Oct 22, 2016 1:26 am
by minmay
No. That does not fix the object's fullId. The best-case scenario is that when you save and reload the game, the item is fully inserted in the new surface as if you never changed anything (and prior to the save/load, the item still considers itself a part of the surface but the surface does not consider the item to be inside it). This is the opposite of "save game friendly", it means the state of the dungeon changes when you save and load, and more to the point, it accomplishes absolutely nothing.

Re: Ask a simple question, get a simple answer

Posted: Sat Oct 22, 2016 8:21 am
by zimberzimber
Everything seems to be fine as long as the item passes through a champions inventory.
Placing/dropping/interacting with the item didn't crash anything, neither did saving/loading.

Re: Ask a simple question, get a simple answer

Posted: Wed Oct 26, 2016 4:32 am
by Eburt
Is there a way to prevent the party from throwing an item from the mouse pointer, but not prevent other functionality such as movement or placement of the item on a surface?

Re: Ask a simple question, get a simple answer

Posted: Wed Oct 26, 2016 12:43 pm
by Isaac
Eburt wrote:Is there a way to prevent the party from throwing an item from the mouse pointer, but not prevent other functionality such as movement or placement of the item on a surface?
You could make the object's clickable component big enough to catch clicks across the whole screen.

Quick example:

Code: Select all

altar_1.clickable:setSize(vec(6,6,6))

Re: Ask a simple question, get a simple answer

Posted: Thu Oct 27, 2016 2:28 am
by Eburt
Thanks Isaac. Yes, that works if the party is in front of something I want to place the item on, but I want to generally prevent them from throwing items at all when certain conditions are met. However, they may have to place items in surfaces, etc. under the same conditions.

I tried attaching something to the party, but its not effective since the onClick hook doesn't do anything - it just goes on to do the normal action of throwing, etc. I could do something like make them drop the item, but that would prevent normal placement. Any ideas?

Re: Ask a simple question, get a simple answer

Posted: Thu Oct 27, 2016 3:24 am
by minmay
It's not possible to prevent item throws with the user scripting interface except via GameMode.setEnableControls(false) which is obviously not what you want.

Re: Ask a simple question, get a simple answer

Posted: Sun Oct 30, 2016 11:28 pm
by minmay
minmay wrote:
Isaac wrote:But the question I suppose had was whether or not the geometry is denser in places of deformation, or if the mesh is uniformly dense and just deformed by the heightmap, or not.

*When I said, 'model', I did mean the floor of the entire map; not separate floor models for every tile.
The geometry is not uniformly dense.
Keep in mind that triangles are really cheap. Performance-wise, the heightmap mesh is almost free on modern GPUs.
Here's a more precise answer for you: any 3x3 square in the heightmap mesh that is deformed gets 50 triangles. Any 3x3 square that is not deformed (i.e., any tile where all adjacent tiles have the same height and no noise) gets 2 triangles.
So if you completely fill a 32x32 level with heightmapped tiles, and your heightmap+noisemap is such that every tile gets deformed...it's still just 51,200 triangles. For comparison, this scene in Isle of Nex has over 2,100,000 triangles.

Re: Ask a simple question, get a simple answer

Posted: Mon Oct 31, 2016 9:53 pm
by kelly1111
How can I make a floorsurface (inside dungeon) digable? When I try to dig inside I get the message "you can't dig here"

Re: Ask a simple question, get a simple answer

Posted: Mon Oct 31, 2016 10:19 pm
by minmay
diggable = true in the tile definition.