func Initialize() { //Ressource Buildings CreateConstruction(RFLN, 1040, 740, NO_OWNER, 100, 1, 0); //Flintfactory Middle CreateConstruction(RSMG, 810, 540, NO_OWNER, 100, 1, 0); //Steamgenerator Left CreateConstruction(RSMG, 1315, 545, NO_OWNER, 100, 1, 0); //Steamgenerator Left //Pipe to Steamgenerator CreateObject(PIPE, 1349, 1008, NO_OWNER); //Crumbling Islands (deco) var CIsleL = CreateObject(ISLE, 760, 810, NO_OWNER); CIsleL -> SetClrModulation(RGBa(200, 215, 255, 50)); var CIsleM = CreateObject(ISLE,1100,1000, NO_OWNER); CIsleL -> SetClrModulation(RGBa(200, 215, 255, 80)); var CIsleR = CreateObject(ISLE,1335,800, NO_OWNER); CIsleR -> SetClrModulation(RGBa(200, 215, 255, 30)); CreateObject(WTFL, 814, 698, NO_OWNER); //Waterfall SetSkyParallax(1, 20, 0, 1, 0); //Sky move with Wind //Fog CreateObject(FOG_, 400, 1050, NO_OWNER); CreateObject(FOG_, 1200, 1050, NO_OWNER); CreateObject(FOG_, 2000, 1050, NO_OWNER); //static drafts var DraftWaterfall = CreateObject(DRFT, 760, 780, NO_OWNER); DraftWaterfall -> SetPermanent(); DraftWaterfall -> SetR(-10); var MIsleL = CreateObject(DRFT, 992, 749, NO_OWNER); MIsleL -> SetPermanent(); MIsleL -> SetR(-12); var MIsleR = CreateObject(DRFT, 1095, 780, NO_OWNER); MIsleR -> SetPermanent(); MIsleR -> SetR(12); var IsleR = CreateObject(DRFT, 1310, 764, NO_OWNER); IsleR -> SetPermanent(); IsleR -> SetR(-12); var IsleM = CreateObject(DRFT, 1060, 670, NO_OWNER); IsleM -> SetPermanent(); //thousands of vines! PlaceVines(); //mass epic wood PlaceWood(); // Island Respawn PeriodicIslandRespawn(1993, 140, 750, 330, 250); // left 'home' island PeriodicIslandRespawn(2007, 1620, 730, 310, 250); // right 'home' island }
func InitializePlayer(int plr) { // Create buildings the_elevator = CreateConstruction(ELEV,165,110,0,80,1); valley_cata = CreateObject(CATA,240,387,0); hill_cata = CreateObject(CATA,540,247,0); valley_wood = CreateObject(WOOD,280,390,NO_OWNER); CreateObject(METL,285,390,NO_OWNER); // Remember clonks constructor_clnk = GetCrew(plr,0); valley_clnk = GetCrew(plr,1); catapult_clnk = GetCrew(plr,2); // Move valley and catapult clonk Exit(valley_clnk,230,390); Exit(catapult_clnk,520,250); // Prevent constructor and catapult clonks from falling down var hr = AddEffect("StayNearElev", constructor_clnk, 1, 30, 0, 0, 0, 0, 0, 0); AddEffect("StayNearCata", catapult_clnk, 1, 30); // Message and control positioning SetPlrShowControlPos(plr, SHOWCTRLPOS_Top); SetTutorialMessagePos(MSG_Bottom | MSG_Left | MSG_XRel | MSG_WidthRel, 10, -10, 35); // Start script ScriptGo(1); return true; }
func CreateContructionNear(id def, int x, int y, int owner) { Var(0)=x; Var(1)=y; if (!FindConstructionSite(def, 0,1)) return 0; x=Var(0); y=Var(1); return CreateConstruction(def, x,y, owner, 100, true); }
func CreateStartMaterial(int x, int y, int plr) { var pltf1 = PLTF->CreatePlatform(x, y, plr); var pltf2 = PLTF->CreatePlatform(x + 20, y, plr); PLTF->Connect(pltf1, pltf2); var team = GetPlayerTeam(plr), ox, tankX = x; if(team == 1) { tankX += 10; ox = 1; } else { tankX += 95; ox = -1; } CreateConstruction(STMT, tankX, y - 5, plr, 100); var artillery = CreateConstruction(CTW0, tankX + ox * 90, y - 5, plr, 100); artillery->ConnectCannon(CreateObject(CTW3, 0, 0, plr)); }
protected func Initialize() { // Spielziele setzen FindObject(CROB)->AddType(CST3, 1); FindObject(CROB)->AddType(TWR2, 2); FindObject(CROB)->AddType(HUT3, 6); FindObject(CROB)->SetMissionAccess("NewLand"); // Einzelne Hütte erzeugen CreateConstruction(HUT2, 1070, 330, -1, 100, 1); return 1; }
func Initialize() { // Always have some music Music("Frontend", 1); MusicLevel(30); // Create lens flare CreateObject(LENS, 70, 50, NO_OWNER); // Place hut CreateConstruction(HUT2,580,180,NO_OWNER,100,1); // Create goal CreateObject(SCRG, 50,50, NO_OWNER); // Start script ScriptGo(true); // Evaluation dialog options SetNextMission("Tutorial.c4f\\Tutorial01.c4s", "$BtnRepeatRound$", "$BtnRepeatRoundDesc$"); return true; }
global func FixElevator(object elev, iDig) { var fBurned = GetID(elev)==ELVB; var x=GetX(elev), y=GetDefBottom(elev); elev->RemoveObject(); elev = CreateConstruction(ELEV, x,y, -1, 100, true); // Fürs Fundament... elev->CreateShaft(iDig); AddEffect("NoEnergyNeed", elev, 1, 1); if(!fBurned) elev->GetActionTarget()->SetComDir(COMD_Down); else { RemoveObject(LocalN("pCase", elev)); elev->ChangeDef(ELVB); SetCategory(1, elev); SetObjectLayer(elev, elev); SetCon(100, elev); AddEffect("Rebuild", elev, 1, 1); } }
func InitializePlayer(player) { var x = 20 + Random(LandscapeWidth() - 40); while(FindObject2(Find_InRect(x-30, 0, 60, LandscapeHeight()), Find_Category (C4D_Structure))) { x = Random(LandscapeWidth()); } // Find a goot spot var miny = (4*LandscapeHeight())/10; var spawnpoint = findSpawnPoint(miny); // Place player and hut there var hut = CreateConstruction(HUT2, spawnpoint[0], spawnpoint[1],player,100,1); SetPosition(spawnpoint[0] - 5, spawnpoint[1]-8, GetCrew(player,0)); // Amboss drüberklatschen hut->CreateObject(ANVL, 17, 23); hut->CreateContents(FLAG); }