Servus gm-d Community,
Ich habe vor kurzem das Layout von meinen Tileset sheets geändert, weshalb ich auch entsprechend das Script anpassen musste.
Vorher hatte ich das Ganze mathematisch geordnet (Nach dem Binärsystem, Oben Links beginnend), nun allerdings in einem optisch schöneren und leichter zusammzustellbaren Format.
Entsprechend musste ich meinen Code anpassen.
Nun habe ich allerdings das Problem das die Kollisonsüberprüfungen eigenartige Ergebnisse liefern, weshalb auch das Tiling nicht mehr ganz will.
Der wesentliche Unterschied ist, dass ich die Tilegröße von 32 auf 16 pixel reduziert habe, wofür ich mir allerdings extra ein Attribut bereit gestellt hatte.
Ich denke mal nicht das es nötig ist, dass ihr euch jeden Fall einzeln anguckt, da diese an sich stimmen sollten.
Das einzige Problem sind meine Kollisionen, wie der debug Modus schön zeigt.
Ich hoffe, dass ihr irgendwo Logikfehler finden könnt.
Spoiler anzeigen
Alles anzeigen
Ich rufe das Script nach einer Sekunde (room_speed) auf, um sicher zu gehen, dass alle Block Instanzen bereits platziert sind.

EDIT: @instance_position: Das war jetzt bis zuletzt noch ein Versuch, in der Hoffnung dass andere Ergebnisse ausgespuckt werden. Jedoch wurde auch das nichts. Normalerweise habe ich place_meeting benutzt, wobei das ergebniss ja in beiden fallen logischer weise gleich sein muss.. Entweder null oder eben nicht null.
MfG,
Yivo
Ich habe vor kurzem das Layout von meinen Tileset sheets geändert, weshalb ich auch entsprechend das Script anpassen musste.
Vorher hatte ich das Ganze mathematisch geordnet (Nach dem Binärsystem, Oben Links beginnend), nun allerdings in einem optisch schöneren und leichter zusammzustellbaren Format.
Entsprechend musste ich meinen Code anpassen.
Nun habe ich allerdings das Problem das die Kollisonsüberprüfungen eigenartige Ergebnisse liefern, weshalb auch das Tiling nicht mehr ganz will.
Der wesentliche Unterschied ist, dass ich die Tilegröße von 32 auf 16 pixel reduziert habe, wofür ich mir allerdings extra ein Attribut bereit gestellt hatte.
Ich denke mal nicht das es nötig ist, dass ihr euch jeden Fall einzeln anguckt, da diese an sich stimmen sollten.
Das einzige Problem sind meine Kollisionen, wie der debug Modus schön zeigt.
Ich hoffe, dass ihr irgendwo Logikfehler finden könnt.
GML-Quellcode
- var dst, obj, U, D, L, R, UL, UR, DL, DR;
- dst = 16; //Distance between each other
- obj = object_index; //Only autotile with instances like yourself
- U = instance_position(x,y-dst,obj); //Up
- D = instance_position(x,y+dst,obj); //Down
- L = instance_position(x-dst,y,obj); //Left
- R = instance_position(x+dst,y,obj); //Right
- UL = instance_position(x-dst,y-dst,obj); //UpLeft
- UR = instance_position(x+dst,y-dst,obj); //UpRight
- DL = instance_position(x-dst,y+dst,obj); //DownLeft
- DR = instance_position(x+dst,y+dst,obj); //DownRight
- image_speed = 0; //Don't play the animation
- //Cases Start//
- // Block'o'9
- if (!U && D && !L && R && !UL && !UR && !DL && DR)
- {
- image_index = 0;
- }
- if (!U && (D) && (L) && (R) && !UL && !UR && (DL) && (DR))
- {
- image_index = 1;
- }
- if (!U && (D) && (L) && !R && !UL && !UR && (DL) && !DR)
- {
- image_index = 2;
- }
- if ((U) && (D) && !L && (R) && !UL && (UR) && !DL && (DR))
- {
- image_index = 15;
- }
- if ((U) && (D) && (L) && (R) && (UL) && (UR) && (DL) && (DR))
- {
- image_index = 16;
- }
- if ((U) && (D) && (L) && !R && (UL) && !UR && (DL) && !DR)
- {
- image_index = 17;
- }
- if ((U) && !D && !L && (R) && !UL && (UR) && !DL && !DR)
- {
- image_index = 30;
- }
- if ((U) && !D && (L) && (R) && (UL) && (UR) && !DL && !DR)
- {
- image_index = 31;
- }
- if((U) && !D && (L) && !R && (UL) && !UR && !DL && !DR)
- {
- image_index = 32;
- }
- //Platform Horizontal
- if (!U && !D && !L && (R) && !UL && !UR && !DL && !DR)
- {
- image_index = 3;
- }
- if (!U && !D && (L) && (R) && !UL && !UR && !DL && !DR)
- {
- image_index = 4;
- }
- if (!U && !D && (L) && !R && !UL && !UR && !DL && !DR)
- {
- image_index = 5;
- }
- //Edge + Inner Edge
- if (!U && (D) && !L && (R) && !UL && !UR && !DL && !DR)
- {
- image_index = 18;
- }
- if (!U && (D) && (L) && !R && !UL && !UR && !DL && !DR)
- {
- image_index = 19;
- }
- if ((U) && !D && !L && (R) && !UL && !UR && !DL && !DR)
- {
- image_index = 33;
- }
- if ((U) && !D && (L) && !R && !UL && !UR && !DL && !DR)
- {
- image_index = 34;
- }
- //image_index 35 is free
- //Single Platform
- if (!U && !D && !L && !R && !UL && !UR && !DL && !DR)
- {
- image_index = 20;
- }
- //Platform Vertical
- if (!U && (D) && !L && !R && !UL && !UR && !DL && !DR)
- {
- image_index = 6;
- }
- if ((U) && (D) && !L && !R && !UL && !UR && !DL && !DR)
- {
- image_index = 21;
- }
- if ((U) && !D && !L && !R && !UL && !UR && !DL && !DR)
- {
- image_index = 36;
- }
- //T Crossings
- if ((U) && (D) && (L) && !R && !UL && !UR && !DL && !DR)
- {
- image_index = 7;
- }
- if ((U) && (D) && (L) && !R && (UL) && !UR && !DL && !DR)
- {
- image_index = 8;
- }
- if ((U) && (D) && (L) && !R && !UL && !UR && (DL) && !DR)
- {
- image_index = 9;
- }
- if ((U) && !D && (L) && (R) && !UL && !UR && !DL && !DR)
- {
- image_index = 22;
- }
- if ((U) && !D && (L) && (R) && (UL) && !UR && !DL && !DR)
- {
- image_index = 23;
- }
- if ((U) && !D && (L) && (R) && !UL && (UR) && !DL && !DR)
- {
- image_index = 24;
- }
- if ((U) && (D) && !L && (R) && !UL && !UR && !DL && !DR)
- {
- image_index = 37;
- }
- if ((U) && (D) && !L && (R) && !UL && (UR) && !DL && !DR)
- {
- image_index = 38;
- }
- if ((U) && (D) && !L && (R) && !UL && !UR && !DL && (DR))
- {
- image_index = 39;
- }
- if (!U && (D) && (L) && (R) && !UL && !UR && !DL && !DR)
- {
- image_index = 52;
- }
- if (!U && (D) && (L) && (R) && !UL && !UR && (DL) && !DR)
- {
- image_index = 53;
- }
- if (!U && (D) && (L) && (R) &&!UL && !UR && !DL && (DR))
- {
- image_index = 54;
- }
- // image_index 10 is free
- // image_index 25 is free
- // image_index 40 is free
- // image_index 55 is free
- //Additional Inner Edges
- if ((U) && (D) && (L) && (R) && !UL && !UR && !DL && !DR)
- {
- image_index = 11;
- }
- if ((U) && (D) && (L) && (R) && (UL) && !UR && !DL && !DR)
- {
- image_index = 12;
- }
- if ((U) && (D) && (L) && (R) && !UL && (UR) && !DL && !DR)
- {
- image_index = 13;
- }
- if ((U) && (D) && (L) && (R) && (UL) && (UR) && !DL && !DR)
- {
- image_index = 14;
- }
- if ((U) && (D) && (L) && (R) && !UL && !UR && (DL) && !DR)
- {
- image_index = 26;
- }
- if ((U) && (D) && (L) && (R) && (UL) && !UR && (DL) && !DR)
- {
- image_index = 27;
- }
- if ((U) && (D) && (L) && (R) && !UL && (UR) && (DL) && !DR)
- {
- image_index = 28;
- }
- if ((U) && (D) && (L) && (R) && (UL) && (UR) && (DL) && !DR)
- {
- image_index = 29;
- }
- if ((U) && (D) && (L) && (R) && !UL && !UR && !DL && (DR))
- {
- image_index = 41;
- }
- if ((U) && (D) && (L) && (R) && (UL) && !UR && !DL && (DR))
- {
- image_index = 42;
- }
- if ((U) && (D) && (L) && (R) && !UL && (UR) && !DL && (DR))
- {
- image_index = 43;
- }
- if ((U) && (D) && (L) && (R) && (UL) && (UR) && !DL && (DR))
- {
- image_index = 44;
- }
- if ((U) && (D) && (L) && (R) && !UL && !UR && (DL) && (DR))
- {
- image_index = 56;
- }
- if ((U) && (D) && (L) && (R) && (UL) && !UR && (DL) && (DR))
- {
- image_index = 57;
- }
- if ((U) && (D) && (L) && (R) && !UL && (UR) && (DL) && (DR))
- {
- image_index = 58;
- }
- //image_index 59 is the same as 16
- // image_index 45-51 is free
Ich rufe das Script nach einer Sekunde (room_speed) auf, um sicher zu gehen, dass alle Block Instanzen bereits platziert sind.

EDIT: @instance_position: Das war jetzt bis zuletzt noch ein Versuch, in der Hoffnung dass andere Ergebnisse ausgespuckt werden. Jedoch wurde auch das nichts. Normalerweise habe ich place_meeting benutzt, wobei das ergebniss ja in beiden fallen logischer weise gleich sein muss.. Entweder null oder eben nicht null.
MfG,
Yivo
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von Yivo ()