summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Mittendrein <git@maxmitti.tk>2018-03-31 16:13:57 +0200
committerMarkus Mittendrein <git@maxmitti.tk>2018-03-31 16:13:57 +0200
commita365f17c31ddc48326d26bfc43860ab0afd9a309 (patch)
treedbc6fb0ca3087e35aebc1f80859bb0f2c426eaae
parentfa5403dccd986022b2a849e2078f043c3225348a (diff)
downloadDTSensors.c4d-a365f17c31ddc48326d26bfc43860ab0afd9a309.tar.gz
DTSensors.c4d-a365f17c31ddc48326d26bfc43860ab0afd9a309.zip
Use fast callbacks and fix indentation and whitespace issues
-rw-r--r--Items.c4d/Sensors.c4d/RC.c4d/Script.c268
1 files changed, 134 insertions, 134 deletions
diff --git a/Items.c4d/Sensors.c4d/RC.c4d/Script.c b/Items.c4d/Sensors.c4d/RC.c4d/Script.c
index 933d875..b582a4d 100644
--- a/Items.c4d/Sensors.c4d/RC.c4d/Script.c
+++ b/Items.c4d/Sensors.c4d/RC.c4d/Script.c
@@ -43,77 +43,77 @@ static const RC7I_Control_V = 32;
func GetControlName(int ctrl)
{
- return ["$Left$" ,
- "$LeftSingle$" ,
- "$LeftDouble$" ,
- "$LeftReleased$" ,
- "$Right$" ,
- "$RightSingle$" ,
- "$RightDouble$" ,
- "$RightReleased$" ,
- "$Up$" ,
- "$UpSingle$" ,
- "$UpDouble$" ,
- "$UpReleased$" ,
- "$Down$" ,
- "$DownSingle$" ,
- "$DownDouble$" ,
- "$DownReleased$" ,
- "$Throw$" ,
- "$ThrowSingle$" ,
- "$ThrowDouble$" ,
- "$ThrowReleased$" ,
- "$Dig$" ,
- "$DigSingle$" ,
- "$DigDouble$" ,
- "$DigReleased$" ,
- "$Special$" ,
- "$SpecialSingle$" ,
- "$SpecialDouble$" ,
- "$SpecialReleased$" ,
- "$Special2$" ,
- "$Special2Single$" ,
- "$Special2Double$" ,
- "$Special2Released$" ,
- "$Update$"
- ][ctrl];
+ return ["$Left$",
+ "$LeftSingle$",
+ "$LeftDouble$",
+ "$LeftReleased$",
+ "$Right$",
+ "$RightSingle$",
+ "$RightDouble$",
+ "$RightReleased$",
+ "$Up$",
+ "$UpSingle$",
+ "$UpDouble$",
+ "$UpReleased$",
+ "$Down$",
+ "$DownSingle$",
+ "$DownDouble$",
+ "$DownReleased$",
+ "$Throw$",
+ "$ThrowSingle$",
+ "$ThrowDouble$",
+ "$ThrowReleased$",
+ "$Dig$",
+ "$DigSingle$",
+ "$DigDouble$",
+ "$DigReleased$",
+ "$Special$",
+ "$SpecialSingle$",
+ "$SpecialDouble$",
+ "$SpecialReleased$",
+ "$Special2$",
+ "$Special2Single$",
+ "$Special2Double$",
+ "$Special2Released$",
+ "$Update$"
+ ][ctrl];
}
func Triggers()
{
- return [["$Left$" ],
- ["$LeftSingle$" ],
- ["$LeftDouble$" ],
- ["$LeftReleased$" ],
- ["$Right$" ],
- ["$RightSingle$" ],
- ["$RightDouble$" ],
- ["$RightReleased$" ],
- ["$Up$" ],
- ["$UpSingle$" ],
- ["$UpDouble$" ],
- ["$UpReleased$" ],
- ["$Down$" ],
- ["$DownSingle$" ],
- ["$DownDouble$" ],
- ["$DownReleased$" ],
- ["$Throw$" ],
- ["$ThrowSingle$" ],
- ["$ThrowDouble$" ],
- ["$ThrowReleased$" ],
- ["$Dig$" ],
- ["$DigSingle$" ],
- ["$DigDouble$" ],
- ["$DigReleased$" ],
- ["$Special$" ],
- ["$SpecialSingle$" ],
- ["$SpecialDouble$" ],
- ["$SpecialReleased$" ],
- ["$Special2$" ],
- ["$Special2Single$" ],
- ["$Special2Double$" ],
- ["$Special2Released$" ],
- ["$Update$" ]];
+ return [["$Left$"],
+ ["$LeftSingle$"],
+ ["$LeftDouble$"],
+ ["$LeftReleased$"],
+ ["$Right$"],
+ ["$RightSingle$"],
+ ["$RightDouble$"],
+ ["$RightReleased$"],
+ ["$Up$"],
+ ["$UpSingle$"],
+ ["$UpDouble$"],
+ ["$UpReleased$"],
+ ["$Down$"],
+ ["$DownSingle$"],
+ ["$DownDouble$"],
+ ["$DownReleased$"],
+ ["$Throw$"],
+ ["$ThrowSingle$"],
+ ["$ThrowDouble$"],
+ ["$ThrowReleased$"],
+ ["$Dig$"],
+ ["$DigSingle$"],
+ ["$DigDouble$"],
+ ["$DigReleased$"],
+ ["$Special$"],
+ ["$SpecialSingle$"],
+ ["$SpecialDouble$"],
+ ["$SpecialReleased$"],
+ ["$Special2$"],
+ ["$Special2Single$"],
+ ["$Special2Double$"],
+ ["$Special2Released$"],
+ ["$Update$"]];
}
global func IsRemoteControllable(object controller)
@@ -129,76 +129,76 @@ global func RemoteControlMap(object controller)
{
return
[
- [RC7I_Control_L, "ControlLeft" ],
- [RC7I_Control_LS, "ControlLeftSingle" ],
- [RC7I_Control_LD, "ControlLeftDouble" ],
- [RC7I_Control_LR, "ControlLeftReleased" ],
- [RC7I_Control_R, "ControlRight" ],
- [RC7I_Control_RS, "ControlRightSingle" ],
- [RC7I_Control_RD, "ControlRightDouble" ],
- [RC7I_Control_RR, "ControlRightReleased" ],
- [RC7I_Control_U, "ControlUp" ],
- [RC7I_Control_US, "ControlUpSingle" ],
- [RC7I_Control_UD, "ControlUpDouble" ],
- [RC7I_Control_UR, "ControlUpReleased" ],
- [RC7I_Control_D, "ControlDown" ],
- [RC7I_Control_DS, "ControlDownSingle" ],
- [RC7I_Control_DD, "ControlDownDouble" ],
- [RC7I_Control_DR, "ControlDownReleased" ],
- [RC7I_Control_T, "ControlThrow" ],
- [RC7I_Control_TS, "ControlThrowSingle" ],
- [RC7I_Control_TD, "ControlThrowDouble" ],
- [RC7I_Control_TR, "ControlThrowReleased" ],
- [RC7I_Control_Q, "ControlDig" ],
- [RC7I_Control_QS, "ControlDigSingle" ],
- [RC7I_Control_QD, "ControlDigDouble" ],
- [RC7I_Control_QR, "ControlDigReleased" ],
- [RC7I_Control_S, "ControlSpecial" ],
- [RC7I_Control_SS, "ControlSpecialSingle" ],
- [RC7I_Control_SD, "ControlSpecialDouble" ],
- [RC7I_Control_SR, "ControlSpecialReleased" ],
- [RC7I_Control_Z, "ControlSpecial2" ],
- [RC7I_Control_ZS, "ControlSpecial2Single" ],
- [RC7I_Control_ZD, "ControlSpecial2Double" ],
- [RC7I_Control_ZR, "ControlSpecial2Released" ],
- [RC7I_Control_V, "ControlUpdate" ],
- [RC7I_Control_L, BindCallback(RC7I->Callback("UpdateTargetDir"), [Bind(this), Bind(DIR_Left)]), "$ChangeDirLeft$"],
- [RC7I_Control_R, BindCallback(RC7I->Callback("UpdateTargetDir"), [Bind(this), Bind(DIR_Right)]), "$ChangeDirRight$"],
- [RC7I_Control_S, BindCallback(RC7I->Callback("ShiftTargetContents"), [Bind(this)]), "$ShiftContents$"],
- [RC7I_Control_SD, BindCallback(RC7I->Callback("ShiftTargetContents"), [Bind(this)]), "$ShiftContents$"]
+ [RC7I_Control_L, "ControlLeft"],
+ [RC7I_Control_LS, "ControlLeftSingle"],
+ [RC7I_Control_LD, "ControlLeftDouble"],
+ [RC7I_Control_LR, "ControlLeftReleased"],
+ [RC7I_Control_R, "ControlRight"],
+ [RC7I_Control_RS, "ControlRightSingle"],
+ [RC7I_Control_RD, "ControlRightDouble"],
+ [RC7I_Control_RR, "ControlRightReleased"],
+ [RC7I_Control_U, "ControlUp"],
+ [RC7I_Control_US, "ControlUpSingle"],
+ [RC7I_Control_UD, "ControlUpDouble"],
+ [RC7I_Control_UR, "ControlUpReleased"],
+ [RC7I_Control_D, "ControlDown"],
+ [RC7I_Control_DS, "ControlDownSingle"],
+ [RC7I_Control_DD, "ControlDownDouble"],
+ [RC7I_Control_DR, "ControlDownReleased"],
+ [RC7I_Control_T, "ControlThrow"],
+ [RC7I_Control_TS, "ControlThrowSingle"],
+ [RC7I_Control_TD, "ControlThrowDouble"],
+ [RC7I_Control_TR, "ControlThrowReleased"],
+ [RC7I_Control_Q, "ControlDig"],
+ [RC7I_Control_QS, "ControlDigSingle"],
+ [RC7I_Control_QD, "ControlDigDouble"],
+ [RC7I_Control_QR, "ControlDigReleased"],
+ [RC7I_Control_S, "ControlSpecial"],
+ [RC7I_Control_SS, "ControlSpecialSingle"],
+ [RC7I_Control_SD, "ControlSpecialDouble"],
+ [RC7I_Control_SR, "ControlSpecialReleased"],
+ [RC7I_Control_Z, "ControlSpecial2"],
+ [RC7I_Control_ZS, "ControlSpecial2Single"],
+ [RC7I_Control_ZD, "ControlSpecial2Double"],
+ [RC7I_Control_ZR, "ControlSpecial2Released"],
+ [RC7I_Control_V, "ControlUpdate"],
+ [RC7I_Control_L, BindCallback(RC7I->DefinitionCallback("UpdateTargetDir", true), [Bind(this), Bind(DIR_Left)]), "$ChangeDirLeft$"],
+ [RC7I_Control_R, BindCallback(RC7I->DefinitionCallback("UpdateTargetDir", true), [Bind(this), Bind(DIR_Right)]), "$ChangeDirRight$"],
+ [RC7I_Control_S, BindCallback(RC7I->DefinitionCallback("ShiftTargetContents", true), [Bind(this)]), "$ShiftContents$"],
+ [RC7I_Control_SD, BindCallback(RC7I->DefinitionCallback("ShiftTargetContents", true), [Bind(this)]), "$ShiftContents$"]
];
}
else if(GetOCF() & OCF_Entrance)
{
return
[
- [RC7I_Control_L, "ContainedLeft" ],
- [RC7I_Control_LS, "ContainedLeftSingle" ],
- [RC7I_Control_LD, "ContainedLeftDouble" ],
- [RC7I_Control_LR, "ContainedLeftReleased" ],
- [RC7I_Control_R, "ContainedRight" ],
- [RC7I_Control_RS, "ContainedRightSingle" ],
- [RC7I_Control_RD, "ContainedRightDouble" ],
- [RC7I_Control_RR, "ContainedRightReleased" ],
- [RC7I_Control_U, "ContainedUp" ],
- [RC7I_Control_US, "ContainedUpSingle" ],
- [RC7I_Control_UD, "ContainedUpDouble" ],
- [RC7I_Control_UR, "ContainedUpReleased" ],
- [RC7I_Control_D, "ContainedDown" ],
- [RC7I_Control_DS, "ContainedDownSingle" ],
- [RC7I_Control_DD, "ContainedDownDouble" ],
- [RC7I_Control_DR, "ContainedDownReleased" ],
- [RC7I_Control_T, "ContainedThrow" ],
- [RC7I_Control_TS, "ContainedThrowSingle" ],
- [RC7I_Control_TD, "ContainedThrowDouble" ],
- [RC7I_Control_TR, "ContainedThrowReleased" ],
- [RC7I_Control_Q, "ContainedDig" ],
- [RC7I_Control_QS, "ContainedDigSingle" ],
- [RC7I_Control_QD, "ContainedDigDouble" ],
- [RC7I_Control_QR, "ContainedDigReleased" ],
- [RC7I_Control_V, "ContainedUpdate" ],
- [RC7I_Control_S, BindCallback(RC7I->Callback("ShiftTargetContents"), [Bind(this)]), "$ShiftContents$"],
- [RC7I_Control_SD, BindCallback(RC7I->Callback("ShiftTargetContents"), [Bind(this)]), "$ShiftContents$"]
+ [RC7I_Control_L, "ContainedLeft"],
+ [RC7I_Control_LS, "ContainedLeftSingle"],
+ [RC7I_Control_LD, "ContainedLeftDouble"],
+ [RC7I_Control_LR, "ContainedLeftReleased"],
+ [RC7I_Control_R, "ContainedRight"],
+ [RC7I_Control_RS, "ContainedRightSingle"],
+ [RC7I_Control_RD, "ContainedRightDouble"],
+ [RC7I_Control_RR, "ContainedRightReleased"],
+ [RC7I_Control_U, "ContainedUp"],
+ [RC7I_Control_US, "ContainedUpSingle"],
+ [RC7I_Control_UD, "ContainedUpDouble"],
+ [RC7I_Control_UR, "ContainedUpReleased"],
+ [RC7I_Control_D, "ContainedDown"],
+ [RC7I_Control_DS, "ContainedDownSingle"],
+ [RC7I_Control_DD, "ContainedDownDouble"],
+ [RC7I_Control_DR, "ContainedDownReleased"],
+ [RC7I_Control_T, "ContainedThrow"],
+ [RC7I_Control_TS, "ContainedThrowSingle"],
+ [RC7I_Control_TD, "ContainedThrowDouble"],
+ [RC7I_Control_TR, "ContainedThrowReleased"],
+ [RC7I_Control_Q, "ContainedDig"],
+ [RC7I_Control_QS, "ContainedDigSingle"],
+ [RC7I_Control_QD, "ContainedDigDouble"],
+ [RC7I_Control_QR, "ContainedDigReleased"],
+ [RC7I_Control_V, "ContainedUpdate"],
+ [RC7I_Control_S, BindCallback(RC7I->DefinitionCallback("ShiftTargetContents", true), [Bind(this)]), "$ShiftContents$"],
+ [RC7I_Control_SD, BindCallback(RC7I->DefinitionCallback("ShiftTargetContents", true), [Bind(this)]), "$ShiftContents$"]
];
}
}
@@ -646,13 +646,13 @@ global func FxIntJnRAimTimer(object target, int number, int time)
// Controller weg?
var controller = EffectVar(2, target, number);
if(!controller) return(-1);
-
+
// Controller muss Fahrzeug anfassen
if(target)
if(target->GetCategory() & C4D_Vehicle)
if(controller->GetProcedure() != "PUSH" || (controller->GetActionTarget() != target && GetID(controller->GetActionTarget()) != RC7I))
return FX_Execute_Kill;
-
+
if(target)
target->AimConf(EffectVar(0, target, number), EffectVar(1, target, number), EffectVar(2, target, number));
else if(EffectVar(3, target, number))
@@ -718,4 +718,4 @@ global func AddMenuItem(caption, command, sym, object menuObject)
}
return _inherited(caption, command, sym, menuObject, ...);
-}
+} \ No newline at end of file