setWorldPosition removing clickable component?

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
Scotty
Posts: 69
Joined: Fri Nov 07, 2014 2:59 pm

setWorldPosition removing clickable component?

Post by Scotty »

I'm trying to set up a piece of wall text above a button, using setWorldPosition to get them into a nice position. But no matter where I place them, even if they literally don't move at all (setWorldPosition = getWorldPosition), they completely lose their ability to be clicked on.

Anyone had this problem?
MrChoke
Posts: 324
Joined: Sat Oct 25, 2014 7:20 pm

Re: setWorldPosition removing clickable component?

Post by MrChoke »

Odd Scotty, I moved my text too. I moved it up above a button. I did not have any issues with it. Though I did only apply a Y-axis change.
Scotty
Posts: 69
Joined: Fri Nov 07, 2014 2:59 pm

Re: setWorldPosition removing clickable component?

Post by Scotty »

Ah! Yeah, using setWorldPositionY works fine.

I only need to work in the Y axis so that'll work great, thanks!
User avatar
Lark
Posts: 178
Joined: Wed Sep 19, 2012 4:23 pm
Location: Springfield, MO USA

Re: setWorldPosition removing clickable component?

Post by Lark »

Basically there is a "bug" in setWorldPosition that whereas if buttons are placed on two of the walls and setWorldPosition is used to set the button position, even if you don't actually change the coordinates at all, the clickable portion of the button is actually "behind the wall" and cannot be clicked. If you determine which coordinate and direction is off and add/subtract a very small number, such as .0001, the the button will again be clickable. Perhaps the same is happening for text.

See post viewtopic.php?f=22&t=8093 where Blichew first explained it to me.

Also see my script to aid in the placement of walls full of buttons and levers at viewtopic.php?f=22&t=8129. The script posted there has automatic correction of this "bug".

I hope this helps, -Lark
Post Reply