WaxyChicken Posted March 11, 2015 Share Posted March 11, 2015 How can you change the sticky setting of an object through torque script?i am attempting to make objects that the players can move around and then "Set" once they choose a location.I've tried %obj.sticky = true; %obj.stickToGround(); and i tried %TempDataBlock = %obj.getDataBlock(); %TempDataBlock.sticky = true; %obj.setDataBlock(%TempDataBlock); no luck. Quote Link to comment Share on other sites More sharing options...
LukasPJ Posted March 12, 2015 Share Posted March 12, 2015 Is this PhysX or? Quote Link to comment Share on other sites More sharing options...
WaxyChicken Posted March 12, 2015 Author Share Posted March 12, 2015 Is this PhysX or? no, default torque physics. Quote Link to comment Share on other sites More sharing options...
buckmaster Posted March 13, 2015 Share Posted March 13, 2015 What object class are you working with? I've never seen a sticky field on anything but Item. Also, I suspect that altering the datablock is not what you should be doing. Quote Link to comment Share on other sites More sharing options...
WaxyChicken Posted March 13, 2015 Author Share Posted March 13, 2015 What object class are you working with? I've never seen a sticky field on anything but Item. Also, I suspect that altering the datablock is not what you should be doing.DeployableAITurret / AITurretdatablock AITurretShapeData(ReactorDeployableTurret : ReactorAITurret)datablock AITurretShapeData(ReactorAITurret)datablock ShapeBaseImageData(ReactorDeployableTurretImage)http://s26.postimg.org/t6tiplfq1/Turrets.png Quote Link to comment Share on other sites More sharing options...
buckmaster Posted March 13, 2015 Share Posted March 13, 2015 Oh cool, so it looks like the turret class descends from Item? Aha, yes it does. So the list of all members should show inherited ones from item as well - which don't include a sticky member or a stickToGround method.What's wrong with just making the item sticky all the time? Does it need to bounce sometimes? Quote Link to comment Share on other sites More sharing options...
WaxyChicken Posted March 17, 2015 Author Share Posted March 17, 2015 Sometimes, yes.and there MUST be a way for the engine to enable / disable the sticky quality on the fly because, well, the editor does it.The editor can dynamically change the "Sticky" value of an object in real time. just test with creating a sticky... unsticky... resticky in the editor. unfortunately I'm not talented enough to understand how it's doing it. Quote Link to comment Share on other sites More sharing options...
doc Posted March 18, 2015 Share Posted March 18, 2015 uhm..something like %obj.freezeSim(1); call it on the server for ex. with a servercmd and commandToServer!I hope it helps. Quote Link to comment Share on other sites More sharing options...
WaxyChicken Posted March 21, 2015 Author Share Posted March 21, 2015 nice try, Doc, but freezesim() is part of RigidShape inheritance.AITurretShape and RigidShape both use ShapeBase, but AITurretShape doesn't use RigidShape - it's a different branch of the inheritance shape.RigidShape inheritence:http://docs.garagegames.com/torque-3d/reference/classRigidShape__inherit__graph.pngAITurretShape Inheritence:http://docs.garagegames.com/torque-3d/reference/classAITurretShape__inherit__graph.pngfull list of all AITurretShape functions/values can be found here: http://docs.garagegames.com/torque-3d/reference/classAITurretShape-members.html (is this up to date with 3.6.1? i don't know) Quote Link to comment Share on other sites More sharing options...
doc Posted March 23, 2015 Share Posted March 23, 2015 I see.. take a look here https://github.com/GarageGames/Torque3D/blob/1c580f5a5f2fc93a7432316275ae394d71dfc519/Engine/source/T3D/turret/turretShape.cpp#L87try to make a commandToServer to make it sticky!P.S. if is not working, you probably have to send the data in packUpdate and unpackUpdate and make a setSticky function. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.