So I've been messing around with island generation and i do have on that works. However if I try and generate an island after certain x and y values it says it generated but does not draw on screen? I do not know if I have accidentally made a limiting factor for x/y values perhaps?
Feel free to request code or have a look at the code (generation is in noise.lua)
I've tried to fix this for god knows how long and I'm in need of help
"Islands" not being generated after certain x/y value
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 7
- Joined: Mon Jan 21, 2019 5:36 pm
- Contact:
"Islands" not being generated after certain x/y value
- Attachments
-
- islands.zip
- (1.41 KiB) Downloaded 126 times
Re: "Islands" not being generated after certain x/y value
Are you maybe drawing outside the 5000x5000 canvas? I don't see any other limits in the code.
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
"If each mistake being made is a new one, then progress is being made."
Re: "Islands" not being generated after certain x/y value
The # operator isn't guaranteed to work unless the arrays start in 1. I think LuaJIT is more forgiving about not starting exactly with 1, but not as much as 1000 times more forgiving.
The problem seems to be in the iteration limit for the drawing loop. Changing it to this worked for me:
The problem seems to be in the iteration limit for the drawing loop. Changing it to this worked for me:
Code: Select all
for x = island.x, island.x + size do
for y = island.y, island.y + size do
-
- Prole
- Posts: 7
- Joined: Mon Jan 21, 2019 5:36 pm
- Contact:
Re: "Islands" not being generated after certain x/y value
Okay pgimeno, I'll give it a try in the morning! Thanks for giving me a handpgimeno wrote: ↑Sat Feb 02, 2019 8:09 pm The # operator isn't guaranteed to work unless the arrays start in 1. I think LuaJIT is more forgiving about not starting exactly with 1, but not as much as 1000 times more forgiving.
The problem seems to be in the iteration limit for the drawing loop. Changing it to this worked for me:
Code: Select all
for x = island.x, island.x + size do for y = island.y, island.y + size do
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 6 guests