Showing 2 changed files with 18 additions and 10 deletions
+12 -5
README.md
... ...
@@ -120,16 +120,23 @@ Please report bug at <seb.marque@free.fr>.
120 120
   * many more...
121 121
 
122 122
 # Installation
123
-Just `git clone https://sebmarque.hd.free.fr/git/seb/zkv1000` in your favorite Instrumentation-3d dir.  
123
+Just `git clone https://sebmarque.hd.free.fr/git/seb/zkv1000.git` in your favorite `Instrumentation-3d` dir or directly in your aircraft files structure.  
124
+Please note that the `Instruments-3d` dir is recommended as the zkv1000 wants to integrate the official `$FGDATA/Aircraft/Instruments-3d` some days  
124 125
 Then somewhere in the XML configuration of your aircraft, put only few lines as described below
125 126
 ## Create the `zkv1000` Nasal namespace
126
-In the `<nasal>` place of your aircraft configuration
127
+In the `<nasal>` place of your aircraft configuration, tell FlightGear where to find the `zkv1000.nas` file
127 128
 
128 129
         <zkv1000>
129 130
             <file>Aircraft/Instruments-3d/zkv1000/zkv1000.nas</file>
130 131
         </zkv1000>
131 132
 
132
-Actually this is where everything begins, please have a look at this code, it would help you to follow the script.
133
+or
134
+
135
+        <zkv1000>
136
+            <file>Aircraft/My-Nice-Aircraft/arbitrary/dirs/zkv1000-or-not/zkv1000.nas</file>
137
+        </zkv1000>
138
+
139
+Actually `zkv1000.nas` is where everything begins, please have a look at this code, it would help you to follow the script.
133 140
 
134 141
 ## Set specific values for your aircraft
135 142
 Specifics values for aircraft can be set via the aircraft configuration, in the `<instrumentation>` section, just add a section `<zkv1000>` and set here the needed values.
... ...
@@ -174,7 +181,7 @@ Defaults to `none`, available entries are the `.nas` files located in `Nasal/EIS
174 181
 
175 182
 or the one from another aircraft. Anyway if the EIS nasal file targeted doesn't exist, the fallback is the type `none`.
176 183
 
177
-#### or you can give the absolute path (not recommanded)
184
+#### or you can give the absolute path (![][warning] not supported)
178 185
 
179 186
         </eis>
180 187
           <file>/home/foobar/fgfs-data/Nasal/testing-jet-jsbsim-EIS.nas</file>
... ...
@@ -205,7 +212,7 @@ You can specify the stall AoA in order to display it in the dedicated display.
205 212
 
206 213
 ## 3D models
207 214
 In the definition of your flightdeck (here are the values for the installation in the Lancair 235 in which I develop the device)
208
-put it everywhere you want to
215
+put it everywhere you want to. Note that the path `Aircraft/Instruments-3d/zkv1000` is dependant on the path where the zkv1000 is installed, this can be somewhere like `Aircraft/My-Nice-Aircraft/arbitrary/dirs/zkv1000-or-not`as mentionned earlier in this section.
209 216
 
210 217
         <model>
211 218
             <path>Aircraft/Instruments-3d/zkv1000/pfd-pilot.xml</path>
+6 -5
zkv1000.nas
... ...
@@ -166,11 +166,12 @@ var init_props = func {
166 166
     props.globals.getNode('/autopilot/locks/roll',1).setValue('');
167 167
     props.globals.getNode('/autopilot/locks/passive-mode', 1).setIntValue(1);
168 168
 
169
-    data.zkv1000_reldir = 'Aircraft/Instruments-3d/zkv1000/';
170
-    if (getprop('/sim/fg-aircraft') != nil)
171
-        data.zkv1000_dir = getprop('/sim/fg-aircraft') ~ '/Instruments-3d/zkv1000/';
172
-    else
173
-        data.zkv1000_dir = getprop('/sim/fg-root') ~ '/' ~ data.zkv1000_reldir;
169
+    data.zkv1000_reldir = io.dirname(getprop('/nasal/zkv1000/file'));
170
+    data.zkv1000_dir = string.normpath(
171
+            io.dirname(getprop('/sim/aircraft-dir'))
172
+            ~ '/'
173
+            ~ string.replace(data.zkv1000_reldir, split('/', data.zkv1000_reldir)[0], '')
174
+        ) ~ '/';
174 175
 }
175 176
 
176 177
 var load_nasal = func {