Product Chat / GravityOff(e)

Author
Message
Team wolf
7
Years of Service
User Offline
Joined: 26th Dec 2016
Location:
Posted: 9th Jan 2017 17:30
is set this GravityOff(e) in my script but the object still falling with physics on
PM
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 9th Jan 2017 17:42
I see in the global.lua file that there syntex is this:

function GravityOff(e)
SendMessageI("setnogravity",e,1);
end
function GravityOn(e)
SendMessageI("setnogravity",e,0);

Are you using this in this fashion?
Could you post that section in your script please?

Thanks.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 9th Jan 2017 18:17
Where you declare tha statement (GravityOff(e)) has to do with the final result, IE if you declare it inside a condition, if that condition does not accomplish, so you don't get the GravityOff(e).

So better you post your script, think this going to be "script forum" post.

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
Team wolf
7
Years of Service
User Offline
Joined: 26th Dec 2016
Location:
Posted: 9th Jan 2017 18:44
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 9th Jan 2017 19:01
If you want the item being "GravityOff" permanently, so you don't need the script, just do it via entity properties.

So, if you want the entity being "GravityOff" just from time to time, so you will need some condition, ie:

if PlayerDist<100 then GravityOff(e) end

That piece of code is distance based, also you can work with timer if you want the entity being GravityOff just in certain time, like door.lua script does.

Take a look to the "door.lua" script.

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
Team wolf
7
Years of Service
User Offline
Joined: 26th Dec 2016
Location:
Posted: 10th Jan 2017 05:10
In properties is physics on - off this one says gravity
and in door.lua he switches colision not gravity
PM
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 10th Jan 2017 14:01 Edited at: 10th Jan 2017 14:06
This thread should probably be moved to scripting to get the attention it needs.
I have been looking for a script using GravityOff(e), just cant seem to find one.

Well here is what I have found and was supposed to work.

https://forum.game-guru.com/thread/212689#msg2523899

The reports from then were that this was not working and was put on the todo fix list. Not sure if this has been done yet.
On the above link looks like usable code to get it going if it will work. As far as having to turn off physics for this, this would have to be tested.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

Login to post a reply

Server time is: 2024-07-03 04:14:16
Your offset time is: 2024-07-03 04:14:16