| Blockland Forums > General Discussion |
| Dual Death Run idea (any possible flaws?) |
| << < (3/4) > >> |
| Advanced Bot:
Try to look at the speedKart gamemode, it has a map rotation. |
| Swollow:
--- Code: ---function Map_Phase1() { BrickGroup_888888.chaindeletecallback = "Map_Phase2();"; BrickGroup_888888.chaindeleteall(); } function Map_Phase2() { schedule(10, 0, serverDirectSaveFileLoad, "save.bls", 3, "", 2, 1); } --- End code --- assuming you know how to code, you should be able to work the rest out |
| Advanced Bot:
--- Quote from: swollow on May 02, 2013, 06:56:56 PM --- --- Code: ---function Map_Phase1() { BrickGroup_888888.chaindeletecallback = "Map_Phase2();"; BrickGroup_888888.chaindeleteall(); } function Map_Phase2() { schedule(10, 0, serverDirectSaveFileLoad, "save.bls", 3, "", 2, 1); } --- End code --- assuming you know how to code, you should be able to work the rest out --- End quote --- This could work as well, this was from GameMode_SpeedKart --- Code: ---if($pref::Server::SpeedKart::RoundLimit $= "") { $pref::Server::SpeedKart::RoundLimit = 8; } $SK::Initialized = false; function SK_BuildTrackList() { // %pattern = "Add-Ons/SpeedKart_*/save.bls"; $SK::numTracks = 0; %file = findFirstFile(%pattern); while(%file !$= "") { $SK::Track[$SK::numTracks] = %file; $SK::numTracks++; %file = findNextFile(%pattern); } } function SK_DumpTrackList() { echo(""); if($SK::numTracks == 1) echo("1 track"); else echo($SK::numTracks @ " tracks"); for(%i = 0; %i < $SK::numTracks; %i++) { %displayName = $SK::Track[%i]; %displayName = strReplace(%displayName, "Add-Ons/SpeedKart_", ""); %displayName = strReplace(%displayName, "/save.bls", ""); %displayName = strReplace(%displayName, "_", " "); if(%i == $SK::CurrentTrack) echo(" >" @ %displayName); else echo(" " @ %displayName); } echo(""); } function SK_NextTrack() { $SK::CurrentTrack = mFloor($SK::CurrentTrack); $SK::CurrentTrack++; $SK::CurrentTrack = $SK::CurrentTrack % $SK::numTracks; $SK::ResetCount = 0; SK_LoadTrack_Phase1($SK::Track[$SK::CurrentTrack]); } function SK_LoadTrack_Phase1(%filename) { //suspend minigame resets $SK::MapChange = 1; //put everyone in observer mode %mg = $DefaultMiniGame; if(!isObject(%mg)) { error("ERROR: SK_LoadTrack( " @ %filename @ " ) - default minigame does not exist"); return; } for(%i = 0; %i < %mg.numMembers; %i++) { %client = %mg.member[%i]; %player = %client.player; if(isObject(%player)) %player.delete(); %camera = %client.camera; %camera.setFlyMode(); %camera.mode = "Observer"; %client.setControlObject(%camera); } //clear all bricks // note: this function is deferred, so we'll have to set a callback to be triggered when it's done BrickGroup_888888.chaindeletecallback = "SK_LoadTrack_Phase2(\"" @ %filename @ "\");"; BrickGroup_888888.chaindeleteall(); } function SK_LoadTrack_Phase2(%filename) { echo("Loading speedkart track " @ %filename); %displayName = %filename; %displayName = strReplace(%displayName, "Add-Ons/SpeedKart_", ""); %displayName = strReplace(%displayName, "/save.bls", ""); %displayName = strReplace(%displayName, "_", " "); %loadMsg = "\c5Now loading \c6" @ %displayName; //read and display credits file, if it exists // limited to one line %creditsFilename = filePath(%fileName) @ "/credits.txt"; if(isFile(%creditsFilename)) { %file = new FileObject(); %file.openforRead(%creditsFilename); %line = %file.readLine(); %line = stripMLControlChars(%line); %loadMsg = %loadMsg @ "\c5, created by \c3" @ %line; %file.close(); %file.delete(); } messageAll('', %loadMsg); //load environment if it exists %envFile = filePath(%fileName) @ "/environment.txt"; if(isFile(%envFile)) { //echo("parsing env file " @ %envFile); //usage: GameModeGuiServer::ParseGameModeFile(%filename, %append); //if %append == 0, all minigame variables will be cleared %res = GameModeGuiServer::ParseGameModeFile(%envFile, 1); EnvGuiServer::getIdxFromFilenames(); EnvGuiServer::SetSimpleMode(); if(!$EnvGuiServer::SimpleMode) { EnvGuiServer::fillAdvancedVarsFromSimple(); EnvGuiServer::SetAdvancedMode(); } } //load save file schedule(10, 0, serverDirectSaveFileLoad, %fileName, 3, "", 2, 1); } --- End code --- There is a little more of it, but it isn't really important. |
| Fastlex:
I have no idea how to work that or know or to program. |
| Advanced Bot:
--- Quote from: Fastlex on May 02, 2013, 07:07:27 PM ---I have no idea how to work that or know or to program. --- End quote --- I could script an auto rotation for you if you want me to. The problem is, I need you to tell me the name of the builds (file names) |
| Navigation |
| Message Index |
| Next page |
| Previous page |