When Gravity Fails...

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
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

When Gravity Fails...

Post by Isaac »

Has anyone assigned the "gravity" component?

I have added it to a few objects, and they do ~eventually~ fall when no longer supported, but this happens seconds after the support is removed. Has anyone learned of a way to call or update gravity in the script?

Obviously objects the player drops (in pits) fall immediately, so the must be a way.
NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Re: When Gravity Fails...

Post by NutJob »

I just tried this,

Code: Select all

	party:createComponent("Gravity")
	party.gravity:disable()
hoping it would work. No deal.
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: When Gravity Fails...

Post by minmay »

party already has a gravity component from my testing it seems to get enabled whenever the party would fall. So disabling it doesn't do anything useful unless the party is already falling (in which case it can stop them in midair, but they'll fall again as soon as they move or non-mouselook turn).
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.
User avatar
gambit37
Posts: 218
Joined: Fri Mar 02, 2012 3:40 pm

Re: When Gravity Fails...

Post by gambit37 »

Sounds perfect for a levitation spell...
Batty
Posts: 509
Joined: Sun Apr 15, 2012 7:04 pm

Re: When Gravity Fails...

Post by Batty »

I added a Gravity component to an item, put it on a bridge and destroyed the bridge using a pressure plate activating a script and the item falls immediately, there's no delay. I didn't put any fields in the component:

Code: Select all

{
   class = "Gravity"
}
you can add fallingSpeed = x but you don't need it. Haven't tried anything else. :)
User avatar
QuintinStone
Posts: 72
Joined: Sat Nov 01, 2014 9:58 pm

Re: When Gravity Fails...

Post by QuintinStone »

Does party.onMove() get called when a party starts falling?
Crypt of Zulfar
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: When Gravity Fails...

Post by Isaac »

Batty wrote:I added a Gravity component to an item, put it on a bridge and destroyed the bridge using a pressure plate activating a script and the item falls immediately, there's no delay. I didn't put any fields in the component:

Code: Select all

{
   class = "Gravity"
}
you can add fallingSpeed = x but you don't need it. Haven't tried anything else. :)
This is what I did, but the item falls somewhere between 3 to 5 seconds later. I was hoping that there was an update function I could call from the bridge/plate script.
gambit37 wrote:Sounds perfect for a levitation spell...
It does indeed.
User avatar
AndakRainor
Posts: 674
Joined: Thu Nov 20, 2014 5:18 pm

Re: When Gravity Fails...

Post by AndakRainor »

Has anyone found a solution to skip the 5 seconds cartoon situation before a gameobject realizes there is no floor under it ? ^^
I try to define a pushable ice block but it does not fall immediatly when it should. Also, when it falls it does it as a quamtum particle, it teleports to the floor below without any fall animation ! Ok, this object has no item component, could it be the cause of those problems ?
Post Reply