Use CreateObject() in scripts (#1214)

Objects with id Rule_*, Goal_*, and Environment_* are created with CreateObject() now.
issue1247
Mark 2015-01-10 17:56:54 +01:00
parent 850bf1b9d4
commit d7a88eea62
53 changed files with 136 additions and 136 deletions

View File

@ -9,9 +9,9 @@
protected func Initialize()
{
// Environment
CreateObjectAbove(Rule_ObjectFade)->DoFadeTime(10 * 36);
CreateObjectAbove(Environment_Celestial);
var time=CreateObjectAbove(Environment_Time);
CreateObject(Rule_ObjectFade)->DoFadeTime(10 * 36);
CreateObject(Environment_Celestial);
var time=CreateObject(Environment_Time);
time->SetTime();
time->SetCycleSpeed();
FindObject(Find_ID(Moon))->SetMoonPhase(3);
@ -19,10 +19,10 @@ protected func Initialize()
FindObject(Find_ID(Moon))->SetPosition(LandscapeWidth()/2,150);
// Goal: Capture the flag, with bases in both hideouts.
var goal = CreateObjectAbove(Goal_CaptureTheFlag, 0, 0, NO_OWNER);
var goal = CreateObject(Goal_CaptureTheFlag, 0, 0, NO_OWNER);
goal->SetFlagBase(1, 135, 266);
goal->SetFlagBase(2, LandscapeWidth() - 135, 266);
CreateObjectAbove(Rule_KillLogs);
CreateObject(Rule_KillLogs);
var gate = CreateObjectAbove(StoneDoor, 345, 272, NO_OWNER);
gate->SetClrModulation(RGB(140,185,255));

View File

@ -13,15 +13,15 @@ protected func Initialize()
PlaceGrass(185);
// Goal: Capture the flag, with bases in both hideouts.
var goal = CreateObjectAbove(Goal_CaptureTheFlag, 0, 0, NO_OWNER);
var goal = CreateObject(Goal_CaptureTheFlag, 0, 0, NO_OWNER);
goal->SetFlagBase(1, 120, 506);
goal->SetFlagBase(2, LandscapeWidth() - 120, 506);
// Rules
CreateObjectAbove(Rule_Restart);
CreateObjectAbove(Rule_ObjectFade)->DoFadeTime(5 * 36);
CreateObjectAbove(Rule_KillLogs);
CreateObjectAbove(Rule_Gravestones);
CreateObject(Rule_Restart);
CreateObject(Rule_ObjectFade)->DoFadeTime(5 * 36);
CreateObject(Rule_KillLogs);
CreateObject(Rule_Gravestones);
var lwidth = LandscapeWidth();

View File

@ -10,14 +10,14 @@
protected func Initialize()
{
// Goal.
var goal = CreateObjectAbove(Goal_KingOfTheHill, 555, 250, NO_OWNER);
var goal = CreateObject(Goal_KingOfTheHill, 555, 250, NO_OWNER);
goal->SetRadius(80);
goal->SetPointLimit(6);
AddEffect("BlessTheKing",goal,100,1,nil);
// Objects fade after 7 seconds.
CreateObjectAbove(Rule_ObjectFade)->DoFadeTime(7 * 36);
CreateObjectAbove(Rule_KillLogs);
CreateObjectAbove(Rule_Gravestones);
CreateObject(Rule_ObjectFade)->DoFadeTime(7 * 36);
CreateObject(Rule_KillLogs);
CreateObject(Rule_Gravestones);
//make lava collapse
CreateObjectAbove(Firestone,625,480);

View File

@ -11,9 +11,9 @@ static Overcast_air_particles;
protected func Initialize()
{
// Goal.
CreateObjectAbove(Goal_LastManStanding);
CreateObjectAbove(Rule_KillLogs);
CreateObjectAbove(Rule_Gravestones);
CreateObject(Goal_LastManStanding);
CreateObject(Rule_KillLogs);
CreateObject(Rule_Gravestones);
//Enviroment.
Cloud->Place(25);

View File

@ -9,9 +9,9 @@
protected func Initialize()
{
// Goal and rules.
CreateObjectAbove(Goal_LastManStanding, 0, 0, NO_OWNER);
CreateObjectAbove(Rule_KillLogs);
CreateObjectAbove(Rule_Gravestones);
CreateObject(Goal_LastManStanding, 0, 0, NO_OWNER);
CreateObject(Rule_KillLogs);
CreateObject(Rule_Gravestones);
// Chests with weapons.
var chest = CreateObjectAbove(Chest, 108, 248);
@ -19,7 +19,7 @@ protected func Initialize()
AddEffect("IntFillChests", nil, 100, 36, nil, nil, chest);
// Objects fade after 7 seconds.
CreateObjectAbove(Rule_ObjectFade)->DoFadeTime(7 * 36);
CreateObject(Rule_ObjectFade)->DoFadeTime(7 * 36);
// Some decoration trunks ranks and a waterfall.
var trunk = CreateObjectAbove(Trunk, 76, 324);

View File

@ -10,9 +10,9 @@ static const RUINS_RAIN_PERIOD_TIME=3200;
protected func Initialize()
{
// Goal.
CreateObjectAbove(Goal_LastManStanding, 0, 0, NO_OWNER);
CreateObjectAbove(Rule_KillLogs);
CreateObjectAbove(Rule_Gravestones);
CreateObject(Goal_LastManStanding, 0, 0, NO_OWNER);
CreateObject(Rule_KillLogs);
CreateObject(Rule_Gravestones);
// Mood.
SetSkyAdjust(RGBa(255, 255, 255, 127), RGB(255, 200, 150));
@ -31,7 +31,7 @@ protected func Initialize()
CreateObjectAbove(Ropeladder, 135, 135, NO_OWNER)->Unroll(1,0,16);
// Objects fade after 5 seconds.
CreateObjectAbove(Rule_ObjectFade)->DoFadeTime(5 * 36);
CreateObject(Rule_ObjectFade)->DoFadeTime(5 * 36);
// Smooth brick edges.
var x=[188, 205, 261, 244, 308, 325];

View File

@ -12,12 +12,12 @@ protected func Initialize()
SetMatAdjust(RGB(255,150,128));
// Goal.
CreateObjectAbove(Goal_DeathMatch, 0, 0, NO_OWNER);
CreateObjectAbove(Rule_KillLogs);
CreateObjectAbove(Rule_Gravestones);
CreateObject(Goal_DeathMatch, 0, 0, NO_OWNER);
CreateObject(Rule_KillLogs);
CreateObject(Rule_Gravestones);
//Enviroment.
CreateObjectAbove(Rule_ObjectFade)->DoFadeTime(10 * 36);
CreateObject(Rule_ObjectFade)->DoFadeTime(10 * 36);
SetSkyAdjust(RGB(255,128,0));
SetSkyParallax(1, 20,20, 0,0, nil, nil);
CreateObjectAbove(Column,160,304)->SetClrModulation(RGB(255,100,80));

View File

@ -11,13 +11,13 @@ static ThunderousSkies_air_particles, ThunderousSkies_air_particles_red;
protected func Initialize()
{
// Goal.
CreateObjectAbove(Rule_ObjectFade)->DoFadeTime(8 * 36);
var goal = CreateObjectAbove(Goal_KingOfTheHill, 450, 380, NO_OWNER);
CreateObject(Rule_ObjectFade)->DoFadeTime(8 * 36);
var goal = CreateObject(Goal_KingOfTheHill, 450, 380, NO_OWNER);
goal->SetRadius(90);
goal->SetPointLimit(5);
AddEffect("BlessTheKing",goal,100,1,nil);
CreateObjectAbove(Rule_KillLogs);
CreateObjectAbove(Rule_Gravestones);
CreateObject(Rule_KillLogs);
CreateObject(Rule_Gravestones);
//Enviroment.
//SetSkyAdjust(RGBa(250,250,255,128),RGB(200,200,220));

View File

@ -24,7 +24,7 @@ func Initialize()
CreateObjectAbove(WindGenerator, 1081, 873+offs)->SetR(18);
CreateObjectAbove(WindGenerator, 858, 930+offs)->SetR(-10);
CreateObjectAbove(Goal_SaveTheWindmills,10,10);
CreateObject(Goal_SaveTheWindmills,10,10);
PlaceGrass(100, 800, 1400);
SetSkyParallax(0,25,25,0,0,0,50);
AddEffect("BoomAttack", nil, 100, 35);

View File

@ -12,7 +12,7 @@ static is_initialized;
func Initialize()
{
// Goal: Script goal.
var goal = CreateObjectAbove(Goal_Script);
var goal = CreateObject(Goal_Script);
goal.Description = "$GoalDesc1$";
// Vegetation

View File

@ -15,11 +15,11 @@ func InitializeObjects()
CreateObjectAbove(Trunk, 1924, 272);
CreateObjectAbove(Rule_TeamAccount, 50, 40);
CreateObject(Rule_TeamAccount, 50, 40);
CreateObjectAbove(Rule_BuyAtFlagpole, 50, 40);
CreateObject(Rule_BuyAtFlagpole, 50, 40);
var Goal_AcidDrilling0036 = CreateObjectAbove(Goal_AcidDrilling, 0, -10);
var Goal_AcidDrilling0036 = CreateObject(Goal_AcidDrilling, 0, -10);
Goal_AcidDrilling0036->SetBasinPosition(2338, 250);
var Chest0040 = CreateObjectAbove(Chest, 71, 222);

View File

@ -6,7 +6,7 @@ func InitializeObjects()
CreateObjectAbove(Grass, 533, 550);
CreateObjectAbove(Grass, 1306, 706);
var Rule_BaseRespawn001 = CreateObjectAbove(Rule_BaseRespawn, 0, 0);
var Rule_BaseRespawn001 = CreateObject(Rule_BaseRespawn, 0, 0);
Rule_BaseRespawn001->SetInventoryTransfer(true);
Rule_BaseRespawn001->SetFreeCrew(true);

View File

@ -13,8 +13,8 @@ func DoInit(int first_player)
// Set time of day to evening and create some clouds and celestials.
Cloud->Place(20);
CreateObjectAbove(Environment_Celestial);
var time = CreateObjectAbove(Environment_Time);
CreateObject(Environment_Celestial);
var time = CreateObject(Environment_Time);
time->SetTime(600);
time->SetCycleSpeed(20);
// Waterfall
@ -24,10 +24,10 @@ func DoInit(int first_player)
if (windmill) windmill->SetOwner(first_player);
// Goal
CreateObjectAbove(Goal_Plane);
CreateObject(Goal_Plane);
// Rules
CreateObjectAbove(Rule_TeamAccount, 50, 50);
CreateObject(Rule_TeamAccount, 50, 50);
// NPC: Merchant.
var merchant = CreateObjectAbove(Clonk, 76, 870);

View File

@ -11,7 +11,7 @@ func InitializeObjects()
var Grass003 = CreateObjectAbove(Grass, 228, 1180);
Grass003->SetClrModulation(0xffa08060);
var Rule_BaseRespawn001 = CreateObjectAbove(Rule_BaseRespawn, 0, 0);
var Rule_BaseRespawn001 = CreateObject(Rule_BaseRespawn, 0, 0);
Rule_BaseRespawn001->SetInventoryTransfer(true);
Rule_BaseRespawn001->SetFreeCrew(true);
@ -121,12 +121,12 @@ func InitializeObjects()
S2AI->SetEncounterCB(g_king, "EncounterKing");
g_king->SetDir(DIR_Left);
var Goal_Assassination001 = CreateObjectAbove(Goal_Assassination, 0, 0);
var Goal_Assassination001 = CreateObject(Goal_Assassination, 0, 0);
Goal_Assassination001->SetVictim(g_king);
CreateObjectAbove(Rule_TeamAccount, 0, 0);
CreateObject(Rule_TeamAccount, 0, 0);
CreateObjectAbove(Rule_NoPowerNeed, 0, 0);
CreateObject(Rule_NoPowerNeed, 0, 0);
var LargeCaveMushroom005 = CreateObjectAbove(LargeCaveMushroom, 1334, 1459);
LargeCaveMushroom005->SetClrModulation(0xffd0dbdf);

View File

@ -4,14 +4,14 @@ func Initialize()
{
// Goal
var goal = FindObject(Find_ID(Goal_RepairStatue));
if (!goal) goal = CreateObjectAbove(Goal_RepairStatue);
if (!goal) goal = CreateObject(Goal_RepairStatue);
var statue = CreateObjectAbove(MinersStatue, 600,736);
statue->SetBroken();
var statue_head = CreateObjectAbove(MinersStatue_Head, 2200,560);
goal->SetStatue(statue);
// Rules
if (!ObjectCount(Find_ID(Rule_TeamAccount))) CreateObjectAbove(Rule_TeamAccount);
if (!ObjectCount(Find_ID(Rule_BuyAtFlagpole))) CreateObjectAbove(Rule_BuyAtFlagpole);
if (!ObjectCount(Find_ID(Rule_TeamAccount))) CreateObject(Rule_TeamAccount);
if (!ObjectCount(Find_ID(Rule_BuyAtFlagpole))) CreateObject(Rule_BuyAtFlagpole);
// Mushrooms before any earth materials, because they create their own caves
LargeCaveMushroom->Place(15, Rectangle(100,0,600,300));
// Create earth materials

View File

@ -4,13 +4,13 @@ static g_goal, g_object_fade, g_statue, g_doorleft, g_doorright;
func InitializeObjects()
{
CreateObjectAbove(Rule_BuyAtFlagpole, 0, 0);
CreateObjectAbove(Rule_TeamAccount, 0, 0);
CreateObject(Rule_BuyAtFlagpole, 0, 0);
CreateObject(Rule_TeamAccount, 0, 0);
g_goal = CreateObjectAbove(Goal_ProtectTheStatue, 0, 0);
g_goal = CreateObject(Goal_ProtectTheStatue, 0, 0);
g_goal.StaticSaveVar = "g_goal";
g_object_fade = CreateObjectAbove(Rule_ObjectFade, 0, 0);
g_object_fade = CreateObject(Rule_ObjectFade, 0, 0);
g_object_fade.StaticSaveVar = "g_object_fade";
g_statue = CreateObjectAbove(Idol, 632, 445);

View File

@ -4,10 +4,10 @@ func Initialize()
{
// Goal
var goal = FindObject(Find_ID(Goal_SellGems));
if (!goal) goal = CreateObjectAbove(Goal_SellGems);
if (!goal) goal = CreateObject(Goal_SellGems);
goal->SetTargetAmount(1);
// Rules
if (!ObjectCount(Find_ID(Rule_TeamAccount))) CreateObjectAbove(Rule_TeamAccount);
if (!ObjectCount(Find_ID(Rule_TeamAccount))) CreateObject(Rule_TeamAccount);
// Environment
var loc;
for (var i=0; i<5; ++i)

View File

@ -4,11 +4,11 @@ func Initialize()
{
// Goal
var goal = FindObject(Find_ID(Goal_SellGems));
if (!goal) goal = CreateObjectAbove(Goal_SellGems);
if (!goal) goal = CreateObject(Goal_SellGems);
goal->SetTargetAmount(30);
// Rules
if (!ObjectCount(Find_ID(Rule_TeamAccount))) CreateObjectAbove(Rule_TeamAccount);
if (!ObjectCount(Find_ID(Rule_BuyAtFlagpole))) CreateObjectAbove(Rule_BuyAtFlagpole);
if (!ObjectCount(Find_ID(Rule_TeamAccount))) CreateObject(Rule_TeamAccount);
if (!ObjectCount(Find_ID(Rule_BuyAtFlagpole))) CreateObject(Rule_BuyAtFlagpole);
// Environment
SetSkyParallax(1, 20,20, 0,0, nil, nil);
return true;

View File

@ -153,11 +153,11 @@ func InitializeObjects()
CreateObjectAbove(Tree_Coniferous, 1756, 370);
CreateObjectAbove(Tree_Coniferous, 1673, 375);
CreateObjectAbove(Rule_TeamAccount, 50, 50);
CreateObject(Rule_TeamAccount, 50, 50);
CreateObjectAbove(Rule_BuyAtFlagpole, 50, 50);
CreateObject(Rule_BuyAtFlagpole, 50, 50);
CreateObjectAbove(Rule_BuyAtFlagpole, 50, 50);
CreateObject(Rule_BuyAtFlagpole, 50, 50);
var Chest0224 = CreateObjectAbove(Chest, 534, 543);
var Chest0225 = CreateObjectAbove(Chest, 279, 585);

View File

@ -8,7 +8,7 @@ static g_is_initialized;
func DoInit(int first_player)
{
var goal = CreateObjectAbove(Goal_ElevatorEnergy);
var goal = CreateObject(Goal_ElevatorEnergy);
var elevator = FindObject(Find_ID(Elevator));
goal->SetTarget(elevator.case);

View File

@ -112,7 +112,7 @@ func InitializeObjects()
CreateObjectAbove(Fern, 75, 1102);
CreateObjectAbove(Rule_NoPowerNeed, 0, 0);
CreateObject(Rule_NoPowerNeed, 0, 0);
var Chest0156 = CreateObjectAbove(Chest, 55, 1308);
CreateObjectAbove(Chest, 1381, 534);

View File

@ -9,15 +9,15 @@ static g_is_initialized;
func Initialize()
{
if(!ObjectCount(Find_ID(Rule_NoPowerNeed))) CreateObjectAbove(Rule_NoPowerNeed, 0, 0, NO_OWNER);
if(!ObjectCount(Find_ID(Rule_NoPowerNeed))) CreateObject(Rule_NoPowerNeed, 0, 0, NO_OWNER);
}
func DoInit(int first_player)
{
// Set time of day to morning and create some clouds and celestials.
Cloud->Place(20);
CreateObjectAbove(Environment_Celestial);
var time = CreateObjectAbove(Environment_Time);
CreateObject(Environment_Celestial);
var time = CreateObject(Environment_Time);
time->SetTime(400);
time->SetCycleSpeed(6);
@ -26,7 +26,7 @@ func DoInit(int first_player)
if (workshop) workshop->SetOwner(first_player);
// Goal
CreateObjectAbove(Goal_GetBack);
CreateObject(Goal_GetBack);
return true;
}

View File

@ -4,16 +4,16 @@ static g_chemical, g_cabin, g_sawmill, g_workshop, g_flagpole, g_windmill, npc_n
func InitializeObjects()
{
var Rule_BaseRespawn01 = CreateObjectAbove(Rule_BaseRespawn, 0, 0);
var Rule_BaseRespawn01 = CreateObject(Rule_BaseRespawn, 0, 0);
Rule_BaseRespawn01->SetInventoryTransfer(true);
Rule_BaseRespawn01->SetFreeCrew(true);
CreateObjectAbove(Grass, 1121, 429);
CreateObjectAbove(Grass, 1185, 444);
CreateObjectAbove(Rule_NoPowerNeed, 0, 0);
CreateObject(Rule_NoPowerNeed, 0, 0);
CreateObjectAbove(Rule_TeamAccount, 0, 0);
CreateObject(Rule_TeamAccount, 0, 0);
CreateObjectAbove(EnvPack_Scarecrow, 1218, 440);

View File

@ -33,7 +33,7 @@ func Initialize()
func DoInit(int first_player)
{
StartSequence("Intro", 0, GetCrew(first_player));
//g_goal = CreateObjectAbove(Goal_Raid);
//g_goal = CreateObject(Goal_Raid);
// Prepare trigger for attack sequence
for (var tree in FindObjects(Find_Func("IsTree")))
{

View File

@ -106,7 +106,7 @@ func Intro_9()
func Intro_Stop()
{
npc_newton.has_sequence = false; // continue hammering
g_goal = CreateObjectAbove(Goal_Raid);
g_goal = CreateObject(Goal_Raid);
SetPlayerZoomByViewRange(NO_OWNER, 400,300, PLRZOOM_Set | PLRZOOM_LimitMax);
return true;
}

View File

@ -2,9 +2,9 @@
func InitializeObjects()
{
CreateObjectAbove(Rule_TeamAccount, 50, 50);
CreateObject(Rule_TeamAccount, 50, 50);
CreateObjectAbove(Rule_BuyAtFlagpole, 50, 50);
CreateObject(Rule_BuyAtFlagpole, 50, 50);
CreateObjectAbove(Tree_Coniferous, 962, 839);
CreateObjectAbove(Tree_Coniferous, 774, 951);

View File

@ -24,7 +24,7 @@ func DoInit(int first_player)
time->SetTime(600);
time->SetCycleSpeed(20);
// Goal
CreateObjectAbove(Goal_Plane);
CreateObject(Goal_Plane);
// Plane part restore
for (var part in FindObjects(Find_Func("IsPlanePart"))) part->AddRestoreMode();
return true;

View File

@ -4,7 +4,7 @@ static npc_dagobert, npc_tarzan, g_golden_shovel, g_flagpole;
func InitializeObjects()
{
var Rule_BaseRespawn001 = CreateObjectAbove(Rule_BaseRespawn, 0, 0);
var Rule_BaseRespawn001 = CreateObject(Rule_BaseRespawn, 0, 0);
Rule_BaseRespawn001->SetInventoryTransfer(true);
Rule_BaseRespawn001->SetFreeCrew(true);
@ -25,9 +25,9 @@ func InitializeObjects()
var Chest0009 = CreateObjectAbove(Chest, 1002, 313);
Chest0009.Plane = 50;
CreateObjectAbove(Rule_TeamAccount, 0, 0);
CreateObject(Rule_TeamAccount, 0, 0);
CreateObjectAbove(Rule_NoPowerNeed, 0, 0);
CreateObject(Rule_NoPowerNeed, 0, 0);
var LargeCaveMushroom0013 = CreateObjectAbove(LargeCaveMushroom, 1308, 1038);
LargeCaveMushroom0013->SetClrModulation(0xffe4effc);

View File

@ -175,6 +175,6 @@ func Intro_Stop()
this.dialogue->AddAttention();
this.dialogue->Dlg_Pyrit_StartHammering(npc_pyrit);
SetPlayerZoomByViewRange(NO_OWNER, 400,300, PLRZOOM_Set);
g_goal = CreateObjectAbove(Goal_TreasureHunt, 0, 0);
g_goal = CreateObject(Goal_TreasureHunt, 0, 0);
return true;
}

View File

@ -179,7 +179,7 @@ protected func Destruction()
var base = FindObject(Find_ID(Goal_FlagBase), Find_Func("FindTeam", GetTeam()));
if (base)
{
var flag = CreateObjectAbove(Goal_Flag, 0, 0, GetOwner());
var flag = CreateObject(Goal_Flag, 0, 0, GetOwner());
flag->SetTeam(GetTeam());
SetAction("AttachBase", base);
Log("$MsgFlagRestored$", GetTaggedTeamName(team));

View File

@ -41,9 +41,9 @@ private func GetScoreGoal()
public func SetFlagBase(int team, int x, int y)
{
var base = CreateObjectAbove(Goal_FlagBase, x, y, NO_OWNER);
var base = CreateObject(Goal_FlagBase, x, y, NO_OWNER);
base->SetTeam(team);
var flag = CreateObjectAbove(Goal_Flag, x, y, NO_OWNER);
var flag = CreateObject(Goal_Flag, x, y, NO_OWNER);
flag->SetAction("AttachBase", base);
flag->SetTeam(team);
return;

View File

@ -27,7 +27,7 @@ protected func Initialize()
{
// Create melee goal if there isn't any.
//if (!ObjectCount(Find_ID(Goal_Melee)))
// CreateObjectAbove(Goal_Melee, 0, 0, NO_OWNER);
// CreateObject(Goal_Melee, 0, 0, NO_OWNER);
return _inherited(...);
}

View File

@ -42,7 +42,7 @@ protected func Initialize()
AddEffect("IntBestTime", this, 100, 1, this);
// Activate restart rule, if there isn't any.
if (!ObjectCount(Find_ID(Rule_Restart)))
CreateObjectAbove(Rule_Restart, 0, 0, NO_OWNER);
CreateObject(Rule_Restart, 0, 0, NO_OWNER);
// Scoreboard.
InitScoreboard();
return _inherited(...);

View File

@ -8,7 +8,7 @@
protected func Initialize()
{
// Create parkour goal & checkpoints.
var goal = CreateObjectAbove(Goal_Parkour, 0, 0, NO_OWNER);
var goal = CreateObject(Goal_Parkour, 0, 0, NO_OWNER);
var mode = PARKOUR_CP_Respawn | PARKOUR_CP_Check | PARKOUR_CP_Ordered;
goal->SetStartpoint(90, 820);
goal->AddCheckpoint(660, 580, mode);

View File

@ -11,7 +11,7 @@ func Initialize()
Cloud->Place(40);
// Create the parkour goal.
var goal = CreateObjectAbove(Goal_Parkour, 0, 0, NO_OWNER);
var goal = CreateObject(Goal_Parkour, 0, 0, NO_OWNER);
var mode = PARKOUR_CP_Respawn | PARKOUR_CP_Ordered | PARKOUR_CP_Team;
goal->SetStartpoint(20, 1000);
goal->AddCheckpoint(760, 950, mode);

View File

@ -11,7 +11,7 @@
protected func Initialize()
{
// Parkour goal: direction bottom left to upper right.
var goal = CreateObjectAbove(Goal_Parkour, 0, 0, NO_OWNER);
var goal = CreateObject(Goal_Parkour, 0, 0, NO_OWNER);
// Start at bottom left corner of the map.
var sx = 80, sy = LandscapeHeight() - 350;
goal->SetStartpoint(sx, sy);

View File

@ -8,7 +8,7 @@
protected func Initialize()
{
// Create the parkour goal.
var goal = CreateObjectAbove(Goal_Parkour, 0, 0, NO_OWNER);
var goal = CreateObject(Goal_Parkour, 0, 0, NO_OWNER);
// Set start point.
var x, y, pos;
var d = 100;

View File

@ -92,7 +92,7 @@ protected func Initialize()
var is_cooperative = (SCENPAR_Goal == 1);
var starting_cave = g_caves[0];
var goal = FindObject(Find_ID(Goal_RubyHunt));
if (!goal) goal = CreateObjectAbove(Goal_RubyHunt);
if (!goal) goal = CreateObject(Goal_RubyHunt);
goal->SetPosition();
goal->SetGoalRect(Rectangle(0, starting_cave.Y-40, starting_cave.X-20, 40));
goal->SetCooperative(is_cooperative);

View File

@ -9,7 +9,7 @@
protected func Initialize()
{
// Parkour goal: from bottom to top.
var goal = CreateObjectAbove(Goal_Parkour, 0, 0, NO_OWNER);
var goal = CreateObject(Goal_Parkour, 0, 0, NO_OWNER);
// Start at bottom of the map.
var sx = LandscapeWidth() / 2, sy = LandscapeHeight() - 120;
goal->SetStartpoint(sx, sy);
@ -48,7 +48,7 @@ protected func Initialize()
/* --Environmental Effects-- */
// Time
var time = CreateObjectAbove(Environment_Time);
var time = CreateObject(Environment_Time);
time->SetCycleSpeed(0);
time->SetTime(900);

View File

@ -12,7 +12,7 @@ protected func Initialize()
{
// Create the parkour goal.
var goal = FindObject(Find_ID(Goal_Parkour));
if (!goal) goal = CreateObjectAbove(Goal_Parkour, 0, 0, NO_OWNER);
if (!goal) goal = CreateObject(Goal_Parkour, 0, 0, NO_OWNER);
if (!LavaParkour_AllowRespawn) goal->DisableRespawnHandling();
// Set start point.
goal->SetStartpoint(LandscapeWidth()*2/5, LandscapeHeight()*97/100);

View File

@ -12,7 +12,7 @@ protected func Initialize()
var w = LandscapeWidth(), h = LandscapeHeight();
// Create the parkour goal.
var goal = FindObject(Find_ID(Goal_Parkour));
if (!goal) goal = CreateObjectAbove(Goal_Parkour, 0, 0, NO_OWNER);
if (!goal) goal = CreateObject(Goal_Parkour, 0, 0, NO_OWNER);
goal->DisableRespawnHandling();
// Set start and finish point.
goal->SetStartpoint(w*2/5, h*93/100);

View File

@ -12,7 +12,7 @@ static flint_chest; // chest containing flints
protected func Initialize()
{
// Tutorial goal.
var goal = CreateObjectAbove(Goal_ReachFlag, 0, 0, NO_OWNER);
var goal = CreateObject(Goal_ReachFlag, 0, 0, NO_OWNER);
goal->CreateGoalFlag(2330, 1040);
// Environment.

View File

@ -11,7 +11,7 @@ static guide; // guide object.
protected func Initialize()
{
// Create goal, all crew members should reach the flag on the far right side.
var goal = CreateObjectAbove(Goal_ReachFlag, 0, 0, NO_OWNER);
var goal = CreateObject(Goal_ReachFlag, 0, 0, NO_OWNER);
goal->CreateGoalFlag(2950, 280);
// Create all objects, vehicles, chests used by the player.

View File

@ -14,7 +14,7 @@ protected func Initialize()
PlaceGrass(85);
// Goal: flag goal also checks if all targets are destroyed.
var goal = CreateObjectAbove(Goal_ReachFlag, 0, 0, NO_OWNER);
var goal = CreateObject(Goal_ReachFlag, 0, 0, NO_OWNER);
goal->CreateGoalFlag(2230, 292);
// A chest with javelins.

View File

@ -13,14 +13,14 @@ protected func Initialize()
// Environment
PlaceGrass(85);
Cloud->Place(15);
CreateObjectAbove(Environment_Celestial);
var time = CreateObjectAbove(Environment_Time);
CreateObject(Environment_Celestial);
var time = CreateObject(Environment_Time);
time->SetTime(22*60);
time->SetCycleSpeed(0);
Sound("WindLoop", true, 40, nil, 1);
// Goal: Melee, all opponents must be killed.
CreateObjectAbove(Goal_Melee, 0, 0, NO_OWNER);
CreateObject(Goal_Melee, 0, 0, NO_OWNER);
// First section: Some straw targets to be struck with the sword.
CreateObjectAbove(SwordTarget, 190, 673, NO_OWNER)->SetR(RandomX(-10, 10));

View File

@ -10,10 +10,10 @@ protected func Initialize()
{
// Goal
var goal = FindObject(Find_ID(Goal_Wealth));
if (!goal) goal = CreateObjectAbove(Goal_Wealth);
if (!goal) goal = CreateObject(Goal_Wealth);
goal->SetWealthGoal(200); // updated in InitializePlayer
// Rules
if (!ObjectCount(Find_ID(Rule_TeamAccount))) CreateObjectAbove(Rule_TeamAccount);
if (!ObjectCount(Find_ID(Rule_TeamAccount))) CreateObject(Rule_TeamAccount);
// Acid rain!
Cloud->Place(10);
Cloud->SetPrecipitation("Acid", 100);
@ -25,8 +25,8 @@ protected func Initialize()
Volcano->SetMaterial("DuroLava");
Meteor->SetChance(22);
// We aren't doing much outside anyway; celestials are a bit of a waste
/*CreateObjectAbove(Environment_Celestial);
var time = CreateObjectAbove(Environment_Time);
/*CreateObject(Environment_Celestial);
var time = CreateObject(Environment_Time);
time->SetTime(60*12);
time->SetCycleSpeed(20);*/
// Starting materials in lorry

View File

@ -17,11 +17,11 @@ static g_start_x, g_start_y;
protected func Initialize()
{
// Goal: Ruby mine
var goal = CreateObjectAbove(Goal_SellGems);
var goal = CreateObject(Goal_SellGems);
goal->SetTargetAmount(BoundBy(SCENPAR_Difficulty*10, 10, 20));
// Rules: team account and buying at flagpole.
CreateObjectAbove(Rule_TeamAccount);
CreateObjectAbove(Rule_BuyAtFlagpole);
CreateObject(Rule_TeamAccount);
CreateObject(Rule_BuyAtFlagpole);
// Start position from map generation
var map_zoom = 6;

View File

@ -12,15 +12,15 @@ static intro_init;
protected func Initialize()
{
// Rules: team account and buying at flagpole.
CreateObjectAbove(Rule_TeamAccount);
CreateObjectAbove(Rule_BuyAtFlagpole);
CreateObject(Rule_TeamAccount);
CreateObject(Rule_BuyAtFlagpole);
// Goal: transport the cannon to the top of the chine.
var cannon = CreateObjectAbove(Cannon, 96 + RandomX(-12, 12), LandscapeHeight() - 92);
var keg = cannon->CreateContents(PowderKeg);
// Infinite ammo for this cannon.
keg->SetPowderCount(nil);
var cannon_goal = CreateObjectAbove(Goal_Script);
var cannon_goal = CreateObject(Goal_Script);
cannon_goal.Name = "$GoalName$";
cannon_goal.Description = "$GoalDesc$";
// Add an effect to check whether the goal is fulfilled.

View File

@ -16,11 +16,11 @@ static first_plr_init;
protected func Initialize()
{
// Rules: team account and buying at flagpole.
CreateObjectAbove(Rule_TeamAccount);
CreateObjectAbove(Rule_BuyAtFlagpole);
CreateObject(Rule_TeamAccount);
CreateObject(Rule_BuyAtFlagpole);
// Goal: Sell a certain amount of gems dependent on difficulty.
var goal = CreateObjectAbove(Goal_SellGems);
var goal = CreateObject(Goal_SellGems);
goal->SetTargetAmount(10 * SCENPAR_Difficulty);
// Initialize different parts of the scenario.

View File

@ -16,14 +16,14 @@
protected func Initialize()
{
// Rules: team account and buying at flagpole.
CreateObjectAbove(Rule_TeamAccount);
CreateObjectAbove(Rule_BuyAtFlagpole);
CreateObject(Rule_TeamAccount);
CreateObject(Rule_BuyAtFlagpole);
// Goal: Sell Gems, amount depends on difficulty and initial availability.
var gems = (4 * GetMaterialCount(Material("Ruby"))) / (5 * GetMaterialVal("Blast2ObjectRatio", "Material", Material("Ruby")));
gems += (4 * GetMaterialCount(Material("Amethyst"))) / (5 * GetMaterialVal("Blast2ObjectRatio", "Material", Material("Amethyst")));
var percentage = 55 + 15 * SCENPAR_Difficulty;
var goal = CreateObjectAbove(Goal_SellGems);
var goal = CreateObject(Goal_SellGems);
goal->SetTargetAmount((gems * percentage) / 100);
// Initialize different parts of the scenario.
@ -91,8 +91,8 @@ protected func InitializePlayer(int plr)
private func InitEnvironment(int difficulty)
{
// Set time to almost night and have stars.
CreateObjectAbove(Environment_Celestial);
var time = CreateObjectAbove(Environment_Time);
CreateObject(Environment_Celestial);
var time = CreateObject(Environment_Time);
time->SetTime(20 * 60 + 15);
time->SetCycleSpeed(0);

View File

@ -12,19 +12,19 @@ static intro_init;
protected func Initialize()
{
// Rules: team account and buying at flagpole.
CreateObjectAbove(Rule_TeamAccount);
CreateObjectAbove(Rule_BuyAtFlagpole);
CreateObject(Rule_TeamAccount);
CreateObject(Rule_BuyAtFlagpole);
// Goal: Gain Wealth, amount depends on difficulty, though bounded by availability.
var gold = GetMaterialCount(Material("Gold")) / GetMaterialVal("Blast2ObjectRatio", "Material", Material("Gold"));
var percentage = 70 + 10 * SCENPAR_Difficulty;
var wealth_goal = Min(200 + 200 * SCENPAR_Difficulty, gold * 5 * percentage / 100);
var goal = CreateObjectAbove(Goal_Wealth);
var goal = CreateObject(Goal_Wealth);
goal->SetWealthGoal(wealth_goal);
// Second goal: Construct golden statue, amount depends on difficulty.
var statue_cnt = SCENPAR_Difficulty;
goal = CreateObjectAbove(Goal_Construction);
goal = CreateObject(Goal_Construction);
goal->AddConstruction(Idol, statue_cnt);
// Initialize different parts of the scenario.
@ -96,8 +96,8 @@ private func InitEnvironment()
// Set time of day to evening and create some clouds and celestials.
Cloud->Place(10);
Cloud->SetPrecipitation("Water", 8);
CreateObjectAbove(Environment_Celestial);
var time = CreateObjectAbove(Environment_Time);
CreateObject(Environment_Celestial);
var time = CreateObject(Environment_Time);
time->SetTime(60 * 12);
time->SetCycleSpeed(20);
return;

View File

@ -14,17 +14,17 @@ static intro_init;
protected func Initialize()
{
// Goal: Expand your area of influence to secure the ore.
var goal = CreateObjectAbove(Goal_Expansion);
var goal = CreateObject(Goal_Expansion);
goal->SetExpansionGoal(300 + 100 * SCENPAR_Difficulty);
// Second goal: Construct metal.
var metal_cnt = 10 + 10 * SCENPAR_Difficulty;
goal = CreateObjectAbove(Goal_Construction);
goal = CreateObject(Goal_Construction);
goal->AddConstruction(Metal, metal_cnt);
// Rules: team account and buying at flagpole.
CreateObjectAbove(Rule_TeamAccount);
CreateObjectAbove(Rule_BuyAtFlagpole);
CreateObject(Rule_TeamAccount);
CreateObject(Rule_BuyAtFlagpole);
// Initialize different parts of the scenario.
InitEnvironment(SCENPAR_Difficulty);
@ -108,8 +108,8 @@ private func InitEnvironment(int difficulty)
Cloud->Place(20);
Cloud->SetPrecipitation("Snow", 20 + 5 * difficulty);
CreateObjectAbove(Environment_Celestial);
var time = CreateObjectAbove(Environment_Time);
CreateObject(Environment_Celestial);
var time = CreateObject(Environment_Time);
time->SetTime(60 * 22);
time->SetCycleSpeed(0);

View File

@ -15,7 +15,7 @@ static intro_init;
protected func Initialize()
{
// Goal: construct an airplane and fill it with gold bars.
var goal = CreateObjectAbove(Goal_Script);
var goal = CreateObject(Goal_Script);
// Add an effect to check whether the goal is fulfilled.
var effect = AddEffect("GoalCheck", nil, 100, 2, nil);
effect.goal = goal;
@ -25,9 +25,9 @@ protected func Initialize()
goal.Description = Format("$GoalDesc$", effect.barcnt);
// Some rules.
CreateObjectAbove(Rule_TeamAccount);
CreateObjectAbove(Rule_BuyAtFlagpole);
CreateObjectAbove(Rule_StructureHPBars);
CreateObject(Rule_TeamAccount);
CreateObject(Rule_BuyAtFlagpole);
CreateObject(Rule_StructureHPBars);
// Rescale chasm exits.
var map_zoom = GetScenarioVal("MapZoom", "Landscape");
@ -113,8 +113,8 @@ private func InitEnvironment(int difficulty)
SetGamma(RGB(0, 0, 0), RGB(128 - dark, 128 - dark, 128 - dark), RGB(255 - 2 * dark, 255 - 2 * dark, 255 - 2 * dark));
// Time of days and celestials.
CreateObjectAbove(Environment_Celestial);
var time = CreateObjectAbove(Environment_Time);
CreateObject(Environment_Celestial);
var time = CreateObject(Environment_Time);
time->SetTime(60 * 20);
time->SetCycleSpeed(20);