Player control while script is executing?

Started by C10H16, February 17, 2023, 03:44:51 AM

Previous topic - Next topic

C10H16

Hello! I am brand new to V6 internal scripting, and it's a blast! It's like learning a whole other coding language! I am very sad to not have my usual operators (var, for, while, arrays in general) but its fun making work arounds!

Anyway, I've been looking around the forum, but this has pretty much stumped me, is there any way to allow the player to move/have full range of abilities while a script is running? for example, if I wanted walls of enemies to slowly fill up the screen left to right, and make the player have to run away from said enemies, how would I grant the player the ability to move as the loop is running? is that possible?

EDIT: I should have seen this coming, 'slowly', aka, I'm spawning a line of enemies at once and then using delay(15) to make it so that each row spawns in one at a time, problem is, delay() seems to stop the player from being able to do anything as well. So, the solution lies in being able to delay the enemy spawning and not delay the player, which doesnt sound very possible if I cant use the delay() command

Thanks in advance!

EDIT: I found someone way smarter than me who made a timer do that whole urgency thing, makes way more sense! I'd still love to use my old idea though, so if you've got an idea, let me know

Dynaboom4

Okay, sorry if anybody has responded, but i will even if you've found a solution. I guess you've used my
timer editor, and i'm glad it helps. But if you want in general to work on ennemies, i recommend you not using the timer editor, there's a way easier method than the timer, that is really limitated.
So if you want to work on spawning custom entities, by that i mean with custom speed, custom positions ex...
First you need to understand what is internal script. To understand better i really recommend you to use VED. That is a way better editor than the VVVVVV one.
Internal script is in general a special script box that allows you to use any command in the internal game (so every command that is not in the base editor)
To get that internal script box, you must first, make one normal script.(To illustrate what i mean, i just will name it script1) in that script put the following line :
Script 1 :
iftrinkets(0,script2)

Than, create a new script called script2. This will be your internal script. But yet it's still a normal script, to turn it into an internal script you must click Int.sc button on the right side of your screen when you're inside of script2, normally it says it's off, but after you've clicked it once, it should say it's on.
Than inside this script you must use the command createentity(x,y,type,direction,speed,borderleft,bordertop,borderright,borderbottom)
Most of the parameters of this command must be changed depending on how you want your enemy to be.
x,y stands for the starting coordinates of your enemy, thoses coordinates can be see in the main screen of ved (when you're building your level) on the bottom right part of the editor (the third line of numbers).
type stands for the type of enemy you want to use. The basics ones are 2 for moving plateforms and 56 for ennemies
direction means the direction you want your enemy to go. 0 is down, 1 is up, 2 is left, 3 is right.
Speed this one i think is obvious
Borderbottom,borderright ... All thoses are optional parameters, and allows you to choose the bouncing box of your enemy, like you can do in the editor by putting a red square on the screen with F4.
Same goes there, just that you have to manualy type the coordinates of the each border of your bouncing square.
So that's it for createentities, it's not that easy, so i understand if you don't get everything. But if you have any questions, reply to this comment i will gladly respond

Ally 🌠

Yeah, the player can't move while a script is executing, sorry. You'll have to find other workarounds, like the ones mentioned above by Dynaboom4. If you want to join the Discord server, it might be easier to get quicker help that way, since we have a channel dedicated to VVVVVV help.