Creating a teleport_block with random level_destinations?
Hey, I've been trying to rework the custom block: Teleport_To_Specified_Level from Teo17 for a while now.
Here is the custom block TTSL. ->https://www.smwcentral.net/?p=section&a=details&id=4025
(file name: TTSL.asm)
I am trying to add 4 level destinations with an array instead of just 1.
A random level target should then be chosen with a frame counter or a math.random.
Basicly a warp to a random level-destination chosen from a pool/array of four levels.
I found the custom block: Specific_screen_teleport_block_&_door_v1.2 from Alcaro, GreenHammerBro, Iχtab, MarioE and wye,
which use one of four screens exits at "random" by a frame-counter.
Here is the custom block SSTB. -> https://www.smwcentral.net/?p=section&a=details&id=19063
(file name: screentele_rand.asm)
I would like to take these two sections of code (array & frame-counter) to the teleport block,
so instead of a random screen-exit, I can get a random level-destination.
I think determining the array worked, but I still need to set a value to the array-position("x") in the array: "randomtable,x", by the frame-counter.
Then get the result from the array to the "teleport-function" to teleport to a "random" level.
I'm not sure what I need to consider when creating an array from a variable, or how to specify it correctly.
I'm not really familiar with asm, so I wanted to ask here for advice if someone could look over the code and help me out.
(Of course, only if copying all this is even possible and it is as simple as I imagine it to be right now.)
Here is my Edited version of Teo17 custom block: TTSL.asm:
Comments marked with "#///" inside the code are from me and show the changes I am trying to make/achive.
I am aware that this version of the code does not work and I probably cannot just copy code snippets from other ASM files.
But if only a few changes are needed to make this work, I would be very grateful!
Hey, I've been trying to rework the custom block: Teleport_To_Specified_Level from Teo17 for a while now.
Here is the custom block TTSL. ->https://www.smwcentral.net/?p=section&a=details&id=4025
(file name: TTSL.asm)
I am trying to add 4 level destinations with an array instead of just 1.
A random level target should then be chosen with a frame counter or a math.random.
Basicly a warp to a random level-destination chosen from a pool/array of four levels.
I found the custom block: Specific_screen_teleport_block_&_door_v1.2 from Alcaro, GreenHammerBro, Iχtab, MarioE and wye,
which use one of four screens exits at "random" by a frame-counter.
Here is the custom block SSTB. -> https://www.smwcentral.net/?p=section&a=details&id=19063
(file name: screentele_rand.asm)
I would like to take these two sections of code (array & frame-counter) to the teleport block,
so instead of a random screen-exit, I can get a random level-destination.
I think determining the array worked, but I still need to set a value to the array-position("x") in the array: "randomtable,x", by the frame-counter.
Then get the result from the array to the "teleport-function" to teleport to a "random" level.
I'm not sure what I need to consider when creating an array from a variable, or how to specify it correctly.
I'm not really familiar with asm, so I wanted to ask here for advice if someone could look over the code and help me out.
(Of course, only if copying all this is even possible and it is as simple as I imagine it to be right now.)
Here is my Edited version of Teo17 custom block: TTSL.asm:
Comments marked with "#///" inside the code are from me and show the changes I am trying to make/achive.
I am aware that this version of the code does not work and I probably cannot just copy code snippets from other ASM files.
But if only a few changes are needed to make this work, I would be very grateful!