diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2017-01-02 19:34:09 +0100 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2017-01-02 19:34:09 +0100 |
| commit | 1f280cb06cc579c2a98d215e202dc0642fb40a3d (patch) | |
| tree | 30a19973594d30792947aa624e7bf585eaa0cf40 /Items.c4d/Distributor.c4d | |
| download | DTTubeMail.c4d-1f280cb06cc579c2a98d215e202dc0642fb40a3d.tar.gz DTTubeMail.c4d-1f280cb06cc579c2a98d215e202dc0642fb40a3d.zip | |
Initial
Diffstat (limited to 'Items.c4d/Distributor.c4d')
| -rw-r--r-- | Items.c4d/Distributor.c4d/ActMap.txt | 4 | ||||
| -rw-r--r-- | Items.c4d/Distributor.c4d/DefCore.txt | 21 | ||||
| -rw-r--r-- | Items.c4d/Distributor.c4d/Graphics.png | bin | 0 -> 245 bytes | |||
| -rw-r--r-- | Items.c4d/Distributor.c4d/Names.txt | 2 | ||||
| -rw-r--r-- | Items.c4d/Distributor.c4d/Script.c | 107 |
5 files changed, 134 insertions, 0 deletions
diff --git a/Items.c4d/Distributor.c4d/ActMap.txt b/Items.c4d/Distributor.c4d/ActMap.txt new file mode 100644 index 0000000..54a4a81 --- /dev/null +++ b/Items.c4d/Distributor.c4d/ActMap.txt @@ -0,0 +1,4 @@ +[Action]
+Name=Float
+Procedure=FLOAT
+FacetBase=1
diff --git a/Items.c4d/Distributor.c4d/DefCore.txt b/Items.c4d/Distributor.c4d/DefCore.txt new file mode 100644 index 0000000..8e9155e --- /dev/null +++ b/Items.c4d/Distributor.c4d/DefCore.txt @@ -0,0 +1,21 @@ +[DefCore]
+id=DS7I
+Name=Distributor
+Version=4,9,5
+Category=C4D_Object|C4D_SelectMaterial|C4D_SelectKnowledge|C4D_SelectHomebase
+Width=11
+Height=11
+Offset=-5,-4
+Mass=10
+Value=5
+Components=METL=1;
+; Picture=10,0,64,64
+Vertices=4
+VertexX=0,-5,5
+VertexY=4,-4,-4
+VertexFriction=100,100,100
+Grab=2
+Collectible=1
+MaxUserSelect=10
+Rebuy=1
+NoPushEnter=1
diff --git a/Items.c4d/Distributor.c4d/Graphics.png b/Items.c4d/Distributor.c4d/Graphics.png Binary files differnew file mode 100644 index 0000000..23114f2 --- /dev/null +++ b/Items.c4d/Distributor.c4d/Graphics.png diff --git a/Items.c4d/Distributor.c4d/Names.txt b/Items.c4d/Distributor.c4d/Names.txt new file mode 100644 index 0000000..47a29e4 --- /dev/null +++ b/Items.c4d/Distributor.c4d/Names.txt @@ -0,0 +1,2 @@ +DE:Verteiler
+US:Distributor
diff --git a/Items.c4d/Distributor.c4d/Script.c b/Items.c4d/Distributor.c4d/Script.c new file mode 100644 index 0000000..156c30d --- /dev/null +++ b/Items.c4d/Distributor.c4d/Script.c @@ -0,0 +1,107 @@ +#strict 2
+#include UT7I
+
+func Floating()
+{
+ return GetProcedure() == "FLOAT";
+}
+
+func ControlDigDouble(object caller)
+{
+ if(DenyContainedDirectCom())
+ {
+ return false;
+ }
+ return SetAction("Idle");
+}
+
+func Activate(object caller)
+{
+ caller->Exit(this);
+ SetAction("Float");
+ return true;
+}
+
+func AcceptsObject(object obj, id id, object requester)
+{
+ return FindObject2(Find_Tube(), ExcludeOrigin(requester), Find_Func("CanSendObject", this, obj));
+}
+
+func RetrieveObject(object requester, id type, arriveCallback, object excludeOrigin, failCallback, object realTarget)
+{
+ var line = FindObject2(Find_Tube(), ExcludeOrigin(requester), ExcludeOrigin(excludeOrigin), Find_Func("CanRetrieveObject", this, type, false)) || FindObject2(Find_Tube(), ExcludeOrigin(requester), ExcludeOrigin(excludeOrigin), Find_Func("CanRetrieveObject", this, type, true), Sort_Func("FactoryLoad"));
+ if(line)
+ {
+ return line->RetrieveObject(this, type, BindCallback(Callback("ForwardObject"), [0, 1, 2, Bind(requester), Bind(arriveCallback)]), 0, failCallback, realTarget || requester->GetLineEnd(this));
+ }
+}
+
+func ForwardObject(object obj, object line, object receiver, object requester, arriveCallback)
+{
+ if(requester)
+ {
+ return requester->SendObject(this, obj, arriveCallback);
+ }
+}
+
+func ExcludeOrigin(object originLine)
+{
+ var origin = originLine;
+ if(!originLine)
+ {
+ return Find_And();
+ }
+ if(origin->~IsTube())
+ {
+ origin = origin->ObjectOrigin(this);
+ }
+ else
+ {
+ originLine = 0;
+ }
+ return Find_And(Find_Exclude(originLine), Find_Not(Find_Func("HasObjectOrigin", origin)));
+}
+
+func ReceiveObject(object obj, bool noReturn, array arriveCallback, object senderLine)
+{
+ if(arriveCallback)
+ {
+ if(CallA(arriveCallback, [obj, senderLine, this], true))
+ {
+ return TU7I_NoCallback;
+ }
+ }
+ else
+ {
+ var line = FindObject2(Find_Tube(), ExcludeOrigin(senderLine), Find_Func("CanSendObject", this, obj));
+ return line && line->SendObject(this, obj, noReturn);
+ }
+}
+
+func HasObject(id type, bool allowProduction, object receiverLine, object excludeOrigin)
+{
+ return FindObject2(Find_Tube(), ExcludeOrigin(receiverLine), Find_Func("CanRetrieveObject", this, type, allowProduction), ExcludeOrigin(excludeOrigin));
+}
+
+func GetRetrievableObjects(object requester, bool produce)
+{
+ var lines = FindObjects(Find_Tube(), ExcludeOrigin(requester));
+ var IDs = [], produceIDs = [], part;
+ for(var line in lines)
+ {
+ part = line->~GetRetrievableObjects(this, produce) || [];
+ for(var id in part)
+ {
+ if(GetIndexOf(id, IDs) == -1)
+ {
+ IDs[GetLength(IDs)] = id;
+ }
+ }
+ }
+ return IDs;
+}
+
+func RejectEntrance(object obj)
+{
+ return Floating();
+}
|
