generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Just made a pathfinder in less than 50 lines

Previous Thread :: Next Thread 
ScriptOn is online. ScriptOn
Joined: 22 Aug 2010
Total Posts: 10885
25 May 2013 05:35 PM
Got on my level bro.

BTW: The first 50 lines are the grid lines (Lines used to generate the grid), the pathfinder doesn't start until line 50, (aka function search)

This is 49 lines :)

PS: The pathfinder is built so that if it gets to a path, and the path ends up being "bad" (one way) it will go to its last known working spot and continue from there

>:D

I`ll post it here but I`ll cut out the bits that count:

local cross = 0
local row = 0

local base = workspace.Base
local ai = ""
local endpart = ""


for ii = 1, 20 do

cross = 0
wait()
for i = 1, 20 do
block = game.Lighting.Floor:clone()
block.CFrame = base.CFrame-Vector3.new((base.Size.X/2)-(1/2*block.Size.X)-cross*10, 0, (base.Size.Z/2)-(1/2*block.Size.Z)-row*10)
block.Parent = base
block.Name = "Floor" ..cross.. ":" ..row
rando = math.random(1,3)
if rando == 1 then
block.Name = "Wall"
block.BrickColor = BrickColor.new("Black")
end

if row == 0 and cross == 0 then
ai = block
block.Name = "Start"
block.BrickColor = BrickColor.new("Bright blue")
local int = Instance.new("StringValue")
int.Name = "Distance"
int.Value = 0
int.Parent = block
end

if row == 19 and cross == 19 then
endpart = block
block.Name = "End"
block.BrickColor = BrickColor.new("Bright red")
end
cross = cross+1
end

row = row+1
end

local closed = {}
local smallest = 999999
local smallestpart = ""

function search()
wait(0.1)
for i,v in pairs(base:GetChildren()) do
if (v.Position-ai.Position).magnitude < 15 then
if v:findFirstChild("Distance") ~= nil then
if v.BrickColor == BrickColor.new("Bright violet") then
v.BrickColor = BrickColor.new("Bright green")
v.Distance:Destroy()
v.Owner:Destroy()
end
end
end
end
for i,v in pairs(base:GetChildren()) do
if v ~= endpart and v ~= ai and v.Name ~= "Start" and v.Name ~= "End" and v.Name ~= "Wall" and v:findFirstChild("Distance") == nil and (v.Position-ai.Position).magnitude < 15 then
v.BrickColor = BrickColor.new("Bright violet")

local int = Instance.new("StringValue")
int.Name = "Owner"
int.Value = ai.Name
int.Parent = v

local int = Instance.new("NumberValue")
int.Name = "Distance"
int.Value = PRIVATE U NUB
if PRIVATE U NUB then
PRIVATE U NUB
PRIVATE U NUB
end
int.Parent = v

end
end


table.insert(closed, ai)


smallestpart.BrickColor = BrickColor.new("Bright yellow")

if PRIVATE U NUB then
print("Done!")
else
PRIVATE U NUB
PRIVATE U NUB
search()
end
end


search()
Report Abuse
PatrickAndSp0ngeBob is not online. PatrickAndSp0ngeBob
Joined: 29 May 2012
Total Posts: 12673
25 May 2013 05:35 PM
[ Content Deleted ]
Report Abuse
RobloxBellic is not online. RobloxBellic
Joined: 16 May 2013
Total Posts: 716
25 May 2013 05:36 PM


-- No just no --
Report Abuse
ScriptOn is online. ScriptOn
Joined: 22 Aug 2010
Total Posts: 10885
25 May 2013 05:36 PM
Bragging about wits is allowed, according to Tony Stark :P
Report Abuse
RobloxBellic is not online. RobloxBellic
Joined: 16 May 2013
Total Posts: 716
25 May 2013 05:37 PM
I see your game didnt get on the front page again

-- No just no --
Report Abuse
ScriptOn is online. ScriptOn
Joined: 22 Aug 2010
Total Posts: 10885
25 May 2013 05:37 PM
Its ok I earned enough robux to reinact that. @bellic
Report Abuse
iwantpsp is not online. iwantpsp
Joined: 07 Sep 2010
Total Posts: 14291
25 May 2013 05:38 PM
Well,I'm gonna mess around with this script and change the numbers.
Report Abuse
doctorwhosmith2000 is not online. doctorwhosmith2000
Joined: 15 May 2010
Total Posts: 2761
25 May 2013 05:38 PM
Well done here's a cookie....
Report Abuse
ScriptOn is online. ScriptOn
Joined: 22 Aug 2010
Total Posts: 10885
25 May 2013 05:39 PM
@Iwant I put PRIVATE U NUB at the important parts that make this work.
Report Abuse
Fuzion217 is not online. Fuzion217
Joined: 13 Jan 2009
Total Posts: 30893
25 May 2013 05:39 PM
Care: -5

Follow me on Twitter @Fuzion217RBLX
Report Abuse
Rigasaurus is not online. Rigasaurus
Joined: 10 Jun 2012
Total Posts: 1650
25 May 2013 05:41 PM
Wait, what?

~When life gives you lemons, you squeeze it back to life's eyes!~
Report Abuse
ScriptOn is online. ScriptOn
Joined: 22 Aug 2010
Total Posts: 10885
25 May 2013 05:46 PM
its for my upcoming zombie game.

The terrain is randomly spawned (my terrain, not roblox's), and then these smart-zombies find you.... >:D
Report Abuse
ArceusInator is not online. ArceusInator
Joined: 10 Oct 2009
Total Posts: 30553
25 May 2013 05:49 PM
Sounds cool, but I recommend using A*.
Report Abuse
ScriptOn is online. ScriptOn
Joined: 22 Aug 2010
Total Posts: 10885
25 May 2013 05:52 PM
@Arc, I did.
Report Abuse
SadisticMurderer is not online. SadisticMurderer
Joined: 30 Apr 2013
Total Posts: 316
25 May 2013 05:53 PM
who are these users
Report Abuse
ScriptOn is online. ScriptOn
Joined: 22 Aug 2010
Total Posts: 10885
25 May 2013 05:53 PM
Noobs from ATR.
Report Abuse
Fuzion217 is not online. Fuzion217
Joined: 13 Jan 2009
Total Posts: 30893
25 May 2013 05:55 PM
@Script

I'm an older user than you, and I have more posts. By no means am I a noob.



Follow me on Twitter @Fuzion217RBLX
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
25 May 2013 05:56 PM
@Fuzion: My account is older and I have even more posts. That proves nothing.
Report Abuse
Fuzion217 is not online. Fuzion217
Joined: 13 Jan 2009
Total Posts: 30893
25 May 2013 05:59 PM
"My account is older and I have even more posts. That proves nothing."

Noob means new, so yes, join date means something.

Also, point count means something to, cause it means I'm not new to the forums.

And no, I'm not saying anyone here is a noob. I'm simply stating that I'm not one.

Follow me on Twitter @Fuzion217RBLX
Report Abuse
ScriptOn is online. ScriptOn
Joined: 22 Aug 2010
Total Posts: 10885
25 May 2013 06:01 PM
@fuz, actually, I`m an older user than you. I have a 2008 account named genya10g. kthxbai.
Report Abuse
777MrEpic is not online. 777MrEpic
Joined: 17 Oct 2012
Total Posts: 3998
25 May 2013 06:04 PM
getout
Report Abuse
ScriptOn is online. ScriptOn
Joined: 22 Aug 2010
Total Posts: 10885
25 May 2013 06:09 PM
lolno
Report Abuse
carl164 is not online. carl164
Joined: 04 Apr 2012
Total Posts: 35052
25 May 2013 06:13 PM
loled at all of the newbags saying get out

hi
Report Abuse
ScriptOn is online. ScriptOn
Joined: 22 Aug 2010
Total Posts: 10885
25 May 2013 06:14 PM
hia
Report Abuse
turbodaze is not online. turbodaze
Joined: 17 Dec 2008
Total Posts: 2169
25 May 2013 06:22 PM
@777MrEpic
o dear.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image