diff -r 4ae6fd4c0918 planet/Objects.ocd/Items.ocd/Tools.ocd/TeleGlove.ocd/Script.c --- a/planet/Objects.ocd/Items.ocd/Tools.ocd/TeleGlove.ocd/Script.c Mon Jan 16 00:22:24 2012 +0000 +++ b/planet/Objects.ocd/Items.ocd/Tools.ocd/TeleGlove.ocd/Script.c Mon Jan 16 21:59:01 2012 +0100 @@ -5,6 +5,8 @@ Move objects remotely. --*/ +local debug; + local reach; local radius; //actual effect radius to grab objects local radiusparticle; //radius of particles around object @@ -20,11 +22,16 @@ protected func Initialize() { + debug=false; reach = 150; radius = 60; radiusparticle = 60; } +public func SetDebug(bool newdebug) { + debug=newdebug; +} + public func GetCarryMode() { return CARRY_HandBack; } public func GetCarrySpecial(clonk) { return carry_bone; } public func GetCarryBone() { return "main"; } @@ -126,7 +133,7 @@ var anglep = Angle(0,0,ix,iy); var distp = Distance(0,0,ix,iy); - if(distp < reach) + if(distp < reach || debug) { //Particles moving towards object for(var i; i < 2; i++) @@ -148,10 +155,11 @@ { radiusparticle = 30; - if(Distance(target_object->GetX(), target_object->GetY(), clonk->GetX() + ix, clonk->GetY() + iy) > radius || - Distance(target_object->GetX(), target_object->GetY(), clonk->GetX(), clonk->GetY()) > reach) + if(!debug && ( + Distance(target_object->GetX(), target_object->GetY(), clonk->GetX() + ix, clonk->GetY() + iy) > radius || + Distance(target_object->GetX(), target_object->GetY(), clonk->GetX(), clonk->GetY()) > reach)) { - LostTargetObject(target); + LostTargetObject(target_object); target_object = nil; } } @@ -160,11 +168,14 @@ { radiusparticle = 60; + var finddistance; + if(!debug) + finddistance=Find_Distance(reach - 15); var target = FindObject(Find_Exclude(this), Find_NoContainer(), Find_Category(C4D_Object), Find_And(Find_Distance(radius, ix, iy), - Find_Distance(reach - 15)), + finddistance), Sort_Distance(ix,iy)); if(target)