diff --git a/planet/Tests.ocf/RopeTest.ocs/MapBg.bmp b/planet/Tests.ocf/RopeTest.ocs/MapBg.bmp new file mode 100644 index 000000000..ead4c0641 Binary files /dev/null and b/planet/Tests.ocf/RopeTest.ocs/MapBg.bmp differ diff --git a/planet/Tests.ocf/RopeTest.ocs/MapFg.bmp b/planet/Tests.ocf/RopeTest.ocs/MapFg.bmp new file mode 100644 index 000000000..11fe87763 Binary files /dev/null and b/planet/Tests.ocf/RopeTest.ocs/MapFg.bmp differ diff --git a/planet/Tests.ocf/RopeTest.ocs/Scenario.txt b/planet/Tests.ocf/RopeTest.ocs/Scenario.txt new file mode 100644 index 000000000..3f7724824 --- /dev/null +++ b/planet/Tests.ocf/RopeTest.ocs/Scenario.txt @@ -0,0 +1,10 @@ +[Head] +Icon=2 +Title=RopeTest +Version=6,0 + +[Definitions] +Definition1=Objects.ocd + +[Player1] +Crew=Clonk=1 diff --git a/planet/Tests.ocf/RopeTest.ocs/Script.c b/planet/Tests.ocf/RopeTest.ocs/Script.c new file mode 100644 index 000000000..fcdb3f06d --- /dev/null +++ b/planet/Tests.ocf/RopeTest.ocs/Script.c @@ -0,0 +1,49 @@ +/** + Rope Test + Test scenario for the rope and all related objects. + + @author Maikel +*/ + + +public func Initialize() +{ + // Rope ladders at the start. + CreateObjectAbove(Ropeladder, 104, 40)->Unroll(1, 0, 12); + CreateObjectAbove(Ropeladder, 222, 40)->Unroll(1, -1, 12); + + // Ropebridge. + var post1 = CreateObjectAbove(Ropebridge_Post, 80, 152); + var post2 = CreateObjectAbove(Ropebridge_Post, 176, 152); + post2->SetObjDrawTransform(-1000, 0, 0, 0, 1000); + post2.Double->SetObjDrawTransform(-1000, 0, 0, 0, 1000); + CreateObjectAbove(Ropebridge, 140, 152)->MakeBridge(post1, post2); + + // Series of rope ladders. + CreateObjectAbove(Ropeladder, 292, 60)->Unroll(-1, COMD_Up); + CreateObjectAbove(Ropeladder, 332, 60)->Unroll(-1, COMD_Up); + CreateObjectAbove(Ropeladder, 372, 60)->Unroll(-1, COMD_Up); + CreateObjectAbove(Ropeladder, 412, 60)->Unroll(-1, COMD_Up); + CreateObjectAbove(Ropeladder, 452, 60)->Unroll(-1, COMD_Up); + CreateObjectAbove(Ropeladder, 492, 60)->Unroll(-1, COMD_Up); + + // Profile. + ProfileObject(Ropebridge); + ProfileObject(Ropeladder); + return; +} + +public func InitializePlayer(int plr) +{ + GetCrew(plr)->CreateContents(GrappleBow, 2); + GetCrew(plr)->CreateContents(Ropeladder); + return; +} + +global func ProfileObject(id def, int duration) +{ + if (duration == nil) + duration = 10; + StartScriptProfiler(def); + ScheduleCall(nil, "StopScriptProfiler", duration * 36, 0); +}