@@ -222,6 +222,7 @@ sellayer = real(sch_br_layer3) - 1
222222 for (a = 0 ; a <= (b - 1 ) * 2 ; a++) {
223223 if a % 2 == 0 {
224224 if nblockkey[z, nblocks] != 0 {
225+ var nudge = 0
225226 if sch_exp_velocity = 0 {
226227 if z = 1 {
227228 schematic_cell_set (mySchematic, lineloc + 1 , a + 2 , 1 , 25 , 0 )
@@ -242,45 +243,43 @@ sellayer = real(sch_br_layer3) - 1
242243 zvel = round (32 - nblockvel[z, nblocks]/100 * 32 )
243244 if zvel >= 15 && zvel <= 17 zvel = 14
244245 if sch_exp_circuitry = 1 {
245- schematic_fill (mySchematic, lineloc, a + 2 , 0 , zvel, a + 2 , 0 , sch_exp_circuit_block, sch_exp_circuit_data) // Connects a redstone line to the block
246- schematic_cell_set (mySchematic, zvel, a + 2 , 1 , sch_exp_circuit_block, sch_exp_circuit_data)
247- schematic_cell_set (mySchematic, zvel, a + 2 , 2 , 55 , 0 )
248- if zvel > 16 {
249- var c
250- for (c = lineloc + 1 ; c <= zvel; c++) {
251- if ( schematic_block_get (mySchematic, zvel + (c - zvel), a + 2 , 1 ) = 0 ) {
252- schematic_block_set ( mySchematic, zvel + (c - zvel), a + 2 , 1 , 55 )
253- }
246+ schematic_fill (mySchematic, lineloc, a + 2 , 0 , zvel, a + 2 , 0 , sch_exp_circuit_block, sch_exp_circuit_data) // Connects a redstone line to the block
247+ schematic_cell_set (mySchematic, zvel, a + 2 , 1 , sch_exp_circuit_block, sch_exp_circuit_data)
248+ schematic_cell_set (mySchematic, zvel, a + 2 , 2 , 55 , 0 )
249+ }
250+ if zvel > 16 {
251+ var c
252+ for (c = lineloc + 1 ; c <= zvel; c++ ) {
253+ if ( schematic_block_get ( mySchematic, zvel + (c - zvel), a + 2 , 1 ) = 0 ) {
254+ schematic_block_set (mySchematic, zvel + (c - zvel), a + 2 , 1 , 55 )
254255 }
255- }
256- if zvel < 16 {
257- var c
258- for (c = lineloc - 1 ; c >= zvel; c--) {
259- if (schematic_block_get (mySchematic, zvel + (c - zvel), a + 2 , 1 ) = 0 ) {
260- schematic_block_set (mySchematic, zvel + (c - zvel), a + 2 , 1 , 55 )
261- }
256+ }
257+ nudge = 1
258+ }
259+ if zvel < 16 {
260+ var c
261+ for (c = lineloc - 1 ; c >= zvel; c--) {
262+ if (schematic_block_get (mySchematic, zvel + (c - zvel), a + 2 , 1 ) = 0 ) {
263+ schematic_block_set (mySchematic, zvel + (c - zvel), a + 2 , 1 , 55 )
262264 }
263265 }
266+ nudge = -1
264267 }
265- if sch_br_layer2 != 0 && z = 1 {
266- schematic_cell_set (mySchematic, zvel, a + 3 , 1 , 25 , 0 )
267- schematic_cell_set (mySchematic, zvel, a + 3 , 2 , 0 , 0 )
268- schematic_cell_set (mySchematic, zvel, a + 3 , 0 , sch_exp_ins_block[nblockins[z, nblocks]], 0 )
269- noteblockx[z, nblocks] = a + 3
270- } else if sch_br_layer3 != 0 && z = 2 {
268+ if (schematic_block_get (mySchematic, zvel, a + 1 , 1 ) = 25 ) {
269+ schematic_cell_set (mySchematic, zvel + nudge, a + 2 , 1 , 25 , 0 )
270+ schematic_cell_set (mySchematic, zvel + nudge, a + 2 , 2 , 0 , 0 )
271+ schematic_cell_set (mySchematic, zvel + nudge, a + 2 , 0 , sch_exp_ins_block[nblockins[z, nblocks]], 0 )
272+ schematic_cell_set (mySchematic, zvel + nudge, a + 1 , 0 , sch_exp_ins_block[nblockins[z, nblocks]], 0 )
273+ noteblockx[z, nblocks] = a + 2
274+ noteblockz[z, nblocks] = zvel + nudge
275+ show_debug_message (" found blocked pos end of line" )
276+ } else {
271277 schematic_cell_set (mySchematic, zvel, a + 1 , 1 , 25 , 0 )
272278 schematic_cell_set (mySchematic, zvel, a + 1 , 2 , 0 , 0 )
273279 schematic_cell_set (mySchematic, zvel, a + 1 , 0 , sch_exp_ins_block[nblockins[z, nblocks]], 0 )
274-
275- noteblockx[z, nblocks] = a + 1
276- } else {
277- schematic_cell_set (mySchematic, zvel, a + 2 , 1 , 25 , 0 )
278- schematic_cell_set (mySchematic, zvel, a + 2 , 2 , 0 , 0 )
279- schematic_cell_set (mySchematic, zvel, a + 2 , 0 , sch_exp_ins_block[nblockins[z, nblocks]], 0 )
280-
281- noteblockx[z, nblocks] = a + 2
280+ noteblockx[z, nblocks] = a + 1
281+ noteblockz[z, nblocks] = zvel
282282 }
283- noteblockz[z, nblocks] = zvel
284283 }
285284 noteblocky[z, nblocks] = 1
286285 noteblocknote[z, nblocks] = nblockkey[z, nblocks] - 33
@@ -378,19 +377,35 @@ sellayer = real(sch_br_layer1) - 1
378377 if sch_exp_circuitry = 1 {
379378 schematic_fill (mySchematic, lineloc, a + 2 , 0 , zvel, a + 2 , 0 , sch_exp_circuit_block, sch_exp_circuit_data) // Connects a redstone line to the block
380379 if zvel > 16 {
380+ nudge = 1
381+ var d
381382 var c
382383 for (c = lineloc + 1 ; c <= zvel; c++) {
383384 if (schematic_block_get (mySchematic, zvel + (c - zvel) - 1 , a + 2 , 1 ) = 0 ) {
384385 schematic_block_set (mySchematic, zvel + (c - zvel) - 1 , a + 2 , 1 , 55 )
385386 }
387+ if (schematic_block_get (mySchematic, zvel + (c - zvel) + 1 , a + 2 , 1 ) = 25 ) {
388+ schematic_cell_set (mySchematic, zvel + (c - zvel) + 1 , a + 1 , 1 , sch_exp_circuit_block, sch_exp_circuit_data)
389+ schematic_cell_set (mySchematic, zvel + (c - zvel) + 1 , a + 2 , 1 , 25 , 0 )
390+ schematic_cell_set (mySchematic, zvel + (c - zvel) + 1 , a + 2 , 2 , 0 , 0 )
391+ schematic_block_set (mySchematic, zvel + (c - zvel) + 1 , a + 2 , 2 , 55 )
392+ }
386393 }
387394 }
388395 if zvel < 16 {
396+ nudge = -1
389397 var c
398+ var d
390399 for (c = lineloc - 1 ; c >= zvel; c--) {
391400 if (schematic_block_get (mySchematic, zvel + (c - zvel) + 1 , a + 2 , 1 ) = 0 ) {
392401 schematic_block_set (mySchematic, zvel + (c - zvel) + 1 , a + 2 , 1 , 55 )
393402 }
403+ if (schematic_block_get (mySchematic, zvel + (c - zvel) + 1 , a + 2 , 1 ) = 25 ) {
404+ schematic_cell_set (mySchematic, zvel + (c - zvel) + 1 , a + 1 , 1 , 25 , 0 )
405+ schematic_cell_set (mySchematic, zvel + (c - zvel) + 1 , a + 1 , 2 , 0 , 0 )
406+ schematic_cell_set (mySchematic, zvel + (c - zvel) + 1 , a + 2 , 1 , sch_exp_circuit_block, sch_exp_circuit_data)
407+ schematic_block_set (mySchematic, zvel + (c - zvel) + 1 , a + 2 , 2 , 55 )
408+ }
394409 }
395410 }
396411 }
@@ -413,18 +428,18 @@ sellayer = real(sch_br_layer1) - 1
413428 schematic_cell_set (mySchematic, zvel, a + 3 , 2 , 0 , 0 )
414429 schematic_cell_set (mySchematic, zvel, a + 3 , 0 , sch_exp_ins_block[nblockins[z, nblocks]], 0 )
415430 noteblockx[z, nblocks] = a + 3
416- } else if (schematic_block_get (mySchematic, zvel, a + 3 , 1 ) = 25 ) && (schematic_block_get (mySchematic, zvel, a + 1 , 1 ) = 0 ) {
431+ } else if (schematic_block_get (mySchematic, zvel, a + 3 , 1 ) = 25 ) && (schematic_block_get (mySchematic, zvel, a + 1 , 1 ) = 0 ) && ( schematic_block_get (mySchematic, zvel + nudge, a + 1 , 1 ) != 0 ) {
417432 schematic_cell_set (mySchematic, zvel, a + 1 , 1 , 25 , 0 )
418433 schematic_cell_set (mySchematic, zvel, a + 1 , 2 , 0 , 0 )
419434 schematic_cell_set (mySchematic, zvel, a + 1 , 0 , sch_exp_ins_block[nblockins[z, nblocks]], 0 )
420435 noteblockx[z, nblocks] = a + 1
421- show_debug_message (" note block in way" )
422- } else if (schematic_block_get (mySchematic, zvel, a + 1 , 1 ) = 25 ) && (schematic_block_get (mySchematic, zvel, a + 3 , 1 ) = 0 ) {
436+ // show_debug_message("note block in way")
437+ } else if (schematic_block_get (mySchematic, zvel, a + 1 , 1 ) = 25 ) && (schematic_block_get (mySchematic, zvel, a + 3 , 1 ) = 0 ) && ( schematic_block_get (mySchematic, zvel + nudge, a + 1 , 1 ) != 0 ) {
423438 schematic_cell_set (mySchematic, zvel, a + 3 , 1 , 25 , 0 )
424439 schematic_cell_set (mySchematic, zvel, a + 3 , 2 , 0 , 0 )
425440 schematic_cell_set (mySchematic, zvel, a + 3 , 0 , sch_exp_ins_block[nblockins[z, nblocks]], 0 )
426441 noteblockx[z, nblocks] = a + 3
427- show_debug_message (" note block in way" )
442+ // show_debug_message("note block in way")
428443 } else {
429444 schematic_cell_set (mySchematic, zvel, a + 2 , 1 , 25 , 0 )
430445 schematic_cell_set (mySchematic, zvel, a + 2 , 2 , 0 , 0 )
@@ -472,11 +487,28 @@ for (a = rangestart; a <= rangeend; a ++) {
472487 }
473488 }
474489}
490+ entries = rangeend - rangestart
491+ for (c = 0 ; c < sch_exp_chords; c ++) { // Corrections hack
492+ for (a = 0 ; a <= entries; a ++) {
493+ if (schematic_block_get (mySchematic, noteblockz[c, a], noteblockx[c, a], 1 ) = 25 ) {
494+ schematic_block_set (mySchematic, noteblockz[c, a], noteblockx[c, a], 2 , 0 )
495+ }
496+ if (schematic_block_get (mySchematic, noteblockz[c, a], noteblockx[c, a], 1 ) = sch_exp_circuit_block) {
497+ noteblockx[c, a] -= 1
498+ }
499+ if (schematic_block_get (mySchematic, noteblockz[c, a], noteblockx[c, a] - 1 , 1 ) = sch_exp_circuit_block) || (schematic_block_get (mySchematic, noteblockz[c, a], noteblockx[c, a] - 1 , 1 ) = 0 ) {
500+ if (schematic_block_get (mySchematic, noteblockz[c, a], noteblockx[c, a] - 1 , 0 ) != sch_exp_circuit_block) {
501+ schematic_block_set (mySchematic, noteblockz[c, a], noteblockx[c, a] - 1 , 1 , 0 )
502+ schematic_block_set (mySchematic, noteblockz[c, a], noteblockx[c, a] - 1 , 0 , 0 )
503+ }
504+ }
505+ }
506+ }
507+
475508show_debug_message (sch_layer1)
476509show_debug_message(sch_layer2)
477510show_debug_message(sch_layer3)
478511show_debug_message(noteblocks)
479- entries = rangeend - rangestart
480512schematic_save(mySchematic, fn, entries, noteblocks);
481513schematic_destroy (mySchematic);
482514schematic_end ();
0 commit comments