Future additions and enhancements I plan to complete myself.are:
A few more models including my original concept of bundles of x-mas trees and dump truck scenario.
Suspended cargo by visible rope or cradle. (This is next, I plan to use or borrow the existing towing routines for this)
Some additional physics like simulated weight/drag/force/swing.
Cargo, cradle and rope damage.
Instructions for setting up this scenario are contained in the file CargoContainer.nas.
All the files here
Cargo-AI-Scenario_v1.5.zip - 5/2017
Comments for latest version:
GUI add-on appears to be broke at the moment.
I only checked Hard-dock towing.
Really the only instruction for using the scenario are as follows
After putting the files and xml code where indicated in CargoContainer.nas, choose the scenario KEQA_CargoContainer from Scenarios.
Hover as close and centered as possible to the cargo until "Cargo In Range" and Engage Hook key (Shift-0) or Auto Engage Hook key (Ctrl-0). Move then "Release Cargo" key (o).
HINT: If your not a helo pilot, use the ufo to play with it. But that's BORING!
Below, a few issues I'm hoping to get answers for.
I wanted to dynamically add all the necessary code required in existing aircraft.xml with one nasal call, but ran into a few problems.
I was able to add everything dynamically except model paths. Even though I could add them to the prop tree, they didn't work. I don't know if it is something I am doing wrong or if it is not possible. Or maybe it is a load order issue.
I was able to add things like
- Code: Select all
props.Node.new({ "controls/cargo-release":0 });
props.globals.initNode("controls/cargo-release", 0, "BOOL" );
props.Node.new({ "sim/model/cargo-hook":0, "sim/model/cargo-auto-hook":0, "sim/model/cargo-on-hook":0 });
props.globals.initNode("sim/model/cargo-hook", 0, "BOOL" );
props.globals.initNode("sim/model/cargo-auto-hook", 0, "BOOL" );
props.globals.initNode("sim/model/cargo-on-hook", 0, "BOOL" );
props.Node.new({ "sim/submodels/serviceable":1 });
props.globals.initNode("sim/submodels/serviceable", 1, "BOOL" );
to replace some settings in airplane/airplane-set.xml
but not the replacement for this
- Code: Select all
<submodels>
<path>Aircraft/AirCrane/Models/CargoContainer-submodel.xml</path>
</submodels>
which was something like this
- Code: Select all
props.Node.new({ "sim/submodels/path":"" });
props.globals.initNode("sim/submodels/path", "Aircraft/AirCrane/Models/CargoContainer-submodel.xml", "STRING" );
if (props.globals.getNode("sim/submodels/path") == nil )
props.globals.getNode("sim/submodels/path", 1).setValue("Aircraft/AirCrane/Models/CargoContainer-submodel.xml");
I threw everything I could think of at it. Don't laugh, remember I am completely new to nasal. I don't know if it is syntax error or just my stupidity.
I also couldn't add the airplane/model/airplane.xml cargo model dynamically.
I want to replace this.
- Code: Select all
<model>
<path>Aircraft/AirCrane/Models/CargoContainer.xml</path>
<name>CargoContainer</name>
<condition>
<property>sim/model/cargo-on-hook</property>
</condition>
<offsets>
<x-m>-2.2</x-m>
<y-m>0</y-m>
<z-m>-4</z-m>
<!--x-m>-3.95</x-m>
<y-m>0</y-m>
<z-m>-10.5</z-m-->
<pitch-deg>0</pitch-deg>
</offsets>
</model>
<animation>
<type>noshadow</type>
<object-name>CargoContainer</object-name>
<condition>
<not>
<property>sim/model/cargo-on-hook</property>
</not>
</condition>
</animation>
with this
- Code: Select all
#cargocontainer model
props.Node.new({ "model/path":"Aircraft/AirCrane/Models/CargoContainer.xml" });
props.globals.initNode("model/path", "Aircraft/AirCrane/Models/CargoContainer.xml", "STRING" );
props.Node.new({ "model/name":"CargoContainer" });
props.globals.initNode("model/name", "CargoContainer", "STRING" );
props.Node.new({ "model/condition/cargo-on-hook":0 });
props.globals.initNode("model/condition/cargo-on-hook", 0, "BOOL" );
props.Node.new({ "model/offsets/x-m":-2.2, "model/offsets/y-m":0, "model/offsets/z-m":-4, "model/offsets/pitch-deg":0 });
props.globals.initNode("model/offsets/x-m", -2.2, "DOUBLE" );
props.globals.initNode("model/offsets/y-m", 0, "DOUBLE" );
props.globals.initNode("model/offsets/z-m", -4, "DOUBLE" );
props.globals.initNode("model/offsets/pitch-deg", 0, "DOUBLE" );
#cargocontainer model shadow
props.Node.new({ "animation/type/noshadow":0 });
props.globals.initNode("animation/type/noshadow", 0, "BOOL" );
props.Node.new({ "animation/object-name":"CargoContainer" });
props.globals.initNode("animation/object-name", "CargoContainer", "STRING" );
props.Node.new({ "animation/condition/not/cargo-on-hook":0 });
props.globals.initNode("animation/condition/not/cargo-on-hook", 0, "BOOL" );
Again I couldn't get these to work.
The key handling was another thing I really want to add dynamically so as not to have users having to add it. But wasn't sure if something like
- Code: Select all
keyHandler = func {
#Ctrl-O = Auto Attach CargoContainer
if ( getprop( "devices/status/keyboard/ctrl") ){
if( getprop("devices/status/keyboard/event/key") == 15 ){
setprop("sim/model/cargo-auto-hook", 1);
}
}
#Shift-O = Attach CargoContainer
if ( getprop( "devices/status/keyboard/shift") ){
if( getprop("devices/status/keyboard/event/key") == 79 ){
setprop("sim/model/cargo-hook", 1);
}
}
#o = Release CargoContainer
if( getprop("devices/status/keyboard/event/key") == 111 ){
setprop("controls/cargo-release", 1);
}
settimer( func { timer() } , .5 );
}
keyHandler();
is appropriate.
EDIT: 9/6/14 3:39 CST - Version 1.a - Commented out URL's in KEQA_CargoContainer.xml, URL's were causing errors.
EDIT: 9/7/14 13:50 CST - Version 1.1 - Complete restructure of CargoContainer.nas, modified value in CargoContainer-submodel.xml.
EDIT: 9/8/14 13:20 CST - Version 1.2 - Organizational changes including renamed functions and files, replaced cargo model and added additional, better quality cargo models. Changed files: almost all of them.
EDIT: 9/21/14 Version 1.2 moved to git as Version 1.0
EDIT: 10/11/14 Version 1.3 rope tow capability git
EDIT: 1/18/15 Version 1.3 correct keyboard events git