Jump to content

Sticky object through script?


WaxyChicken

Recommended Posts

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.

Link to comment
Share on other sites

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 / AITurret



datablock AITurretShapeData(ReactorDeployableTurret : ReactorAITurret)

datablock AITurretShapeData(ReactorAITurret)

datablock ShapeBaseImageData(ReactorDeployableTurretImage)


http://s26.postimg.org/t6tiplfq1/Turrets.png

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.png


AITurretShape Inheritence:

http://docs.garagegames.com/torque-3d/reference/classAITurretShape__inherit__graph.png


full 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)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...