Game Development Community

Allow ML control chars in chat

by Electrk · in Torque 3D Beginner · 11/28/2013 (12:37 am) · 6 replies

How do I allow ML control chars in chat?

#1
11/28/2013 (5:41 am)
ML control chars? what is it your trying to accomplish?
#2
11/28/2013 (8:01 am)
Make a custom chathud that is based around GuiMLTextCtrl. Then you could just make a function like this to add a chat line:

function GuiMLTextCtrl::addLine(%this, %line)
{
   if (%this.getValue() $= "")
      %this.setText(%line);
   else
      %this.setText(%this.getValue() NL %line);
}
#3
11/28/2013 (10:28 am)
Yup - I can see how you could use this to implement a system similar to most modern mmo games - lets you "link" items or missions into chat....
#4
11/30/2013 (11:08 am)
Thanks Jeff!

Also, is there a way to check if an object is inside/stuck in another object?
#5
11/30/2013 (11:59 am)
%pos = %obj.getPosition();
%check = %obj2.getPosition();
if (vectorDist(%pos, %check) < 0.1)
{
   // within 0.1 units range.
}

or you could use the ContainerBoxEmpty function that checks bounding boxes, look that function up in the API
#6
11/30/2013 (12:24 pm)
Thanks again, Jeff! I can't seem to get containerBoxEmpty to work properly though... I'll try the other one.