Toggle for warp block without duplicating the script

So basically i have a project that will be laggy on some devices if it has a warp block on it, so I want to have a toggle for a warp block

But I also don’t want to duplicate an entire big script just to put a warp on it

I can’t do enable turbo because that would break other parts of the project as well

Try using metaprogramming to nest a script into a warp block.

I thought of that, I just wanted to know if there was another more efficient way of doing it than a variable

Possibility continuations?

untitled script pic - 2023-08-30T090753.377

you beat me! :laughing:

Oh, for some reason I thought run was like launch and canceled the effect that is applied by the warp C

The trouble with introducing super-powerful capabilities into Snap! is that people forget the basic stuff! :~)

Never mind WARP. Any time you're in the position of copy-pasting a bunch of code so that you can use it in more than one place, make it a procedure! That's basically what @pajamaclaws21 has done by making the code an input to a SOMETIMES-WARP block, but you don't have to make a special version of WARP if this situation only happens once in your program; you can make a plain old helper block named HELPER or something and then put the IF/ELSE right in your script.

I didn’t really forget it, the reason I needed this was because the script was HUGE and if stored in a variable would lag a ton. As well as the fact that there’s really no other block like warp in snap

Basically I thought “run” worked like “launch with variables and wait” not treating the block like whatever the input is what’s there

I was actually thinking about @joecooldoo's suggestion to use metaprogramming. ;~)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.