![]() |
Gravity scripting
Ok, I have a question about how people usually make gravity levels. What's the best way to write the detection of the blocking tiles? o.o
|
doing_it_yourself();
|
Probably using something that detects blocking tiles!
Hint: onwall and onwall2. |
lol, seriously, if you dont even know about onwall and onwall2 you wont be able to make a gravity script.
|
Quote:
I hate gscript. >.> I mean, of all the proprietary languages I have been tormented with, gscript is the worst. >.> |
Quote:
No, I don't think I did, I think I asked for explanation of how the wall detection was done. |
Quote:
|
my gravity script keeps moving the player the minimum possible distance (0.0625 tiles) and checking if they will run into a wall if they move. once they hit a wall or go the required fall distance for that loop through they stop moving
you need to check the bottom of the player, there are like 5 x locations I check, I think, to make sure its not possible to fall through a tile |
onwall is in commands.rtf
also Ace2869(or whatever the number is, he created the newbie scripters bible) has an updated commands.rtf on his site (i forget what it is) that has everything. |
Mine does a for loop and checks all of the tiles between the player and where he'll be next timeout to see if anything is blocking, and if so, it makes the downward velocity 0. Bad thing is that this sometimes causes a "bounce" on large falls.
|
| All times are GMT +2. The time now is 08:23 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.