Jump to content
Sign in to follow this  
R3vo

Custom Environment attributes do not work, or do they?

Recommended Posts

I tried to implement a custom environment attribute and the control returns the _value fine when in 3den, but on mission start, the expression is not called at all.

I even tried to delay the execution by spawning and waitUntil, but that also didn't do the trick.

expression = "[_value] spawn {waitUntil {time > 1};if (!(is3den)) then {setTimeMultiplier (_this select 0)}; systemChat str (_this select 0)}";

or

expression = "if (!(is3den)) then {setTimeMultiplier _value}; systemChat str _value}";

Share this post


Link to post
Share on other sites

Could you please post here the whole attribute configuration?

Share this post


Link to post
Share on other sites
class Cfg3den
{
    class Mission
    {
        class Intel
        {
            class AttributeCategories
            {            
                class Date
                {
                    class Attributes
                    {
                        class TimeMultiplier
                        {
                            displayName = "Time Multiplier";
                            tooltip = "Set how fast the time will pass. Values from 1 - 120 are valid.";
                            property = "Revo_timeMultiplier";
                            control = "edit";
                            expression = "if (!(is3den)) then {[_value] spawn {waitUntil {time > 1}; setTimeMultiplier (_this select 0)}}";
                            defaultValue = "1";
                            typeName = "NUMBER";
                            validate = "number";
                        };
                    };
                };
            };
        };
    };
};

Got the same issue with other mission attributes. Additionally, default values don't seem to be saved properly.

Share this post


Link to post
Share on other sites

There's currently an issue which prevents custom attributes to be placed in Intel section. We fixed it now and it should be available in the next dev build update. Meanwhile, I suggest to place it to a different section, so you can continue development.

 

Additionally, default values don't seem to be saved properly.

That's intentional, there's no need to save default values, because they are already present. As described on Biki:

Only attributes with values different from the default are saved to the scenario file, which means only their expression will be called.

Share this post


Link to post
Share on other sites

There's currently an issue which prevents custom attributes to be placed in Intel section. We fixed it now and it should be available in the next dev build update. Meanwhile, I suggest to place it to a different section, so you can continue development.

 

That's intentional, there's no need to save default values, because they are already present. As described on Biki:

Only attributes with values different from the default are saved to the scenario file, which means only their expression will be called.

 

Alright, thanks for clarifiying ;)

Share this post


Link to post
Share on other sites

That's intentional, there's no need to save default values, because they are already present. As described on Biki:

Only attributes with values different from the default are saved to the scenario file, which means only their expression will be called.

 

 

I gave it another try after todays update and custom mission attribute seem to work fine now. But to come back to the issue where the value would not be saved, what I actually ment is, that if I set a timeMultiplier (example above) of 120 and afterwards preview the mission and go back into the editor, the attribute shows the default value again, not the value I actually set.

 

Idon't think that's intentional, because it would mean a mission creator would need to set this value everytime again after a preview.

Share this post


Link to post
Share on other sites

It's not intentional and it shall be fixed. Both issues are related, attributes placed other sections than Intel should work fine.

  • Like 1

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
Sign in to follow this  

×