Alright, so Im throwing this up because that darn @Blind Owl brought up an something, and it gave me an idea of something for people that may want a printable Control Map for their stick/throttle, but either are too lazy, or dont own, or dont have the skills, or being TESTies, too drunk.
I've got a rough idea of what i need/want to do. So here goes the explanation.
The Star Citizen Controls are saved in an encrypted file, unless you export them from the in-game option menu. From there they are exported to an XML File. However, the structure of this file is complex, and it doesnt want to cooperate properly with simpleXML for PHP.
My Initial idea was to create a webpage that you could upload your XML too, the PHP then parses the XML, Assigns each designated "Value" with a name, and value of its own, storing that into a database table temporarily until the user selects their joystick (which would then show a base image map.) Then it would run another PHP script that Overlays text onto the base image, basically the script would call from the table, the column, and it value, then insert that at preassigned coordinates based on the Image selected.
However, Because of how Star Citizen/CIG Formated this XML, simpleXML doesnt cut it when it comes to trying to parse it properly, and im having problems finding a simple way to do this. So Below in the spoiler i've added my XML file, my current PHP code for parsing, and a link to my demo page to show whats happening when trying to use simplePHP.
What I am looking for: I need ideas/example code/reference links on how i could do this, or how i could come up with a Windows Application that not only can take that XML and Simplify it, but also then do what i was going to do with the webapp (yes its possible, i looked up some example codes of writing text to an image from a program, just nothing designed how i would use it yet (open market? ;) ).
So anyone with experience that might be able to help me come up with ideas on how to solve my issue please dont hesitate to let me know.
Test Weblink:
http://ripcord-test_squadron.site88.net/xml_parse_test.php
Note: Right now, you can just hit "Send File" i have my XML uploaded for testing and example purposes.
I've got a rough idea of what i need/want to do. So here goes the explanation.
The Star Citizen Controls are saved in an encrypted file, unless you export them from the in-game option menu. From there they are exported to an XML File. However, the structure of this file is complex, and it doesnt want to cooperate properly with simpleXML for PHP.
My Initial idea was to create a webpage that you could upload your XML too, the PHP then parses the XML, Assigns each designated "Value" with a name, and value of its own, storing that into a database table temporarily until the user selects their joystick (which would then show a base image map.) Then it would run another PHP script that Overlays text onto the base image, basically the script would call from the table, the column, and it value, then insert that at preassigned coordinates based on the Image selected.
However, Because of how Star Citizen/CIG Formated this XML, simpleXML doesnt cut it when it comes to trying to parse it properly, and im having problems finding a simple way to do this. So Below in the spoiler i've added my XML file, my current PHP code for parsing, and a link to my demo page to show whats happening when trying to use simplePHP.
What I am looking for: I need ideas/example code/reference links on how i could do this, or how i could come up with a Windows Application that not only can take that XML and Simplify it, but also then do what i was going to do with the webapp (yes its possible, i looked up some example codes of writing text to an image from a program, just nothing designed how i would use it yet (open market? ;) ).
So anyone with experience that might be able to help me come up with ideas on how to solve my issue please dont hesitate to let me know.
Code:
<ActionMaps version="1" optionsVersion="2" rebindVersion="2" profileName="test_export">
<CustomisationUIHeader label="test_export" description="" image="">
<devices>
<keyboard instance="1"/>
<mouse instance="1"/>
<joystick instance="1"/>
<joystick instance="2"/>
</devices>
<categories>
<category label="@ui_CCSpaceFlight"/>
</categories>
</CustomisationUIHeader>
<deviceoptions name="Joystick - HOTAS Warthog">
<option input="x" deadzone="0.015"/>
<option input="y" deadzone="0.015"/>
</deviceoptions>
<options type="keyboard" instance="1"/>
<options type="joystick" instance="1"/>
<options type="joystick" instance="2"/>
<modifiers />
<actionmap name="spaceship_general">
<action name="v_self_destruct">
<rebind input="js2_button22" multiTap="2"/>
</action>
<action name="v_exit">
<rebind input="js2_button23"/>
</action>
<action name="v_eject">
<rebind input="js1_button19"/>
</action>
<action name="v_toggle_cabin_lights">
<rebind input="js1_button3"/>
</action>
</actionmap>
<actionmap name="spaceship_view">
<action name="v_view_cycle_fwd">
<rebind input="js2_button15"/>
</action>
</actionmap>
<actionmap name="spaceship_movement">
<action name="v_decoupled_strafe_back">
<rebind input="js1_button13"/>
</action>
<action name="v_decoupled_strafe_forward">
<rebind input="js1_button11"/>
</action>
<action name="v_decoupled_strafe_right">
<rebind input="js1_hat1_right"/>
</action>
<action name="v_decoupled_strafe_left">
<rebind input="js1_hat1_left"/>
</action>
<action name="v_decoupled_strafe_down">
<rebind input="js1_hat1_down"/>
</action>
<action name="v_decoupled_strafe_up">
<rebind input="js1_hat1_up"/>
</action>
<action name="v_ifcs_toggle_comstab">
<rebind input="js2_button11"/>
</action>
<action name="v_ifcs_toggle_gforce_safety">
<rebind input="js2_button12"/>
</action>
<action name="v_ifcs_toggle_vector_decoupling">
<rebind input="js2_button9"/>
</action>
<action name="v_roll_right">
<rebind input="js1_button12"/>
</action>
<action name="v_roll_left">
<rebind input="js1_button14"/>
</action>
<action name="v_toggle_landing_system">
<rebind input="js2_button16"/>
</action>
<action name="v_cycle_landing_mode">
<rebind input="js2_button26"/>
</action>
<action name="v_landing_target_lock">
<rebind input="js2_button21"/>
</action>
<action name="v_toggle_qdrive_system">
<rebind input="js2_button24"/>
</action>
<action name="v_toggle_qdrive_engagement">
<rebind input="js2_button25"/>
</action>
<action name="v_decoupled_roll_right">
<rebind input="js1_button12"/>
</action>
<action name="v_decoupled_roll_left">
<rebind input="js1_button14"/>
</action>
<action name="v_afterburner">
<rebind input="js2_button2"/>
</action>
<action name="v_decoupled_brake">
<rebind input="js2_button1"/>
</action>
<action name="v_ifcs_mode_shift">
<rebind input="js2_button32"/>
</action>
<action name="v_strafe_back">
<rebind input="js1_button13"/>
</action>
<action name="v_strafe_forward">
<rebind input="js1_button11"/>
</action>
<action name="v_strafe_right">
<rebind input="js1_hat1_right"/>
</action>
<action name="v_strafe_left">
<rebind input="js1_hat1_left"/>
</action>
<action name="v_strafe_down">
<rebind input="js1_hat1_down"/>
</action>
<action name="v_strafe_up">
<rebind input="js1_hat1_up"/>
</action>
<action name="v_target_match_vel">
<rebind input="js2_button7"/>
</action>
<action name="v_brake">
<rebind input="js2_button1"/>
</action>
<action name="v_throttle_abs">
<rebind input="js2_z"/>
</action>
</actionmap>
<actionmap name="spaceship_targeting">
<action name="v_toggle_weapon_gimbal_lock">
<rebind input="js2_button13"/>
</action>
<action name="v_target_reticle_focus">
<rebind input="js1_ "/>
</action>
<action name="v_target_cycle_all_fwd">
<rebind input="js2_hat1_down"/>
</action>
<action name="v_target_cycle_friendly_fwd">
<rebind input="js2_hat1_up"/>
</action>
<action name="v_target_head_tracking">
<rebind input="js1_button9"/>
</action>
<action name="v_target_nearest_hostile">
<rebind input="js1_button5"/>
</action>
<action name="v_target_cycle_hostile_fwd">
<rebind input="js2_hat1_left"/>
</action>
<action name="v_target_missile_lock_focused">
<rebind input="js1_button2"/>
</action>
<action name="v_target_cycle_pinned_fwd">
<rebind input="js2_hat1_right"/>
</action>
<action name="v_target_toggle_pinned_focused">
<rebind input="js2_button14"/>
</action>
<action name="v_aim_pitch_down">
<rebind input="js1_ "/>
</action>
<action name="v_aim_pitch_up">
<rebind input="js1_ "/>
</action>
<action name="v_aim_yaw_right">
<rebind input="js1_ "/>
</action>
<action name="v_aim_yaw_left">
<rebind input="js1_ "/>
</action>
</actionmap>
<actionmap name="spaceship_weapons">
<action name="v_attack1_group2">
<rebind input="js1_button6"/>
</action>
</actionmap>
<actionmap name="spaceship_missiles">
<action name="v_weapon_launch_missile">
<rebind input="js1_button2"/>
</action>
</actionmap>
<actionmap name="spaceship_defensive">
<action name="v_weapon_cycle_countermeasure_fwd">
<rebind input="js1_button17"/>
</action>
<action name="v_weapon_launch_countermeasure">
<rebind input="js1_button15"/>
</action>
</actionmap>
</ActionMaps>
Code:
<html>
<body>
<?php if ($_SERVER['REQUEST_METHOD'] == 'GET') { ?>
<form method="post" action="<?php echo $_SERVER['SCRIPT_NAME'] ?>"
enctype="multipart/form-data">
<input type="file" name="doc"/>
<input type="submit" value="Send File"/>
</form>
<?php } else {
if (isset($_FILES['doc']) && ($_FILES['doc']['error'] == UPLOAD_ERR_OK)) {
$xml = simplexml_load_file($_FILES['doc']['tmp_name']);
foreach($xml->children() as $actions) {
echo $actions->action[0]['name'] . ", ";
echo $actions->action[1]['name'] . ", <br>";
echo $actions->action[2]['name'] . ", ";
}
} else {
print "No valid file uploaded.";
}
}
?>
</body>
</html>
Test Weblink:
http://ripcord-test_squadron.site88.net/xml_parse_test.php
Note: Right now, you can just hit "Send File" i have my XML uploaded for testing and example purposes.