Jump to content
joemac90

Eden Attribute : STRING edit Problem

Recommended Posts

I am creating a edit box for a STRING in eden as an attribute.
I have created other attributes that work for numbers but not strings

class mazeObjectAttributes
{
  displayName = "MAZE : Attributes"; // Category name visible in Edit Attributes window
  collapsed = 1; // When 1, the category is collapsed by default
  class Attributes
  {

    class mazeName
    {
      displayName = "Name";
      tooltip  = "Name";
      property = "maze_Name";
      control  = "Edit";
      expression = "_this setVariable [ 'maze_Name' ,_value];";
      condition = "object"; // Condition for attribute to appear (see the table below)
    };
    class mazeClass
    {
      displayName = "Class";
      tooltip  = "MAZE : Asset Class"; // Tooltip assigned to UI control class Title
      property = "maze_Class"; // Unique config property name saved in SQM
      control  = "Edit"; // UI control base class displayed in Edit Attributes window, points to Cfg3DEN >> Attributes
      expression = "_this setVariable [ 'maze_Class' ,_value];";
      condition = "object"; // Condition for attribute to appear (see the table below)
    };
    class mazeMax
    {
      displayName = "Max";
      tooltip  = "Max"; // Tooltip assigned to UI control class Title
      property = "maze_Max"; // Unique config property name saved in SQM
      control  = "EditCode"; // UI control base class displayed in Edit Attributes window, points to Cfg3DEN >> Attributes
      expression = "_this setVariable [ 'maze_Max' ,_value];";
      condition = "object"; // Condition for attribute to appear (see the table below)
    };
    class mazeCode
    {
      displayName = "Code";
      tooltip  = "Code"; // Tooltip assigned to UI control class Title
      property = "maze_Code"; // Unique config property name saved in SQM
      control  = "EditMulti5"; // UI control base class displayed in Edit Attributes window, points to Cfg3DEN >> Attributes
      expression = "_this setVariable [ 'maze_Code' ,_value];";
      condition = "object"; // Condition for attribute to appear (see the table below)
    };
  };
};

Is does not remember the text string I enter and show as true or false.
 
fypGj0n.png?1
 
What am I doing wrong?

Share this post


Link to post
Share on other sites
class mazeObjectAttributes
{
  displayName = "MAZE : Attributes"; // Category name visible in Edit Attributes window
  collapsed = 1; // When 1, the category is collapsed by default
  class Attributes
  {

    class mazeName
    {
      displayName = "Name";
      tooltip  = "Name";
      property = "maze_Name";
      control  = "Edit";
      expression = "_this setVariable [ 'maze_Name' ,_value];";
      condition = "object"; // Condition for attribute to appear (see the table below)+
      typeName = "STRING";
      defaultValue = "";
    };
    class mazeClass: mazeName
    {
      displayName = "Class";
      tooltip  = "MAZE : Asset Class"; // Tooltip assigned to UI control class Title
      property = "maze_Class"; // Unique config property name saved in SQM
      expression = "_this setVariable [ 'maze_Class' ,_value];";
    };
    class mazeMax: mazeName
    {
      displayName = "Max";
      tooltip  = "Max"; // Tooltip assigned to UI control class Title
      property = "maze_Max"; // Unique config property name saved in SQM
      control  = "EditCode"; // UI control base class displayed in Edit Attributes window, points to Cfg3DEN >> Attributes
      expression = "_this setVariable [ 'maze_Max' ,_value];";
    };
    class mazeCode: mazeName
    {
      displayName = "Code";
      tooltip  = "Code"; // Tooltip assigned to UI control class Title
      property = "maze_Code"; // Unique config property name saved in SQM
      control  = "EditMulti5"; // UI control base class displayed in Edit Attributes window, points to Cfg3DEN >> Attributes
      expression = "_this setVariable [ 'maze_Code' ,_value];";
    };
  };
};

The issue could be caused by the mission defaultValue and typeName config entry. I added both to the first config class and the others inherit that value now. See if that works.

Share this post


Link to post
Share on other sites

Thank you Revo,

 

I have previously tried adding:

  typeName = "STRING";
  defaultValue = "";

to each class not using inheritance and now have also tried your example but I have the same result.

 

Also thank for 3DEN Enhanced I have learned a lot from it , it is a essential resource for eden and learning eden editing.

Share this post


Link to post
Share on other sites

That's odd. I have a similar attribute which also uses the Edit control and it works just as expected.

Share this post


Link to post
Share on other sites

I think your is in:

  class Mission
  {
    class Intel
    {
      class AttributeCategories

mines in ;

class Cfg3DEN
{

    class Object
    {
        class AttributeCategories

Share this post


Link to post
Share on other sites

The one I was talking about is actually an object attribute, so it's also in class Object

Share this post


Link to post
Share on other sites

I have played about with this for most of the weekend but still not found a solution.

Does anyone have any ideas why this is not working?

Share this post


Link to post
Share on other sites

I have no idea, theoretically it should work just fine. Here's another example of one of my attribute using a edit box

        class Enh_Line_1
        {
            displayName = $STR_introText_line1_displayName;
            tooltip = "";
            property = "Enh_firstLine";
            control = "Edit";
            expression = "missionNamespace setVariable ['Enh_introLine1',_value]";
            defaultValue = briefingName;
            typeName = "STRING";
        };

Share this post


Link to post
Share on other sites

I think the problem was :

condition = "object"; // Condition for attribute to appear (see the table below)+

instead of a combination of one of the conditions below:

 

Condition

Conditions are written as simple expressions. Example:

condition = "objectControllable + objectVehicle";

All characters and vehicles will have this attribute.

 

Supported conditions:

Condition 	        For Type   Description
objectBrain 	        Object 	   Object with simulation "soldier" or "UAVpilot"
objectControllable 	Object 	   Object with simulation "soldier"
objectAgent 	        Object     Object with non-empty agentTasks[], i.e., animals
objectVehicle 	        Object 	   Vehicle which can be boarded
objectSimulated 	Object 	   Object which is simulated (e.g., falls down when in the air)
objectDestructable 	Object 	   Indestructible object, i.e., when destrType config property set not DestructNo
logicModule 	        Logic 	   Logic which is a module (vehicleClass config property is "Modules")
objectHasInventoryCargo Object 	   All object which as an openable inventory 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×