Page 1 of 1

trouble with ruins secret buttons

Posted: Tue Oct 27, 2015 8:03 am
by FeMaiden
I don't understand what i'm doing wrong. I have a line of ruins_walls
and I put a ruins_secret_door.
but when I try to put a secret button on the wall, the graphics are not showing up properly.
the button is barely visible, I can press it, but it looks wrong.
also, the wall I put it on is having this weird glitchy ripply effect.

I tried rotating the button and moving it.
I tried rotating the wall and moving it but I can't get it to look right

Re: trouble with ruins secret buttons

Posted: Tue Oct 27, 2015 8:16 am
by FeMaiden
never mind...I did not realize the secret_button was an entire wall section in and of itself.
so it was glitchy because I had 2 wall sections occupying the same space.

Re: trouble with ruins secret buttons

Posted: Tue Oct 27, 2015 11:11 am
by Isaac
(When you eventually get to it...)
Mixing assets between tile sets can require asset editing via script and/or 3rd party tools. The castle for instance has a different wall height, and certain wall decorations and switches aren't set to be in the right place for every tile set. But they can be moved with script commands or editing the model with John Wordsworth's GMT editor. With the GMT installed, one can open the asset pack models and make basic changes in position and scale ~and material textures, then save the model and include it in the mod folder; and reference it in a custom asset.

Re: trouble with ruins secret buttons

Posted: Tue Oct 27, 2015 3:58 pm
by FeMaiden
Isaac wrote:(When you eventually get to it...)
Mixing assets between tile sets can require asset editing via script and/or 3rd party tools. The castle for instance has a different wall height, and certain wall decorations and switches aren't set to be in the right place for every tile set. But they can be moved with script commands or editing the model with John Wordsworth's GMT editor. With the GMT installed, one can open the asset pack models and make basic changes in position and scale ~and material textures, then save the model and include it in the mod folder; and reference it in a custom asset.
I did notice, when I try to place a torch holder on a ruins wall, it clips though the wall and only shows halfway.
how would I fix that with scripts?

Re: trouble with ruins secret buttons

Posted: Tue Oct 27, 2015 8:33 pm
by Isaac
FeMaiden wrote:I did notice, when I try to place a torch holder on a ruins wall, it clips though the wall and only shows halfway.
how would I fix that with scripts?
The scripting reference lists commands for repositioning objects either snapped to the tile grid, or positioned manually on the map. For this one usually wants the manual positioning: setWorldPosition() and/or setWorldPositionY() ~Y means up/down on the map.

If an object is just a bit too low on the ground, then object:setWorldPositionY(0.1) will raise it .1 units upward.
If an object needs to be moved to the side, then object:setWorldPosition(vec(x,y,z)) can reposition it to x,y,z; these are float/decimal numbers.
The easiest way (I know of) to see the base starting position of the object is to use print(object:getPosition()) in the console.

The max units moved up or down, should probably be the module height when moving interactive (clickable) objects; [which is usually 3 or 4]. For side to side movement, the tiles are each 3x3 units wide; after that it's in another tile.

What I use is a 'touch-up' script that adds offsets. While making the map, if I find clipping issues or other cases where I need to affect a change in an object's position, I put them in the script and they run when the game loads the map.

For example, by default, placing a mine_door_spear gate on the edge of a forest chasm edge, results in bad clipping with the rocky edges of the chasm.
SpoilerShow
Image


To fix this I would adjust the position of the mine door, and/or anything near it that needs moved to make room.
SpoilerShow
Image
This [below] is what I used for these screenshots, but you can [of course] just type the standard command as seen in the scripting reference.
(I just fill the table with whatever changes I need for any object.)

Code: Select all

-- touch_ups
do
	local objects = { "mine_door_spear_1", 'setWorldPosition',vec(50.65,0,49.5),
					"forest_bridge_end_2", 'setWorldPosition',vec(50.55,0,49.5),
			 }
	
	for x = 1, #objects, 3 do
		local entity = findEntity(objects[x])
		local action = objects[x+1]
		local offset = objects[x+2]
	
		entity[action](entity, unpack(offset))
	end
end

Re: trouble with ruins secret buttons

Posted: Tue Oct 27, 2015 10:41 pm
by FeMaiden
thanks for the info...although in my opinion, there might actually be situations where you *want* the object to clip through the wall or ground, because then it makes it less visisble and less likely to be noticed by the player..

like with the mine _spears example, if you wanted to use it to lock the player in a boss arena. if the mine spears are fully visible, it might be glaringly obvious that the player is about to enter a boss arena, giving them a chance to prepare...but an ambush should do exactly what it implies, taking the player by surprise.

like for example,
i had a small pocket on a forest themed map that had beach rocks surrounded sand tiles and an exit leading to a beach themed map, and when the player enters that small pocket on their way to the beach, they get attacked by a pirate scouting party as a boss fight and I played with the elevation of the ground to raise the sand up in the opening leading to it so the spear door is obscured, the player can't see it and therefore has no reason to be cautious, rushes through the opening and then the boss music starts and the turn to the right to see 3 ratling corsairs (that's what I like to call the rapier ratlings) bearing down on them.
of course, I made the arena 4 tiles wide, giving the player plenty of space to fight them, I still want it to be fair lol.

in another section
I was trying to figure out how to put a secret button on a beach map to open a beach secret wall. there is no "Beach_secret_button"...but I put a regular beach_button and i put it on the shore in the ocean and played with the elevation, and now the button is 90% obscured under the water, not as likely to be noticed, so it kind of acts like a "pseudo_secret_button".

I suppose my points is I could have scripted the game to move the object up above the water surface but then it ruins the secret lol.


TL:DR

I appreciate the scripting intructions, I can use that info elsewhere.
the spot where my torch holder is clipping through the wall, i'm actually wondering if I even *want* to move it, right now, it's still mostly visible, and the player can place and remove the torch, so maybe i might leave it that way to make it more challenging to find it...I just don't want it to look sloppy.