Page MenuHomeFeedback Tracker

ctrlSetPosition doesn't work with variables as [x,y,w,h]
Closed, ResolvedPublic

Description

(a series of operations which led) x = 0.176768; checked with copyToClipboard
(a series of operations which led) y = 0.0690236;
checked with copyToClipboard
(a series of operations which led) w = 0.646465; checked with copyToClipboard
(a series of operations which led) h = 0.861953;
checked with copyToClipboard
image ctrlSetPosition [x, y, w, h];

The above DOESN'T work while the below DOES, strangely:

x = 0.176768;
y = 0.0690236;
w = 0.646465;
h = 0.861953;
image ctrlSetPosition [x, y, w, h];

Details

Legacy ID
4099855566
Severity
None
Resolution
No Bug
Reproducibility
Always
Category
Scripting

Event Timeline

PYL set Category to Scripting.Jan 23 2016, 12:08 AM
PYL set Reproducibility to Always.
PYL set Severity to None.
PYL set Resolution to No Bug.
PYL set Legacy ID to 4099855566.May 8 2016, 1:33 PM
Bohemia added a subscriber: Bohemia.May 8 2016, 1:33 PM

You have to execute:

image ctrlCommit 0;

Otherwise the new position won't be commited

Are you using public variables or local variables? do you have showscripterrors turned on?

PYL added a subscriber: PYL.May 8 2016, 1:33 PM
PYL added a comment.Jan 23 2016, 10:23 AM

I was using some public variables and the error was they weren't containing a number, even if I thought they were...

why isn't x = 0.5 a number and _x = 0.5 is?

commy2 added a subscriber: commy2.May 8 2016, 1:33 PM

Both are numbers:
x = 123; typeName x
-> "SCALAR"

_x = 123; typeName _x
-> "SCALAR"

Maybe your public variables didn't arive when you executed ctrlSetPosition?

You should probably make a repro mission.

Seems like this is more of a scripting issue for the forum discussion. Going to resolve then.