Poll:
You do not have permission to vote in this poll.
Total 0 vote(s) 0%
* You voted for this item. [Show Results]

Partially-complete gravity well script!
#11
You'd have to set a limit on how far away the part is from the gravity source.

This could be done in about 3 lines of code, actually. This might not work perfectly, since my math skills are weak at best, but, basically, I think it would work like this:

add one line to the top of the script:

gravradius = 50



then, add after this bit:

local xdist = gravitypoint.x - object.Position.x
local ydist = gravitypoint.y - object.Position.y

--new stuff

local totaldist = math.sqrt((xdist * xdist) + (ydist * ydist))
--pythagorean theorem :]
if totaldist < gravradius then
-- do rest of script; just make sure to add an extra end :]
[Image: iwn8gk.gif]
Reply
#12
Thank you, Ghosty. This will come in handy for a Solar System project.
[spoiler] [spoiler] [spoiler] [spoiler] [spoiler] [spoiler] [spoiler] [spoiler] [spoiler] [spoiler] [spoiler] [spoiler] ɥɔǝǝʌpuɐs ǝʞıן ı ıoq ɥɐǝʎ [/spoiler] [/spoiler] [/spoiler] [/spoiler] [/spoiler] [/spoiler] [/spoiler] [/spoiler] [/spoiler] [/spoiler] [/spoiler] [/spoiler]
Reply
#13
(03-10-2013, 01:39 PM)Omega Wrote: Thank you, Ghosty. This will come in handy for a Solar System project.

Maelstronomer is already working on one too, you should message him. I may of spelled his username incorrectly though. Perhaps you should both do a collab project together?
[Image: m2m2gSSDCz-2.png]

Well I WAS the walrus.
Reply
#14
I hate collabs due to the fact that one person has a different idea (i.e someone says pluto isn't a planet and doesn't want to make it because they're lazy assholes) and then you get into a massive debate. I wouldn't mind making specific planets if he's going to make the entire solar system, however.
[spoiler] [spoiler] [spoiler] [spoiler] [spoiler] [spoiler] [spoiler] [spoiler] [spoiler] [spoiler] [spoiler] [spoiler] ɥɔǝǝʌpuɐs ǝʞıן ı ıoq ɥɐǝʎ [/spoiler] [/spoiler] [/spoiler] [/spoiler] [/spoiler] [/spoiler] [/spoiler] [/spoiler] [/spoiler] [/spoiler] [/spoiler] [/spoiler]
Reply
#15
(03-10-2013, 06:44 PM)Omega Wrote: I hate collabs due to the fact that one person has a different idea (i.e someone says pluto isn't a planet and doesn't want to make it because they're lazy assholes) and then you get into a massive debate. I wouldn't mind making specific planets if he's going to make the entire solar system, however.

I like collab projects, but part of getting things done in them is cooperation and flexibility.
[Image: m2m2gSSDCz-2.png]

Well I WAS the walrus.
Reply
#16
I know, but it seems like every single person you work with wants to make a mirror opposite of what you wanted to make, so you end up making an enemy and not a game, so really that's why I don't like them. Then again, I don't like working with people on the spot either, we need basis and background and need to sketch out for a couple days before we start, but all collabs I've ever been with are made together in 15 minutes.
[spoiler] [spoiler] [spoiler] [spoiler] [spoiler] [spoiler] [spoiler] [spoiler] [spoiler] [spoiler] [spoiler] [spoiler] ɥɔǝǝʌpuɐs ǝʞıן ı ıoq ɥɐǝʎ [/spoiler] [/spoiler] [/spoiler] [/spoiler] [/spoiler] [/spoiler] [/spoiler] [/spoiler] [/spoiler] [/spoiler] [/spoiler] [/spoiler]
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)