item characteristics

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
RayB
Posts: 116
Joined: Fri Mar 06, 2015 3:45 am

item characteristics

Post by RayB » Sat May 02, 2020 4:07 pm

When an item is in a tile and the party steps into that tile, the item moves forward so the party can pick it up. Is there any way to temporarily disable this action?

I have an item on a lift platform that raises with the lift when the lift is raised. The lift is an obstacle so I disable its obstacle component when raised so the party can step into the tile. When the party steps into the tile, the item on the lift falls from the lift to the ground and slides forward instead of staying on the lift. I have to tried to disable the item's 'item' component in a script statement to prevent this from happening but it does not work. I assume it is because the item is an item and the game is set up to work that way. I am currently having to destroy the item when the lift reaches the top then spawn a new one when the lift starts back down.

So, is there any way to temporarily disable the item component or the game effect and then reinstate it when the lift starts back down?

minmay
Posts: 2654
Joined: Mon Sep 23, 2013 2:24 am

Re: item characteristics

Post by minmay » Sat May 02, 2020 7:33 pm

If there's an enabled FloorTriggerComponent with the pressurePlate field at the same level/x/y/elevation as an item, the party won't push it. Note that this will also disable autopickup on that square and make the party's camera pitch down slightly, however.

The other option is to have the item in a surface/socket, which will also restrict where the party can pick it up from; probably not what you want.
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.

RayB
Posts: 116
Joined: Fri Mar 06, 2015 3:45 am

Re: item characteristics

Post by RayB » Wed May 06, 2020 1:39 am

I get what you are saying about the pressure plate, never thought of that, but the pushing forward is not the only problem.
The item (I guess because of the way the engine is designed to work) falls from the lift then pushes forward. I want it to stay up on the lift. Actually the socket you suggested may just work if I place it on an adjacent edge.
The idea is that the lift is in the corner tile of a 'L' shaped hallway. The party approaches the 'mine lift' and is blocked. They see a crystal flower on the lift (back and to the left), but it is out of reach. They cannot click on it. They have to raise the lift (and the crystal flower on it), step forward, turn left and step out from under the lift. Then they can let the lift back down using another button they find there. When the lift comes back down (with the crystal flower) the party can then grab the flower from that position.

Thanks again for your time and help.

Zo Kath Ra
Posts: 827
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: item characteristics

Post by Zo Kath Ra » Wed May 06, 2020 1:43 pm

RayB wrote:
Wed May 06, 2020 1:39 am
The item (I guess because of the way the engine is designed to work) falls from the lift then pushes forward. I want it to stay up on the lift.
When the item rides up on the lift:

Are you only changing the item's world position?
GameObject:setWorldPosition()
GameObject:setWorldPositionY(y)

Or are you also changing the item's position, once it crosses the border to a new cube? (cube = 3d tile)
GameObject:setPosition(x, y, facing, elevation, level)

Post Reply