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 » Scripting Helpers
Home Search
 

Script Re-entrancy has exceeded three

Previous Thread :: Next Thread 
Zzzip42Strike is not online. Zzzip42Strike
Joined: 09 Mar 2012
Total Posts: 269
11 Oct 2014 06:34 PM
What I want to make is the Cantor line fractal

Which is a line removing its middle third and then moving the 2 new lines downward.

And since fractals are supposed to be recursive I knew kindof that this problem might occur.

So I went around that by putting the wait so long that each coroutine should have finished therefore no reentrancy.

APPARENTLY IT DOESN'T EVEN REENTER ONCE THEN IT CALLS ERROR .-.?

______________________________________________________________________________

m = Instance.new("Model")
m.Parent = workspace
remIterations = 15
--root is the first cantor line
root = script.Parent
prevGen = {root}
newGen = {}

function drawNextLine(oldline)
--length of the newlines section
local oldlength = oldline.Size.x
local newlength = oldlength/3

--configuring size and position
local newlineA = oldline:Clone()
newlineA.Size = Vector3.new(newlength,oldline.Size.Y,oldline.Size.Z)
newlineA.CFrame = newlineA.CFrame * CFrame.new(newlineA.Size/2,0,5)
local newlineB = oldline:Clone()
newlineB.Size = Vector3.new(newlength,oldline.Size.Y,oldline.Size.Z)
newlineB.CFrame = newlineB.CFrame * CFrame.new(-newlineB.Size/2,0,5)

--Hello World!
newlineA.Parent = m
newlineB.Parent = m

--Moves them into the newGeneration for processing
table.insert(newGen,1, newlineA)
table.insert(newGen,1, newlineB)
end

function sendIntoRoutines()
--Releases all prevGen into calculation
for index, value in ipairs(prevGen) do
local newThread = coroutine.wrap(function()
drawNextLine(value)
end)
newThread()
end
end

function manageTables()
--Deletes all members of prevGen
for index, value in ipairs(prevGen) do
table.remove(prevGen,index)
end

--Moves all members of newGen to prevGen
--Deletes members of newGen
for index, value in ipairs(newGen) do
table.insert(prevGen,1,value)
table.remove(newGen,index)
end
end

while remIterations > 0 do
--This function launches every member of prevGen into drawNextLine
sendIntoRoutines()
wait(5)
--Now after they are finished, delete prevGen and move newGen into prevGen
manageTables()
--Decrease Iterations
remIterations = remIterations - 1
end



Report Abuse
Zzzip42Strike is not online. Zzzip42Strike
Joined: 09 Mar 2012
Total Posts: 269
11 Oct 2014 06:37 PM
Would it be more or less efficient to have a script that

1. Creates the 2 new lines
2. Places them
3. Reproduces this script into the 2 new lines
4. Deactivate the original script.

And is it possible for each script to have its own iteration counter or would it be better to have the counter as a seperate value in workspace?
Report Abuse
Zzzip42Strike is not online. Zzzip42Strike
Joined: 09 Mar 2012
Total Posts: 269
11 Oct 2014 08:34 PM
Seeing as nobody would help me

Figured out the trick an hour ago.

The trick is to have a script in the original brick do its job

Then it would reproduce into the new bricks

Finally it would kill itself.

http://www.roblox.com/Cantors-Progression-Between-Infinities-place?id=158751282

Take the model too, its a good framework for making fractals.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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