From d515df6055428999faa8e4dd48816094dde5246b Mon Sep 17 00:00:00 2001 From: Maikel de Vries Date: Mon, 11 Apr 2011 18:08:57 +0200 Subject: [PATCH] Objects: Some fixes to cable network Removed some erroring code from the libraries. --- .../Libraries.ocd/Railway.ocd/CableCar.ocd/Script.c | 4 ++-- .../Railway.ocd/CableStation.ocd/DefCore.txt | 3 +++ .../CableStation.ocd}/GraphicsStation.8.png | Bin .../Railway.ocd/CableStation.ocd/Script.c | 6 +++--- .../Structures.ocd/ToolsWorkshop.ocd/Script.c | 6 +----- planet/Tests.ocf/CableLorrys.ocs/Script.c | 1 - 6 files changed, 9 insertions(+), 11 deletions(-) rename planet/{Tests.ocf/Experimental.ocd/Crossing.ocd => Objects.ocd/Libraries.ocd/Railway.ocd/CableStation.ocd}/GraphicsStation.8.png (100%) diff --git a/planet/Objects.ocd/Libraries.ocd/Railway.ocd/CableCar.ocd/Script.c b/planet/Objects.ocd/Libraries.ocd/Railway.ocd/CableCar.ocd/Script.c index 4cbe82694..dff14c39c 100644 --- a/planet/Objects.ocd/Libraries.ocd/Railway.ocd/CableCar.ocd/Script.c +++ b/planet/Objects.ocd/Libraries.ocd/Railway.ocd/CableCar.ocd/Script.c @@ -50,7 +50,7 @@ public func SetDestination(dest) { if(GetType(dest) == C4V_Int) { - dest = FindObjects(Find_ID(CableCrossing))[dest]; + dest = FindObjects(Find_Func("IsCableCrossing"))[dest]; } rail_destination = dest; if(rail_direction == 0) @@ -194,7 +194,7 @@ private func MoveTo(dest) { if(GetType(dest) == C4V_Int) { - dest = FindObjects(Find_ID(CableCrossing))[dest]; + dest = FindObjects(Find_Func("IsCableCrossing"))[dest]; } var rail = 0; for(var test_rail in FindObjects(Find_Func("IsConnectedTo", pRailTarget))) diff --git a/planet/Objects.ocd/Libraries.ocd/Railway.ocd/CableStation.ocd/DefCore.txt b/planet/Objects.ocd/Libraries.ocd/Railway.ocd/CableStation.ocd/DefCore.txt index d66f6cf8f..b5d934faf 100644 --- a/planet/Objects.ocd/Libraries.ocd/Railway.ocd/CableStation.ocd/DefCore.txt +++ b/planet/Objects.ocd/Libraries.ocd/Railway.ocd/CableStation.ocd/DefCore.txt @@ -2,4 +2,7 @@ id=Library_CableStation Version=4,10,0,0 Category=C4D_StaticBack +Width=20 +Height=20 +Offset=-10,-10 Picture=0,0,64,64 diff --git a/planet/Tests.ocf/Experimental.ocd/Crossing.ocd/GraphicsStation.8.png b/planet/Objects.ocd/Libraries.ocd/Railway.ocd/CableStation.ocd/GraphicsStation.8.png similarity index 100% rename from planet/Tests.ocf/Experimental.ocd/Crossing.ocd/GraphicsStation.8.png rename to planet/Objects.ocd/Libraries.ocd/Railway.ocd/CableStation.ocd/GraphicsStation.8.png diff --git a/planet/Objects.ocd/Libraries.ocd/Railway.ocd/CableStation.ocd/Script.c b/planet/Objects.ocd/Libraries.ocd/Railway.ocd/CableStation.ocd/Script.c index 60c045a5e..3ce1e992a 100644 --- a/planet/Objects.ocd/Libraries.ocd/Railway.ocd/CableStation.ocd/Script.c +++ b/planet/Objects.ocd/Libraries.ocd/Railway.ocd/CableStation.ocd/Script.c @@ -345,7 +345,7 @@ public func AddNeighboursToList() var obj; for(var i = 0; i < GetLength(aPath); i++) { - obj = aPath[i]->GetOtherConnection(this);//EffectVar(0,this(),aPath[i]); + obj = aPath[i]->~GetOtherConnection(this);//EffectVar(0,this(),aPath[i]); aConnectionList[i] = [obj, obj, ObjectDistance(obj)]; } } @@ -357,7 +357,7 @@ public func AddNeighboursList() var newList, obj, dist, pEnd; for(var i = 0; i < GetLength(aPath); i++) { - obj = aPath[i]->GetOtherConnection(this); + obj = aPath[i]->~GetOtherConnection(this); dist = ObjectDistance(obj); // Get aConnectionList from the next waypoint in line newList = obj->GetList(); @@ -467,7 +467,7 @@ private func CheckRailStation() { if (!is_station) { - SetGraphics("Station", CableCrossing, 2, GFXOV_MODE_Base); + SetGraphics("Station", Library_CableStation, 2, GFXOV_MODE_Base); is_station = true; } } diff --git a/planet/Objects.ocd/Structures.ocd/ToolsWorkshop.ocd/Script.c b/planet/Objects.ocd/Structures.ocd/ToolsWorkshop.ocd/Script.c index d75c00d80..d1e23b1d1 100644 --- a/planet/Objects.ocd/Structures.ocd/ToolsWorkshop.ocd/Script.c +++ b/planet/Objects.ocd/Structures.ocd/ToolsWorkshop.ocd/Script.c @@ -49,18 +49,16 @@ private func Produce(id item_id) if (IsProducing()) return false; // Start production. - var effect = AddEffect("Producing", this, 100, 1, this, nil, item_id); + AddEffect("Producing", this, 100, 1, this, nil, item_id); return true; } // Production effect: effect.ItemID is the item under production. protected func FxProducingStart(object target, proplist effect, int temp, id item_id) { - Log("%v", temp); if (temp) return 1; effect.ItemID = item_id; - Log("%v", effect.ItemID); // Remove raw materials, then commence production. var costs = ProductionCosts(item_id); for (var mat in costs) @@ -71,7 +69,6 @@ protected func FxProducingStart(object target, proplist effect, int temp, id ite protected func FxProducingTimer(object target, proplist effect, int time) { - Log("I am Producing%v", time); // Production already done? if (time > 150) // Replace me with something sensible. return -1; @@ -125,7 +122,6 @@ protected func SelectProduction(id item_id) private func Smoking() { - if (GetPhase()%3) return 1; if (Random(6)) Smoke(+16,-14,16); if (Random(8)) Smoke(10,-14,15+Random(3)); return 1; diff --git a/planet/Tests.ocf/CableLorrys.ocs/Script.c b/planet/Tests.ocf/CableLorrys.ocs/Script.c index 7802e9ddd..187d4b84e 100644 --- a/planet/Tests.ocf/CableLorrys.ocs/Script.c +++ b/planet/Tests.ocf/CableLorrys.ocs/Script.c @@ -21,7 +21,6 @@ protected func Initialize() CreateObject(CableLine, 191, 438)->SetConnectedObjects(cross7, cross4); //CreateObject(CableLine, 191, 438)->SetConnectedObjects(cross4, cross2); CreateObject(CableLine, 191, 438)->SetConnectedObjects(cross1, tools); - WaypointsMakeList(); cross1->CreateContents(Ore, 5); cross2->CreateContents(Coal, 8);