/////////////////////////////////////////////////////////////////////////// // Copyright (C) Wizardry and Steamworks 2011 - License: GNU GPLv3 // // Please see: http://www.gnu.org/licenses/gpl.html for legal details, // // rights of fair usage, the disclaimer and warranty conditions. // /////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////// // CONFIGURATION // ////////////////////////////////////////////////////////// // The height of the generated board. integer BOARD_HEIGHT = 10; // The width of the generated board. integer BOARD_WIDTH = 10; // The delay between rezzing the object in the primitive. float SPEED = .2; // Set this to the scale of the primitive inside the object. vector OBJECT_SCALE = <.1,.1,.1>; // Set this to the name of the object to rez. string TILE_NAME = "[K] Holo Tile"; ////////////////////////////////////////////////////////// // INTERNALS // ////////////////////////////////////////////////////////// integer runner = 0; integer gitra = 0; integer gitrb = 0; vector tilePos = ZERO_VECTOR; default { state_entry() { llSay(0, "Click the glowing prim to deploy more tiles."); } touch_start(integer total_number) { // Sanity. if(BOARD_HEIGHT*BOARD_WIDTH < 1) { llSay(DEBUG_CHANNEL, "Sorry, the width and height have to be larger than zero. Aborting."); return; } if(TILE_NAME == "") { llSay(DEBUG_CHANNEL, "Sorry, I could not find an object in the inventory to rez. Aborting."); return; } runner = BOARD_HEIGHT*BOARD_WIDTH; tilePos = llGetPos(); state deploy; } } state deploy { state_entry() { llSay(0, "Please wait, deploying prims. Touch To stop..."); llSetTimerEvent(SPEED); } touch_start(integer num) { llSetTimerEvent(0); state default; } timer() { llSetTimerEvent(0); if(runner > BOARD_WIDTH*BOARD_HEIGHT) { state default; return; } if(gitrb < BOARD_HEIGHT) { if(gitra < BOARD_WIDTH-1) { llRezObject(TILE_NAME,tilePos,ZERO_VECTOR,ZERO_ROTATION,runner--); tilePos.x += OBJECT_SCALE.x; llSetPos(tilePos); // llSetLinkPrimitiveParamsFast(LINK_THIS, [OBJECT_POS, tilePos]); // Thanks, FailedNoob Resident. - SL Compatible ++gitra; llSetTimerEvent(SPEED); return; } llRezObject(TILE_NAME,tilePos,ZERO_VECTOR,ZERO_ROTATION,runner--); tilePos.z += OBJECT_SCALE.z; tilePos.x -= (BOARD_WIDTH-1)*OBJECT_SCALE.x; llSetPos(tilePos); // llSetLinkPrimitiveParamsFast(LINK_THIS, [OBJECT_POS, tilePos]); // Thanks, FailedNoob Resident. - SL Compatible //OBJECT_SCALE.x *= -1; ++gitrb; gitra = 0; llSetTimerEvent(SPEED); return; } } }