From 159dbf071fa88aceeb64dfad152fcc40a4fb81af Mon Sep 17 00:00:00 2001 From: Maikel de Vries Date: Mon, 8 Feb 2016 21:16:11 +0100 Subject: [PATCH] make ContactCalls a property instead of DefCore entry This allows for useful runtime changes, like disabling contact calls when an animal dies. --- docs/sdk/definition/cnat.xml | 2 +- docs/sdk/definition/defcore.xml | 5 ----- docs/sdk/definition/properties.xml | 5 +++++ .../Defense.ocf/FightForGidl.ocs/Boomattack.ocd/DefCore.txt | 1 - planet/Defense.ocf/FightForGidl.ocs/Boomattack.ocd/Script.c | 1 + .../Defense.ocf/Windmill.ocs/BigBoomattack.ocd/DefCore.txt | 1 - planet/Defense.ocf/Windmill.ocs/BigBoomattack.ocd/Script.c | 1 + planet/Defense.ocf/Windmill.ocs/Boomattack.ocd/DefCore.txt | 1 - planet/Defense.ocf/Windmill.ocs/Boomattack.ocd/Script.c | 3 ++- .../CableCars.ocd/Vehicles.ocd/Lorry.ocd/DefCore.txt | 1 - .../CableCars.ocd/Vehicles.ocd/Lorry.ocd/Script.c | 3 ++- planet/Objects.ocd/Animals.ocd/Bat.ocd/DefCore.txt | 1 - planet/Objects.ocd/Animals.ocd/Bat.ocd/Script.c | 1 + planet/Objects.ocd/Animals.ocd/Butterfly.ocd/DefCore.txt | 1 - planet/Objects.ocd/Animals.ocd/Butterfly.ocd/Script.c | 1 + planet/Objects.ocd/Animals.ocd/Chippie.ocd/DefCore.txt | 1 - planet/Objects.ocd/Animals.ocd/Chippie.ocd/Script.c | 1 + planet/Objects.ocd/Animals.ocd/Fish.ocd/DefCore.txt | 1 - planet/Objects.ocd/Animals.ocd/Fish.ocd/Script.c | 1 + planet/Objects.ocd/Animals.ocd/Mosquito.ocd/DefCore.txt | 1 - planet/Objects.ocd/Animals.ocd/Mosquito.ocd/Script.c | 3 ++- planet/Objects.ocd/Animals.ocd/Piranha.ocd/DefCore.txt | 1 - planet/Objects.ocd/Animals.ocd/Piranha.ocd/Script.c | 1 + planet/Objects.ocd/Animals.ocd/PiranhaSmall.ocd/DefCore.txt | 1 - planet/Objects.ocd/Animals.ocd/Puka.ocd/DefCore.txt | 1 - planet/Objects.ocd/Animals.ocd/Puka.ocd/Script.c | 2 ++ planet/Objects.ocd/Animals.ocd/Squid.ocd/DefCore.txt | 1 - planet/Objects.ocd/Animals.ocd/Squid.ocd/Script.c | 1 + planet/Objects.ocd/Animals.ocd/Wipf.ocd/DefCore.txt | 3 +-- planet/Objects.ocd/Animals.ocd/Wipf.ocd/Script.c | 1 + .../Objects.ocd/Animals.ocd/Zaphive.ocd/Zap.ocd/DefCore.txt | 1 - planet/Objects.ocd/Animals.ocd/Zaphive.ocd/Zap.ocd/Script.c | 3 ++- .../Tools.ocd/Balloon.ocd/BalloonDeployed.ocd/DefCore.txt | 1 - .../Tools.ocd/Balloon.ocd/BalloonDeployed.ocd/Script.c | 1 + .../Structures.ocd/Elevator.ocd/Case.ocd/DefCore.txt | 3 +-- .../Structures.ocd/Elevator.ocd/Case.ocd/Script.c | 1 + .../Trees.ocd/Coconut.ocd/CoconutSeed.ocd/DefCore.txt | 1 - .../Trees.ocd/Coconut.ocd/CoconutSeed.ocd/Script.c | 3 ++- planet/Objects.ocd/Vehicles.ocd/Cannon.ocd/DefCore.txt | 1 - planet/Objects.ocd/Vehicles.ocd/Cannon.ocd/Script.c | 3 ++- planet/Objects.ocd/Vehicles.ocd/Catapult.ocd/DefCore.txt | 1 - planet/Objects.ocd/Vehicles.ocd/Catapult.ocd/Script.c | 1 + planet/Objects.ocd/Vehicles.ocd/Lorry.ocd/DefCore.txt | 1 - planet/Objects.ocd/Vehicles.ocd/Lorry.ocd/Script.c | 2 +- .../Worlds.ocf/Clonkomotive.ocs/Locomotive.ocd/DefCore.txt | 1 - planet/Worlds.ocf/Clonkomotive.ocs/Locomotive.ocd/Script.c | 1 + src/object/C4Def.cpp | 2 -- src/object/C4Def.h | 1 - src/object/C4Movement.cpp | 2 +- src/script/C4StringTable.cpp | 1 + src/script/C4StringTable.h | 1 + 51 files changed, 39 insertions(+), 41 deletions(-) diff --git a/docs/sdk/definition/cnat.xml b/docs/sdk/definition/cnat.xml index ade8b47be..e12fd18a3 100644 --- a/docs/sdk/definition/cnat.xml +++ b/docs/sdk/definition/cnat.xml @@ -5,7 +5,7 @@ CNAT - Contact Attachment CNAT - Contact Attachment - In multiple places the engine uses ContactAttachment values (a bitmask) to manage the orientation of objects and processes. For example, a vertex of an object can have the CNAT bit left. If that object has ContactCalls activated, the engine calls on every contact of that vertex with the landscape the object script function ContactLeft. CNAT values are composed of the following bits: + In multiple places the engine uses ContactAttachment values (a bitmask) to manage the orientation of objects and processes. For example, a vertex of an object can have the CNAT bit left. If that object has ContactCalls activated, the engine calls on every contact of that vertex with the landscape the object script function ContactLeft. CNAT values are composed of the following bits: diff --git a/docs/sdk/definition/defcore.xml b/docs/sdk/definition/defcore.xml index 294dcccc7..d3fd2a343 100644 --- a/docs/sdk/definition/defcore.xml +++ b/docs/sdk/definition/defcore.xml @@ -35,11 +35,6 @@ IntegerCategory of the object. Also see object categories. - - ContactCalls - Integer - 0 or 1. If 1, Contactcalls are called in the object script. - Width Integer diff --git a/docs/sdk/definition/properties.xml b/docs/sdk/definition/properties.xml index feb6979d6..c12cc99c6 100644 --- a/docs/sdk/definition/properties.xml +++ b/docs/sdk/definition/properties.xml @@ -180,6 +180,11 @@ Stand = { IntegerBit mask indicating object boundaries: stop at map sides (C4D_Border_Sides), stop at map top (C4D_Border_Top), stop at map bottom (C4D_Border_Sides), stop at object layer boundaries (C4D_Border_Layer). For example BorderBound = C4D_Border_Top | C4D_Border_Bottom. + + ContactCalls + bool + True or false. If true, ContactCalls are called in the object script. +
diff --git a/planet/Defense.ocf/FightForGidl.ocs/Boomattack.ocd/DefCore.txt b/planet/Defense.ocf/FightForGidl.ocs/Boomattack.ocd/DefCore.txt index 152244099..66ec4ce1c 100644 --- a/planet/Defense.ocf/FightForGidl.ocs/Boomattack.ocd/DefCore.txt +++ b/planet/Defense.ocf/FightForGidl.ocs/Boomattack.ocd/DefCore.txt @@ -2,7 +2,6 @@ id=Boomattack Version=7,0 Category=C4D_Vehicle -ContactCalls=1 Width=15 Height=27 Offset=-7,-13 diff --git a/planet/Defense.ocf/FightForGidl.ocs/Boomattack.ocd/Script.c b/planet/Defense.ocf/FightForGidl.ocs/Boomattack.ocd/Script.c index 3b3a3c635..0fc99fb90 100644 --- a/planet/Defense.ocf/FightForGidl.ocs/Boomattack.ocd/Script.c +++ b/planet/Defense.ocf/FightForGidl.ocs/Boomattack.ocd/Script.c @@ -100,3 +100,4 @@ local PerspectiveTheta = 25; local PerspectivePhi = 30; local FlySpeed = 100; local Name = "$Name$"; +local ContactCalls = true; diff --git a/planet/Defense.ocf/Windmill.ocs/BigBoomattack.ocd/DefCore.txt b/planet/Defense.ocf/Windmill.ocs/BigBoomattack.ocd/DefCore.txt index 7930bc98b..a8a80b1e7 100644 --- a/planet/Defense.ocf/Windmill.ocs/BigBoomattack.ocd/DefCore.txt +++ b/planet/Defense.ocf/Windmill.ocs/BigBoomattack.ocd/DefCore.txt @@ -2,7 +2,6 @@ id=BigBoomattack Version=6,0 Category=C4D_Object -ContactCalls=1 Width=60 Height=100 Offset=-30,-50 diff --git a/planet/Defense.ocf/Windmill.ocs/BigBoomattack.ocd/Script.c b/planet/Defense.ocf/Windmill.ocs/BigBoomattack.ocd/Script.c index fae5aad96..3a781005c 100644 --- a/planet/Defense.ocf/Windmill.ocs/BigBoomattack.ocd/Script.c +++ b/planet/Defense.ocf/Windmill.ocs/BigBoomattack.ocd/Script.c @@ -109,4 +109,5 @@ local ActMap = { Hgt = 100 }, }; +local ContactCalls = true; */ \ No newline at end of file diff --git a/planet/Defense.ocf/Windmill.ocs/Boomattack.ocd/DefCore.txt b/planet/Defense.ocf/Windmill.ocs/Boomattack.ocd/DefCore.txt index f0953967b..3de974b16 100644 --- a/planet/Defense.ocf/Windmill.ocs/Boomattack.ocd/DefCore.txt +++ b/planet/Defense.ocf/Windmill.ocs/Boomattack.ocd/DefCore.txt @@ -2,7 +2,6 @@ id=Boomattack Version=7,0 Category=C4D_Vehicle -ContactCalls=1 Width=15 Height=27 Offset=-7,-13 diff --git a/planet/Defense.ocf/Windmill.ocs/Boomattack.ocd/Script.c b/planet/Defense.ocf/Windmill.ocs/Boomattack.ocd/Script.c index d1ada94ac..4ec368a82 100644 --- a/planet/Defense.ocf/Windmill.ocs/Boomattack.ocd/Script.c +++ b/planet/Defense.ocf/Windmill.ocs/Boomattack.ocd/Script.c @@ -130,4 +130,5 @@ local ActMap = { }; local FlySpeed = 100; -local Name = "$Name$"; \ No newline at end of file +local Name = "$Name$"; +local ContactCalls = true; \ No newline at end of file diff --git a/planet/Experimental.ocf/CableLorrys.ocs/CableCars.ocd/Vehicles.ocd/Lorry.ocd/DefCore.txt b/planet/Experimental.ocf/CableLorrys.ocs/CableCars.ocd/Vehicles.ocd/Lorry.ocd/DefCore.txt index 3e8ce75e8..cab6ea59a 100644 --- a/planet/Experimental.ocf/CableLorrys.ocs/CableCars.ocd/Vehicles.ocd/Lorry.ocd/DefCore.txt +++ b/planet/Experimental.ocf/CableLorrys.ocs/CableCars.ocd/Vehicles.ocd/Lorry.ocd/DefCore.txt @@ -2,7 +2,6 @@ id=CableLorry Version=6,0 Category=C4D_Vehicle -ContactCalls=1 Width=22 Height=16 Offset=-11,-8 diff --git a/planet/Experimental.ocf/CableLorrys.ocs/CableCars.ocd/Vehicles.ocd/Lorry.ocd/Script.c b/planet/Experimental.ocf/CableLorrys.ocs/CableCars.ocd/Vehicles.ocd/Lorry.ocd/Script.c index f5ad0dec7..3842c0112 100644 --- a/planet/Experimental.ocf/CableLorrys.ocs/CableCars.ocd/Vehicles.ocd/Lorry.ocd/Script.c +++ b/planet/Experimental.ocf/CableLorrys.ocs/CableCars.ocd/Vehicles.ocd/Lorry.ocd/Script.c @@ -138,4 +138,5 @@ func Definition(def) local Name = "$Name$"; local Description = "$Description$"; local Touchable = 1; -local BorderBound = C4D_Border_Sides; \ No newline at end of file +local BorderBound = C4D_Border_Sides; +local ContactCalls = true; \ No newline at end of file diff --git a/planet/Objects.ocd/Animals.ocd/Bat.ocd/DefCore.txt b/planet/Objects.ocd/Animals.ocd/Bat.ocd/DefCore.txt index 34bf70a11..a08a8cc1d 100644 --- a/planet/Objects.ocd/Animals.ocd/Bat.ocd/DefCore.txt +++ b/planet/Objects.ocd/Animals.ocd/Bat.ocd/DefCore.txt @@ -11,7 +11,6 @@ VertexY=0,-4,2,0 VertexFriction=25,25,25,25 VertexCNAT=1,4,8,2 Mass=3 -ContactCalls=1 StretchGrowth=1 Oversize=1 IncompleteActivity=1 \ No newline at end of file diff --git a/planet/Objects.ocd/Animals.ocd/Bat.ocd/Script.c b/planet/Objects.ocd/Animals.ocd/Bat.ocd/Script.c index 542c99664..287253961 100644 --- a/planet/Objects.ocd/Animals.ocd/Bat.ocd/Script.c +++ b/planet/Objects.ocd/Animals.ocd/Bat.ocd/Script.c @@ -529,6 +529,7 @@ local MaxBreath = 180; local NoBurnDecay = 1; local ContactIncinerate = 10; local BorderBound = C4D_Border_Sides | C4D_Border_Top | C4D_Border_Bottom; +local ContactCalls = true; local ActMap = { Hang = { diff --git a/planet/Objects.ocd/Animals.ocd/Butterfly.ocd/DefCore.txt b/planet/Objects.ocd/Animals.ocd/Butterfly.ocd/DefCore.txt index 464a1ddd0..fa86b9da4 100644 --- a/planet/Objects.ocd/Animals.ocd/Butterfly.ocd/DefCore.txt +++ b/planet/Objects.ocd/Animals.ocd/Butterfly.ocd/DefCore.txt @@ -2,7 +2,6 @@ id=Butterfly Version=6,0 Category=C4D_Living -ContactCalls=1 Width=6 Height=4 Offset=-3,-2 diff --git a/planet/Objects.ocd/Animals.ocd/Butterfly.ocd/Script.c b/planet/Objects.ocd/Animals.ocd/Butterfly.ocd/Script.c index dd9c354ac..43a296c30 100644 --- a/planet/Objects.ocd/Animals.ocd/Butterfly.ocd/Script.c +++ b/planet/Objects.ocd/Animals.ocd/Butterfly.ocd/Script.c @@ -216,6 +216,7 @@ local MaxBreath = 125; local Placement = 2; local NoBurnDecay = 1; local BorderBound = C4D_Border_Sides | C4D_Border_Top | C4D_Border_Bottom; +local ContactCalls = true; func Definition(def) { SetProperty("PictureTransformation", Trans_Mul(Trans_Rotate(20,1,0,0),Trans_Rotate(70,0,1,0)), def); diff --git a/planet/Objects.ocd/Animals.ocd/Chippie.ocd/DefCore.txt b/planet/Objects.ocd/Animals.ocd/Chippie.ocd/DefCore.txt index 5513e1821..46539d4bb 100644 --- a/planet/Objects.ocd/Animals.ocd/Chippie.ocd/DefCore.txt +++ b/planet/Objects.ocd/Animals.ocd/Chippie.ocd/DefCore.txt @@ -11,7 +11,6 @@ VertexY=-1,-3,3,-0,-0,-3,-3 VertexCNAT=0,4,11,1,2,1,2 VertexFriction=300,300,100,300,300,300,300 Mass=30 -ContactCalls=1 NoGet=1 Float=0 StretchGrowth=1 diff --git a/planet/Objects.ocd/Animals.ocd/Chippie.ocd/Script.c b/planet/Objects.ocd/Animals.ocd/Chippie.ocd/Script.c index 7ce6d4792..968ba93cc 100644 --- a/planet/Objects.ocd/Animals.ocd/Chippie.ocd/Script.c +++ b/planet/Objects.ocd/Animals.ocd/Chippie.ocd/Script.c @@ -274,6 +274,7 @@ local NoBurnDecay = 1; local ContactIncinerate = 15; local CorrosionResist = 1; local BorderBound = C4D_Border_Sides; +local ContactCalls = true; local ActMap = { Walk = { diff --git a/planet/Objects.ocd/Animals.ocd/Fish.ocd/DefCore.txt b/planet/Objects.ocd/Animals.ocd/Fish.ocd/DefCore.txt index c18d9b9fe..8dc5ae4aa 100644 --- a/planet/Objects.ocd/Animals.ocd/Fish.ocd/DefCore.txt +++ b/planet/Objects.ocd/Animals.ocd/Fish.ocd/DefCore.txt @@ -2,7 +2,6 @@ id=Fish Version=6,0 Category=C4D_Living -ContactCalls=1 Width=7 Height=7 Offset=-3,-3 diff --git a/planet/Objects.ocd/Animals.ocd/Fish.ocd/Script.c b/planet/Objects.ocd/Animals.ocd/Fish.ocd/Script.c index 952fd9d43..48f3b1782 100644 --- a/planet/Objects.ocd/Animals.ocd/Fish.ocd/Script.c +++ b/planet/Objects.ocd/Animals.ocd/Fish.ocd/Script.c @@ -513,6 +513,7 @@ local Placement = 1; local NoBurnDecay = 1; local BreatheWater = 1; local BorderBound = C4D_Border_Sides | C4D_Border_Top | C4D_Border_Bottom; +local ContactCalls = true; func IsPrey() { return true; } diff --git a/planet/Objects.ocd/Animals.ocd/Mosquito.ocd/DefCore.txt b/planet/Objects.ocd/Animals.ocd/Mosquito.ocd/DefCore.txt index 8338d25ef..a979091e3 100644 --- a/planet/Objects.ocd/Animals.ocd/Mosquito.ocd/DefCore.txt +++ b/planet/Objects.ocd/Animals.ocd/Mosquito.ocd/DefCore.txt @@ -2,7 +2,6 @@ id=Mosquito Version=6,1 Category=C4D_Living -ContactCalls=1 Width=2 Height=2 Offset=-1,-1 diff --git a/planet/Objects.ocd/Animals.ocd/Mosquito.ocd/Script.c b/planet/Objects.ocd/Animals.ocd/Mosquito.ocd/Script.c index 847c69730..3ff9ba697 100644 --- a/planet/Objects.ocd/Animals.ocd/Mosquito.ocd/Script.c +++ b/planet/Objects.ocd/Animals.ocd/Mosquito.ocd/Script.c @@ -250,4 +250,5 @@ local MaxEnergy = 20000; local MaxBreath = 250; local Placement = 2; local NoBurnDecay = 1; -local BorderBound = C4D_Border_Sides | C4D_Border_Top | C4D_Border_Bottom; \ No newline at end of file +local BorderBound = C4D_Border_Sides | C4D_Border_Top | C4D_Border_Bottom; +local ContactCalls = true; \ No newline at end of file diff --git a/planet/Objects.ocd/Animals.ocd/Piranha.ocd/DefCore.txt b/planet/Objects.ocd/Animals.ocd/Piranha.ocd/DefCore.txt index b069bfa7c..9668818d1 100644 --- a/planet/Objects.ocd/Animals.ocd/Piranha.ocd/DefCore.txt +++ b/planet/Objects.ocd/Animals.ocd/Piranha.ocd/DefCore.txt @@ -2,7 +2,6 @@ id=Piranha Version=6,0 Category=C4D_Living -ContactCalls=1 Width=8 Height=6 Offset=-4,-3 diff --git a/planet/Objects.ocd/Animals.ocd/Piranha.ocd/Script.c b/planet/Objects.ocd/Animals.ocd/Piranha.ocd/Script.c index 46b5d97f9..4f1703a83 100644 --- a/planet/Objects.ocd/Animals.ocd/Piranha.ocd/Script.c +++ b/planet/Objects.ocd/Animals.ocd/Piranha.ocd/Script.c @@ -118,6 +118,7 @@ local Placement = 1; local NoBurnDecay = 1; local BreatheWater = 1; local BorderBound = C4D_Border_Sides | C4D_Border_Top | C4D_Border_Bottom; +local ContactCalls = true; func IsPrey() { return false; } func IsPredator() { return true; } diff --git a/planet/Objects.ocd/Animals.ocd/PiranhaSmall.ocd/DefCore.txt b/planet/Objects.ocd/Animals.ocd/PiranhaSmall.ocd/DefCore.txt index 10f486b94..eeb2b3c91 100644 --- a/planet/Objects.ocd/Animals.ocd/PiranhaSmall.ocd/DefCore.txt +++ b/planet/Objects.ocd/Animals.ocd/PiranhaSmall.ocd/DefCore.txt @@ -2,7 +2,6 @@ id=PiranhaSmall Version=6,0 Category=C4D_Living -ContactCalls=1 Width=4 Height=2 Offset=-2,-1 diff --git a/planet/Objects.ocd/Animals.ocd/Puka.ocd/DefCore.txt b/planet/Objects.ocd/Animals.ocd/Puka.ocd/DefCore.txt index 4568dfc1e..d223a2d59 100644 --- a/planet/Objects.ocd/Animals.ocd/Puka.ocd/DefCore.txt +++ b/planet/Objects.ocd/Animals.ocd/Puka.ocd/DefCore.txt @@ -11,7 +11,6 @@ VertexY= 0,-3,4, 1,1,-1,-1 VertexCNAT=0, 4,8, 1,2, 1, 2 VertexFriction=300,300,100,300,300,300,300 Mass=30 -ContactCalls=1 NoGet=1 Float=0 StretchGrowth=1 diff --git a/planet/Objects.ocd/Animals.ocd/Puka.ocd/Script.c b/planet/Objects.ocd/Animals.ocd/Puka.ocd/Script.c index 69ea033f7..5198090e1 100644 --- a/planet/Objects.ocd/Animals.ocd/Puka.ocd/Script.c +++ b/planet/Objects.ocd/Animals.ocd/Puka.ocd/Script.c @@ -754,6 +754,8 @@ local MaxEnergy = 30000; local MaxBreath = 10000; local NoBurnDecay = 1; local BorderBound = C4D_Border_Sides; +local ContactCalls = true; + local ActMap = { Walk = { diff --git a/planet/Objects.ocd/Animals.ocd/Squid.ocd/DefCore.txt b/planet/Objects.ocd/Animals.ocd/Squid.ocd/DefCore.txt index 3a458facf..f36c738f0 100644 --- a/planet/Objects.ocd/Animals.ocd/Squid.ocd/DefCore.txt +++ b/planet/Objects.ocd/Animals.ocd/Squid.ocd/DefCore.txt @@ -2,7 +2,6 @@ id=Squid Version=5,2,0,1 Category=C4D_Living -ContactCalls=1 Width=20 Height=15 Offset=-10,-7 diff --git a/planet/Objects.ocd/Animals.ocd/Squid.ocd/Script.c b/planet/Objects.ocd/Animals.ocd/Squid.ocd/Script.c index edce915b1..6d411a773 100644 --- a/planet/Objects.ocd/Animals.ocd/Squid.ocd/Script.c +++ b/planet/Objects.ocd/Animals.ocd/Squid.ocd/Script.c @@ -556,6 +556,7 @@ local Placement = 1; local NoBurnDecay = 1; local BreatheWater = 1; local BorderBound = C4D_Border_Sides | C4D_Border_Top | C4D_Border_Bottom; +local ContactCalls = true; public func Definition(def) { SetProperty("PictureTransformation", Trans_Mul(Trans_Rotate(20,1,0,0),Trans_Rotate(70,0,1,0)), def); diff --git a/planet/Objects.ocd/Animals.ocd/Wipf.ocd/DefCore.txt b/planet/Objects.ocd/Animals.ocd/Wipf.ocd/DefCore.txt index 62b05921d..7c7f2e805 100644 --- a/planet/Objects.ocd/Animals.ocd/Wipf.ocd/DefCore.txt +++ b/planet/Objects.ocd/Animals.ocd/Wipf.ocd/DefCore.txt @@ -16,5 +16,4 @@ Float=0 StretchGrowth=1 IncompleteActivity=1 Oversize=1 -Pathfinder=1 -ContactCalls=1 \ No newline at end of file +Pathfinder=1 \ No newline at end of file diff --git a/planet/Objects.ocd/Animals.ocd/Wipf.ocd/Script.c b/planet/Objects.ocd/Animals.ocd/Wipf.ocd/Script.c index 1e3aceeda..ae0b69f94 100644 --- a/planet/Objects.ocd/Animals.ocd/Wipf.ocd/Script.c +++ b/planet/Objects.ocd/Animals.ocd/Wipf.ocd/Script.c @@ -651,6 +651,7 @@ local NoBurnDecay = true; local Collectible = true; local ContactIncinerate = 10; local BorderBound = C4D_Border_Sides; +local ContactCalls = true; protected func Definition(proplist def) { diff --git a/planet/Objects.ocd/Animals.ocd/Zaphive.ocd/Zap.ocd/DefCore.txt b/planet/Objects.ocd/Animals.ocd/Zaphive.ocd/Zap.ocd/DefCore.txt index 18e73dcde..265c84a5e 100644 --- a/planet/Objects.ocd/Animals.ocd/Zaphive.ocd/Zap.ocd/DefCore.txt +++ b/planet/Objects.ocd/Animals.ocd/Zaphive.ocd/Zap.ocd/DefCore.txt @@ -2,7 +2,6 @@ id=Zap Version=6,1 Category=C4D_Living -ContactCalls=1 Width=2 Height=2 Offset=-1,-1 diff --git a/planet/Objects.ocd/Animals.ocd/Zaphive.ocd/Zap.ocd/Script.c b/planet/Objects.ocd/Animals.ocd/Zaphive.ocd/Zap.ocd/Script.c index cb44e80e6..d72c87434 100644 --- a/planet/Objects.ocd/Animals.ocd/Zaphive.ocd/Zap.ocd/Script.c +++ b/planet/Objects.ocd/Animals.ocd/Zaphive.ocd/Zap.ocd/Script.c @@ -247,4 +247,5 @@ local MaxEnergy = 30000; local MaxBreath = 250; local Placement = 2; local NoBurnDecay = 1; -local BorderBound = C4D_Border_Sides | C4D_Border_Top | C4D_Border_Bottom; \ No newline at end of file +local BorderBound = C4D_Border_Sides | C4D_Border_Top | C4D_Border_Bottom; +local ContactCalls = true; \ No newline at end of file diff --git a/planet/Objects.ocd/Items.ocd/Tools.ocd/Balloon.ocd/BalloonDeployed.ocd/DefCore.txt b/planet/Objects.ocd/Items.ocd/Tools.ocd/Balloon.ocd/BalloonDeployed.ocd/DefCore.txt index b9dd5ed24..5731fe88d 100644 --- a/planet/Objects.ocd/Items.ocd/Tools.ocd/Balloon.ocd/BalloonDeployed.ocd/DefCore.txt +++ b/planet/Objects.ocd/Items.ocd/Tools.ocd/Balloon.ocd/BalloonDeployed.ocd/DefCore.txt @@ -10,5 +10,4 @@ VertexX=0,0,-15,15,-12,12,-10,10,0,-5,5,0 VertexY=30,-15,0,0,-8,-8,10,10,35,30,30,25 VertexFriction=50,50,50,50,50,50,50,50,50,50,50,50 VertexCNAT=16,4,1,2,5,6,1,2,8,9,10,24 -ContactCalls=1 Mass=3 diff --git a/planet/Objects.ocd/Items.ocd/Tools.ocd/Balloon.ocd/BalloonDeployed.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Tools.ocd/Balloon.ocd/BalloonDeployed.ocd/Script.c index 5d772f1fa..c3939be72 100644 --- a/planet/Objects.ocd/Items.ocd/Tools.ocd/Balloon.ocd/BalloonDeployed.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Tools.ocd/Balloon.ocd/BalloonDeployed.ocd/Script.c @@ -291,3 +291,4 @@ local ActMap = { }; local Name = "$Name$"; local BorderBound = C4D_Border_Sides; +local ContactCalls = true; diff --git a/planet/Objects.ocd/Structures.ocd/Elevator.ocd/Case.ocd/DefCore.txt b/planet/Objects.ocd/Structures.ocd/Elevator.ocd/Case.ocd/DefCore.txt index 013a2ea22..fd133ad79 100644 --- a/planet/Objects.ocd/Structures.ocd/Elevator.ocd/Case.ocd/DefCore.txt +++ b/planet/Objects.ocd/Structures.ocd/Elevator.ocd/Case.ocd/DefCore.txt @@ -17,5 +17,4 @@ Components=Wood=1 SolidMask=0,0,24,3,0,23 Picture=24,0,128,128 HorizontalFix=1 -NoPushEnter=1 -ContactCalls=1 \ No newline at end of file +NoPushEnter=1 \ No newline at end of file diff --git a/planet/Objects.ocd/Structures.ocd/Elevator.ocd/Case.ocd/Script.c b/planet/Objects.ocd/Structures.ocd/Elevator.ocd/Case.ocd/Script.c index 3218782e4..da5439161 100644 --- a/planet/Objects.ocd/Structures.ocd/Elevator.ocd/Case.ocd/Script.c +++ b/planet/Objects.ocd/Structures.ocd/Elevator.ocd/Case.ocd/Script.c @@ -774,3 +774,4 @@ local Touchable = 2; local HitPoints = 50; local Plane = 250; local BorderBound = C4D_Border_Top | C4D_Border_Bottom; +local ContactCalls = true; diff --git a/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coconut.ocd/CoconutSeed.ocd/DefCore.txt b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coconut.ocd/CoconutSeed.ocd/DefCore.txt index 0ad4bf0d5..7cfbb22de 100644 --- a/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coconut.ocd/CoconutSeed.ocd/DefCore.txt +++ b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coconut.ocd/CoconutSeed.ocd/DefCore.txt @@ -13,7 +13,6 @@ VertexCNAT=4,2,1 Value=4 Mass=4 Components=Coconut=1 -ContactCalls=1 Projectile=1 Float=1 Rotate=1 diff --git a/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coconut.ocd/CoconutSeed.ocd/Script.c b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coconut.ocd/CoconutSeed.ocd/Script.c index 2a88a3ae7..5d7db8f34 100644 --- a/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coconut.ocd/CoconutSeed.ocd/Script.c +++ b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coconut.ocd/CoconutSeed.ocd/Script.c @@ -138,4 +138,5 @@ local Name = "$Name$"; local Description = "$Description$"; local BlastIncinerate = 8; local ContactIncinerate = 2; -local Confinement; \ No newline at end of file +local Confinement; +local ContactCalls = true; diff --git a/planet/Objects.ocd/Vehicles.ocd/Cannon.ocd/DefCore.txt b/planet/Objects.ocd/Vehicles.ocd/Cannon.ocd/DefCore.txt index 77469eeea..14e767322 100644 --- a/planet/Objects.ocd/Vehicles.ocd/Cannon.ocd/DefCore.txt +++ b/planet/Objects.ocd/Vehicles.ocd/Cannon.ocd/DefCore.txt @@ -2,7 +2,6 @@ id=Cannon Version=6,0 Category=C4D_Vehicle -ContactCalls=1 Width=22 Height=16 Offset=-11,-8 diff --git a/planet/Objects.ocd/Vehicles.ocd/Cannon.ocd/Script.c b/planet/Objects.ocd/Vehicles.ocd/Cannon.ocd/Script.c index aa1560379..76db0010d 100644 --- a/planet/Objects.ocd/Vehicles.ocd/Cannon.ocd/Script.c +++ b/planet/Objects.ocd/Vehicles.ocd/Cannon.ocd/Script.c @@ -297,4 +297,5 @@ Roll = { local Name = "$Name$"; local Description = "$Description$"; local Touchable = 1; -local BorderBound = C4D_Border_Sides; \ No newline at end of file +local BorderBound = C4D_Border_Sides; +local ContactCalls = true; \ No newline at end of file diff --git a/planet/Objects.ocd/Vehicles.ocd/Catapult.ocd/DefCore.txt b/planet/Objects.ocd/Vehicles.ocd/Catapult.ocd/DefCore.txt index 525693bd6..790733997 100644 --- a/planet/Objects.ocd/Vehicles.ocd/Catapult.ocd/DefCore.txt +++ b/planet/Objects.ocd/Vehicles.ocd/Catapult.ocd/DefCore.txt @@ -2,7 +2,6 @@ id=Catapult Version=6,0 Category=C4D_Vehicle -ContactCalls=1 Width=34 Height=30 Offset=-17,-15 diff --git a/planet/Objects.ocd/Vehicles.ocd/Catapult.ocd/Script.c b/planet/Objects.ocd/Vehicles.ocd/Catapult.ocd/Script.c index 42c873fdd..d14f20bfe 100644 --- a/planet/Objects.ocd/Vehicles.ocd/Catapult.ocd/Script.c +++ b/planet/Objects.ocd/Vehicles.ocd/Catapult.ocd/Script.c @@ -325,6 +325,7 @@ local Name = "$Name$"; local Description = "$Description$"; local Touchable = 1; local BorderBound = C4D_Border_Sides; +local ContactCalls = true; local ActMap = { Roll = { diff --git a/planet/Objects.ocd/Vehicles.ocd/Lorry.ocd/DefCore.txt b/planet/Objects.ocd/Vehicles.ocd/Lorry.ocd/DefCore.txt index cec316717..03669e52b 100644 --- a/planet/Objects.ocd/Vehicles.ocd/Lorry.ocd/DefCore.txt +++ b/planet/Objects.ocd/Vehicles.ocd/Lorry.ocd/DefCore.txt @@ -2,7 +2,6 @@ id=Lorry Version=6,0 Category=C4D_Vehicle -ContactCalls=1 Width=22 Height=16 Offset=-11,-8 diff --git a/planet/Objects.ocd/Vehicles.ocd/Lorry.ocd/Script.c b/planet/Objects.ocd/Vehicles.ocd/Lorry.ocd/Script.c index 50f333749..45ab47b6c 100644 --- a/planet/Objects.ocd/Vehicles.ocd/Lorry.ocd/Script.c +++ b/planet/Objects.ocd/Vehicles.ocd/Lorry.ocd/Script.c @@ -301,4 +301,4 @@ local Name = "$Name$"; local Description = "$Description$"; local Touchable = 1; local BorderBound = C4D_Border_Sides; - +local ContactCalls = true; diff --git a/planet/Worlds.ocf/Clonkomotive.ocs/Locomotive.ocd/DefCore.txt b/planet/Worlds.ocf/Clonkomotive.ocs/Locomotive.ocd/DefCore.txt index cf6801e4b..9dccfaa31 100644 --- a/planet/Worlds.ocf/Clonkomotive.ocs/Locomotive.ocd/DefCore.txt +++ b/planet/Worlds.ocf/Clonkomotive.ocs/Locomotive.ocd/DefCore.txt @@ -2,7 +2,6 @@ id=Locomotive Version=7,0 Category=C4D_Vehicle -ContactCalls=1 Width=24 Height=22 Offset=-12,-11 diff --git a/planet/Worlds.ocf/Clonkomotive.ocs/Locomotive.ocd/Script.c b/planet/Worlds.ocf/Clonkomotive.ocs/Locomotive.ocd/Script.c index 25ba0c6d2..f5c6ee898 100644 --- a/planet/Worlds.ocf/Clonkomotive.ocs/Locomotive.ocd/Script.c +++ b/planet/Worlds.ocf/Clonkomotive.ocs/Locomotive.ocd/Script.c @@ -207,3 +207,4 @@ local PictureTransformation = [0, -940, -342, -18000, 1000, 0, 0, 27000, 0, -342 local Name = "$Name$"; local Description = "$Description$"; local BorderBound = C4D_Border_Sides; +local ContactCalls = true; diff --git a/src/object/C4Def.cpp b/src/object/C4Def.cpp index 323caed22..3decd05c6 100644 --- a/src/object/C4Def.cpp +++ b/src/object/C4Def.cpp @@ -111,7 +111,6 @@ void C4Def::DefaultDefCore() LiftTop=0; GrabPutGet=0; UprightAttach=0; - ContactFunctionCalls=0; Line=0; LineIntersect=0; IncompleteActivity=0; @@ -209,7 +208,6 @@ void C4Def::CompileFunc(StdCompiler *pComp) pComp->Value(mkNamingAdapt(mkBitfieldAdapt(Category, Categories), "Category", 0 )); - pComp->Value(mkNamingAdapt(ContactFunctionCalls, "ContactCalls", 0 )); pComp->Value(mkParAdapt(Shape, static_cast(NULL))); pComp->Value(mkNamingAdapt(Value, "Value", 0 )); pComp->Value(mkNamingAdapt(Mass, "Mass", 0 )); diff --git a/src/object/C4Def.h b/src/object/C4Def.h index 0bf7babba..3e1e11f08 100644 --- a/src/object/C4Def.h +++ b/src/object/C4Def.h @@ -127,7 +127,6 @@ public: int32_t LiftTop; int32_t GrabPutGet; int32_t UprightAttach; - int32_t ContactFunctionCalls; int32_t Line; int32_t LineIntersect; int32_t IncompleteActivity; diff --git a/src/object/C4Movement.cpp b/src/object/C4Movement.cpp index f7f3f61b0..0d719f72e 100644 --- a/src/object/C4Movement.cpp +++ b/src/object/C4Movement.cpp @@ -113,7 +113,7 @@ const char *CNATName(int32_t cnat) bool C4Object::Contact(int32_t iCNAT) { - if (Def->ContactFunctionCalls) + if (GetPropertyInt(P_ContactCalls)) { return !! Call(FormatString(PSF_Contact, CNATName(iCNAT)).getData()); } diff --git a/src/script/C4StringTable.cpp b/src/script/C4StringTable.cpp index 79903311a..3e6145a0b 100644 --- a/src/script/C4StringTable.cpp +++ b/src/script/C4StringTable.cpp @@ -147,6 +147,7 @@ C4StringTable::C4StringTable() P[P_IncineratingObj] = "IncineratingObj"; P[P_Plane] = "Plane"; P[P_BorderBound] = "BorderBound"; + P[P_ContactCalls] = "ContactCalls"; P[P_SolidMaskPlane] = "SolidMaskPlane"; P[P_Tooltip] = "Tooltip"; P[P_Placement] = "Placement"; diff --git a/src/script/C4StringTable.h b/src/script/C4StringTable.h index a519ca4e1..6cea1c20c 100644 --- a/src/script/C4StringTable.h +++ b/src/script/C4StringTable.h @@ -354,6 +354,7 @@ enum C4PropertyName P_IncineratingObj, // unused? P_Plane, P_BorderBound, + P_ContactCalls, P_SolidMaskPlane, P_Tooltip, P_Placement,