Alright, so I've been thinking about replicating WarioWare/TF2Ware in blockland and calling it BlockoWare. So far, this is the script:
// Rocket Jump :D
new ScriptObject(rocketJump) {
// msg is the text it'll show when the game is about to start.
msg = "Rocket Jump!";
// time is how long the game lasts from it's starting action to it's end.
time = 5;
};
function rocketJump::action() {
// give all players WEPONS
}
function rocketJump::end() {
// remove all players' WEPONS after 7 seconds
}
// Ceiling Rain :D
new ScriptObject(ceilingRain) {
msg = "Heads up!";
time = 3;
};
function ceilingRain::action() {
// spawn a bunch of arrows on the ceiling
}
function ceilingRain::end() {
// not really needed, nothing happens at the end.
}
//insert our game(s) into the games table
%games[1] = rocketJump;
%games[2] = ceilingRain;
// fun stuff starts here
package bwGameLoop {
function bwGameLoop() {
// choose a random game from the game table
// display it onscreen as a center print for two seconds
// after two seconds, execute the randomly chosen game's action function (if it exists)
// this area is where the game is happening
// when you die, you lose points and respawn at the game's end.
// after the amount of time set as the game's length, execute the game's end function (again, if it exists)
// wait a little bit, then go back to the top
// hopefully looping this shouldn't prevent package deactivation.
}
};
function serverCmdBWReload() {
echo("BlockoWare reloading...");
exec("Add-Ons/GameMode_BlockoWare/server.cs");
}
function serverCmdBWStart() {
echo("BlockoWare starting...");
activatePackage(bwGameLoop);
}
function serverCmdBWStop() {
echo("BlockoWare stopping...");
deactivatePackage(bwGameLoop);
}Most of it is a proof of concept, and I've put comments in the "bwGameLoop" area of what I'm unsure of how to actually do. It does work but nothing functional yet. I need to know some things:
- Is there a sort of "sleep()" command that waits a certain amount of time to execute the next command? Or is there a function that I can send another function and a set amount of time to run it after? Such as "delay( %myFunctionThatDoesStuffAfterFiveSeconds, 5)".
- How would I go about getting an array of all of the players in the game? To give them their rockets in the rocket jump game, that is.
- How can I get a brick by it's ID, and are it's methods in correspondence to the events that can be applied to it ingame? (dissappear, fakeKillBrick, etc.)
- Similar to the brick question, are player methods in correspondence to events ingame as well?
Thanks in advance, please be advised I started learning all of this three hours ago and I'm sort of a newbie :P