Jump to content
Mr H.

params, expected data type for side

Recommended Posts

Using https://community.bistudio.com/wiki/params you can define expected datatypes with an "Array of direct Data Types" eg. {} is CODE, but what's the correct way to check that the parameter is a side ? https://community.bistudio.com/wiki/typeName seems to imply that it's sideUnknown but:
 

params [
	["_units",[],[]],
	["_side",WEST,sideUnknown],
	["_position",[0,0,0],[],3]
   ];

Throws an error
while

params [
	["_units",[],[]],
	["_side",WEST],
	["_position",[0,0,0],[],3]
   ];

Does not.
And I can't find the right syntax...

Share this post


Link to post
Share on other sites
28 minutes ago, Mr H. said:

Using https://community.bistudio.com/wiki/params you can define expected datatypes with an "Array of direct Data Types" eg. {} is CODE, but what's the correct way to check that the parameter is a side ? https://community.bistudio.com/wiki/typeName seems to imply that it's sideUnknown but:
 


params [
	["_units",[],[]],
	["_side",WEST,sideUnknown],
	["_position",[0,0,0],[],3]
   ];

Throws an error
while


params [
	["_units",[],[]],
	["_side",WEST],
	["_position",[0,0,0],[],3]
   ];

Does not.
And I can't find the right syntax...

That's because you're not using the proper syntax, default data type expects an array of data types, in your second example you leave out the faulty syntax, so of course it works.

This should work:

params [["_side",west,[sideUnknown]]];

And hence this:

test = [east] call {
	params [["_side",west,[sideUnknown]]];
	_side
};

should hold east side in "test" variable.

 

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites

Ahhhh that's whar I was missing thanks!

  • Like 1

Share this post


Link to post
Share on other sites

I assume that :

params [
		["_units",[],[[]]],
		["_side",WEST,[sideUnknown]],
		["_position",[0,0,0],[[]],3]
	];

is also the correct syntax for the rest

  • Like 3

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

×