Howto talk:Implement a Fly-By-Wire System for Airliners: Difference between revisions

m
No edit summary
Line 16: Line 16:


--[[User:Omega1174|Omega95]]
--[[User:Omega1174|Omega95]]
:: Sorry, my bad: Should be fixed, but to explain what happened: I basically set up a vector with size 0 and then tried to access non-existent elements. The right thing to do would be using the [http://plausible.org/nasal/lib.html setsize(vector, size) function] here, or just initializing the vector with some data, so that the size is correct. The setsize() function would do that automatically (for each item,it'd add a nil value). This happened because in my example (PM) I suggested directly adding the getprop() calls into the vector initialization: <syntaxhighlight lang="php">var throttles=[getprop("controls/engines/engine[0]/throttle"), getprop("controls/engines/engine[1]/throttle")];</syntaxhighlight> --[[User:Hooray|Hooray]] 12:28, 7 February 2012 (EST)