Player Interaction/Hotkeys
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
Player Interaction/Hotkeys
I started today another little project and it looks good so far, but i need direct Player Interaction, meaning the Player must have the possibility to trigger an MD event at will while being on a Platform. I cannt use any NPC interaction / dialogue Start because the looking direction of the Player is part of the functionality. Currently i am abusing the <event_ui_triggered screen="'MapMenu'" control="''" comment="Map"/> but this has the downside that the Map appears every time i trigger the Action. i also considered getting the Player Jump interaction, but i didnt find a way to get it with an Event.
Do you have further ideas about possible events i could abuse? Theorhetical Stuff you think which may work but never actually used is also fine.
Do you have further ideas about possible events i could abuse? Theorhetical Stuff you think which may work but never actually used is also fine.
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
nope. Commanding Capships like a Commander -> imagine staying on your Bridge and saying "Attack this Destroyer over there" while pointing/looking in its direction instead of finding it through the Map (and your 1★ Captain misunderstands and starts boosting in the Zone behind it )
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
That's pretty similar to what I've been wanting it for -- a squad broadcast commands hotkey to make an "attack my target" option viable, and a "speed dialer" hotkey mod to bring up comms with pre-assigned ship/group commanders + "attack my target" command options.
Have you had any luck getting a target (or even direction) indicated in first person mode? I hadn't even thought of that.
Have you had any luck getting a target (or even direction) indicated in first person mode? I hadn't even thought of that.
it was far too simple:
to avoid unnecesary (and probably expensive) search operations with looking direction i only search once per call for all possible Objects and sort them into Categories after that.
The Position is untested so far if the Result is what i actually want - currently working on the Menu Stuff instead.
PS could you explain me how in lua the Calls for Opening Menus are received? i am not that familiar with it yet. Best by quoting the concrete example of how the Sector/Zone Map is called (by the , or . hotkey) - maybe that leads to a solution because its easy to add custion Hotkeys to the default Control Profiles, but in AI/MD there is no way to receive their Event.. maybe we can get it in lua?
Code: Select all
<!-- Get Objects in the Line-of-Sight of the Player -->
<find_object name="$Objects" space="player.zone" multiple="true" known="true" >
<match_is_in_view_of object="player.entity" vertical="30deg" horizontal="30deg"/>
</find_object>
<find_zone name="$Zones" space="player.sector" multiple="true" known="true" tempzone="false" priorityzone="true">
<match_is_in_view_of object="player.entity" vertical="30deg" horizontal="30deg"/>
</find_zone>
<!-- Create Point where the Player looks to -->
<create_position name="$Position" space="player.sector" object="player.entity" z="30km"/>
<!-- Sort found Objects into categories -->
<create_list name="$Enemies" />
<create_list name="$Moveables" />
<create_list name="$Unmoveables" />
<do_all exact="$Objects.count" counter="$i">
<do_if value="$Objects.{$i}.hasrelation.enemy.{faction.player}" >
<append_to_list list="$Enemies" exact="$Objects.{$i}" />
</do_if>
<do_if value="$Objects.{$i}.isclass.ship" >
<append_to_list list="$Moveables" exact="$Objects.{$i}" />
</do_if>
<do_if value="$Objects.{$i}.isclass.station or $Objects.{$i}.isclass.asteroid" >
<append_to_list list="$Unmoveables" exact="$Objects.{$i}" />
</do_if>
<!-- in case of a Gate add its Destination Zone to the Zone List instead of sorting it somewhere else -->
<do_if value="$Objects.{$i}.isclass.gate">
<append_to_list list="$Zones" exact="$Objects.{$i}.destination" />
</do_if>
</do_all>
The Position is untested so far if the Result is what i actually want - currently working on the Menu Stuff instead.
PS could you explain me how in lua the Calls for Opening Menus are received? i am not that familiar with it yet. Best by quoting the concrete example of how the Sector/Zone Map is called (by the , or . hotkey) - maybe that leads to a solution because its easy to add custion Hotkeys to the default Control Profiles, but in AI/MD there is no way to receive their Event.. maybe we can get it in lua?
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Re: Player Interaction/Hotkeys
what i did with Betty AI 2015 mod is intercept the "Player Properties" menu so that it doesn't show the fleet but instead show player choices that my mod made. the mod choices then have to include an option to open the "Player Properties" ... in your settings you must set a shortcut key for "Player Properties". i have mine set to the number 1 so every time i press 1 Betty's choices popup then i have to select "Fleet" for "Player Properties" ...UniTrader wrote:I started today another little project and it looks good so far, but i need direct Player Interaction, meaning the Player must have the possibility to trigger an MD event at will while being on a Platform. I cannt use any NPC interaction / dialogue Start because the looking direction of the Player is part of the functionality. Currently i am abusing the <event_ui_triggered screen="'MapMenu'" control="''" comment="Map"/> but this has the downside that the Map appears every time i trigger the Action. i also considered getting the Player Jump interaction, but i didnt find a way to get it with an Event.
Do you have further ideas about possible events i could abuse? Theorhetical Stuff you think which may work but never actually used is also fine.
but the sad thing is that the OPTIONS menu only have a limited number of menus with shortcut keys. wish they can allow an event to listen for a specific key press.
yeah that could actually work. and is more accurate than the player view which can have multiple enemies.Vim Razz wrote:That's pretty similar to what I've been wanting it for -- a squad broadcast commands hotkey to make an "attack my target" option viable, and a "speed dialer" hotkey mod to bring up comms with pre-assigned ship/group commanders + "attack my target" command options.
Have you had any luck getting a target (or even direction) indicated in first person mode? I hadn't even thought of that.
no player Target in first Person GameplayJ3ANP3T3R wrote:yeah that could actually work. and is more accurate than the player view which can have multiple enemies.Vim Razz wrote:That's pretty similar to what I've been wanting it for -- a squad broadcast commands hotkey to make an "attack my target" option viable, and a "speed dialer" hotkey mod to bring up comms with pre-assigned ship/group commanders + "attack my target" command options.
Have you had any luck getting a target (or even direction) indicated in first person mode? I hadn't even thought of that.
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
- YorrickVander
- Posts: 2705
- Joined: Tue, 29. Oct 13, 21:59
Not 100% sure it would work, but it might be possible to hijack the T keypress by using \ui\core\Lua\Ability Menu Handling.lua. I don't have time to test ideas on this but it at least has potential. As the drone launching can now also be done via sidebar it doesn't break any game controls.
X Rebirth - A Sirius Cybernetics Corporation Product
Split irritate visiting pilot with strange vocal patterns.
Split irritate visiting pilot with strange vocal patterns.
OH ! haha ... sorry i did not read the whole thread your aim is for 3rd person ? im guessing this is for when you are inside a capital ship control room right ? with lituen capital ship bridge mod and you can order your ships to attack what you see on the screen ? what about that match in view thing you mentioned ? did it work ? if not then how about switching it to your ship's view instead of the player's view. probably increase the angle a bit as well as the distance. so it would depend on the distance versus angle ... also use distance to determine which target is chosen if multiple targets are on the same view. like the nearest target is the main target or the nearest bigger ship is the main target to attack.UniTrader wrote:no player Target in first Person GameplayJ3ANP3T3R wrote:yeah that could actually work. and is more accurate than the player view which can have multiple enemies.Vim Razz wrote:That's pretty similar to what I've been wanting it for -- a squad broadcast commands hotkey to make an "attack my target" option viable, and a "speed dialer" hotkey mod to bring up comms with pre-assigned ship/group commanders + "attack my target" command options.
Have you had any luck getting a target (or even direction) indicated in first person mode? I hadn't even thought of that.
it worked great - i Navigated a Taranis from one End of the Universe to the other only using this (and sometimes consulted the Map when i coulnt locate some Objects)
It also gave me the impression something like this was planned at some point because there are Orientation Points for all Sectors in each Cluster (for example the Giantsolarplant in DV points to Barren Heart with its bottom tip - without it you wouldnt have any chance locating it) - sadly this doesnt apply to TO, there you have to guess mostly if you want to travel from one Sector to the other
Until i can have a Hotkey for myself this Mod is suspended though, but in the long run yes, i will improve the Selection.. currently it is still god enough i think because its very rare to have more than 7 Capships in nearly a line (which would cause some ot them to be omited), it just could get confusing if there is more than one Ship with the same Name targeted
related to the T Hotkey: that would work for my Purpose i think - it is usually not available on Platforms (but i can enable it there) and lua can differ between in Space and on Platform for sure - so in Space use its usual behavior and on Platform signal an MD-Script..
It also gave me the impression something like this was planned at some point because there are Orientation Points for all Sectors in each Cluster (for example the Giantsolarplant in DV points to Barren Heart with its bottom tip - without it you wouldnt have any chance locating it) - sadly this doesnt apply to TO, there you have to guess mostly if you want to travel from one Sector to the other
Until i can have a Hotkey for myself this Mod is suspended though, but in the long run yes, i will improve the Selection.. currently it is still god enough i think because its very rare to have more than 7 Capships in nearly a line (which would cause some ot them to be omited), it just could get confusing if there is more than one Ship with the same Name targeted
related to the T Hotkey: that would work for my Purpose i think - it is usually not available on Platforms (but i can enable it there) and lua can differ between in Space and on Platform for sure - so in Space use its usual behavior and on Platform signal an MD-Script..
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
i hope you can find the answer to your hotkey problems... being able to command ships while on a capital ship is very useful and i cant wait till you upload the final version. and when you can this could actually help those who were requesting to be able to commandeer a capital ship. like just press this and that and the ship complies.UniTrader wrote:it worked great - i Navigated a Taranis from one End of the Universe to the other only using this (and sometimes consulted the Map when i coulnt locate some Objects)
It also gave me the impression something like this was planned at some point because there are Orientation Points for all Sectors in each Cluster (for example the Giantsolarplant in DV points to Barren Heart with its bottom tip - without it you wouldnt have any chance locating it) - sadly this doesnt apply to TO, there you have to guess mostly if you want to travel from one Sector to the other
Until i can have a Hotkey for myself this Mod is suspended though, but in the long run yes, i will improve the Selection.. currently it is still god enough i think because its very rare to have more than 7 Capships in nearly a line (which would cause some ot them to be omited), it just could get confusing if there is more than one Ship with the same Name targeted
related to the T Hotkey: that would work for my Purpose i think - it is usually not available on Platforms (but i can enable it there) and lua can differ between in Space and on Platform for sure - so in Space use its usual behavior and on Platform signal an MD-Script..
i have just looked into the Hotkey part for my Project, and i think i found how hotkeys are handled:
from ui\addons\ego_detailmonitor\menu_map.luais the handler of the Hotkey Event it seems.
from ui\addons\ego_detailmonitor\ui.xmlthese seems to define the available Hotkeys for Menus. Question is if we may add custom ones in the related Game files (libraries/inputmap.xml and libraries/contexts.xml) and they work then or if more is necesary.. or if these are even hardcoded.. and if its possible to catch Hotkey Events without any Menu open.. maybe some invisible permanent-open Menu which catches all HK events and signals the Events to AIscripts/MD?
note: i may had a look today, but i am still a complete noob with lua - be nice to me
from ui\addons\ego_detailmonitor\menu_map.lua
Code: Select all
function menu.hotkey(action)
local rowdata = Helper.currentTableRowData
if rowdata ~= "back" then
if action == "INPUT_ACTION_ADDON_DETAILMONITOR_G" then
if rowdata and rowdata[1] == "child" then
MovePlayerToZone(rowdata[2])
end
from ui\addons\ego_detailmonitor\ui.xml
Code: Select all
………
<bindings context="INPUT_CONTEXT_ADDON_DETAILMONITOR" alwaysactive="false">
<binding action="INPUT_ACTION_ADDON_DETAILMONITOR_G" />
<binding action="INPUT_ACTION_ADDON_DETAILMONITOR_C" />
<binding action="INPUT_ACTION_ADDON_DETAILMONITOR_I" />
<binding action="INPUT_ACTION_ADDON_DETAILMONITOR_A_SHIFT" />
<binding action="INPUT_ACTION_ADDON_DETAILMONITOR_COMMA" />
<binding action="INPUT_ACTION_ADDON_DETAILMONITOR_RIGHT" />
<binding action="INPUT_ACTION_ADDON_DETAILMONITOR_LEFT" />
</bindings>
…………
note: i may had a look today, but i am still a complete noob with lua - be nice to me
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
here is a sample hijack i made with the Mainmenu.xml
<diff>
<replace
sel='/mdscript[@name="MainMenu"]/cues/cue[@name="PropertyMenuStarted"]/actions'>
<actions>
<signal_cue_instantly cue="md.bettyAI.SectionHandler_BettyAI" param="100"/>
<!-- open_conversation_menu menu="PropertyMenu" param="[0, 0, 'player']" param2="event.param3" / -->
<!-- add_conversation_view view="closeupdetailmonitor" / -->
</actions>
so now instead of the "PropertyMenu" menu popping up when i press the shortcut key for "PropertyMenu" my md script choices appear without any window open. i just add the "PropertyMenu" choice in there.
</replace>
</diff>
<diff>
<replace
sel='/mdscript[@name="MainMenu"]/cues/cue[@name="PropertyMenuStarted"]/actions'>
<actions>
<signal_cue_instantly cue="md.bettyAI.SectionHandler_BettyAI" param="100"/>
<!-- open_conversation_menu menu="PropertyMenu" param="[0, 0, 'player']" param2="event.param3" / -->
<!-- add_conversation_view view="closeupdetailmonitor" / -->
</actions>
so now instead of the "PropertyMenu" menu popping up when i press the shortcut key for "PropertyMenu" my md script choices appear without any window open. i just add the "PropertyMenu" choice in there.
</replace>
</diff>
nice idea, but i think i am on the way to real custom Hotkeys, not just stealing the EGO ones.. aviods complications when we run out of Menus we could steal
think i will get a bit into lua today - just to pass random Hotkey Events to the MD so it can be used as lib instead of being a special solution...
think i will get a bit into lua today - just to pass random Hotkey Events to the MD so it can be used as lib instead of being a special solution...
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
sorry for double-post but i think this is interesting for everone here:
=> Game does not accept custom Hotkeys when adding them to both contexts.xml and inputmap.xml:
[XML ] Failed to parse string 'INPUT_ACTION_UT_PC' in node 'action', attribute 'id' at line 4 of file 'libraries/contexts.(pck|xml)' as enum value.
[General] ======================================
[=ERROR=] Invalid action specified in context data: INPUT_ACTION_UT_PC
=> also the binding i mentoined earlier is not available for Custom UI Elements:
[=ERROR=] LIBXML2: file:///extensions%2FUTUITest%2Fui.xml?ext=pck%20xml line 6, error 1871: Element 'bindings': This element is not expected. Expected is one of ( file, dependency, savedvariable ).
[General] ======================================
[General] ======================================
[=ERROR=] XLib::XMLValidateAgainstSchema(): Document 'file:///extensions%2FUTXUITest%2Fui.xml?ext=pck%20xml' failed validation against schema 'file:///ui%2Fcore%2Faddon.xsd?ext=xsd' - Errorcode: 1871.
[General] ======================================
[General] ======================================
[=ERROR=] AddonManager::LoadAddonInfos(): Failed to load extension addon info file '': 'Error loading from XML file 'extensions/UTXUITest/ui.xml'. Check the log for further information.'
if someone wants to try further here my File contents - i give up at this point for now:
ui.xml
libraries/contexts.xml
libraries/inputmap.xml
also my first lua script which is probably wrong anyway, but also had never any chance to actually be used: ui/ut_lib_hotkey.lua:
=> Game does not accept custom Hotkeys when adding them to both contexts.xml and inputmap.xml:
[XML ] Failed to parse string 'INPUT_ACTION_UT_PC' in node 'action', attribute 'id' at line 4 of file 'libraries/contexts.(pck|xml)' as enum value.
[General] ======================================
[=ERROR=] Invalid action specified in context data: INPUT_ACTION_UT_PC
=> also the binding i mentoined earlier is not available for Custom UI Elements:
[=ERROR=] LIBXML2: file:///extensions%2FUTUITest%2Fui.xml?ext=pck%20xml line 6, error 1871: Element 'bindings': This element is not expected. Expected is one of ( file, dependency, savedvariable ).
[General] ======================================
[General] ======================================
[=ERROR=] XLib::XMLValidateAgainstSchema(): Document 'file:///extensions%2FUTXUITest%2Fui.xml?ext=pck%20xml' failed validation against schema 'file:///ui%2Fcore%2Faddon.xsd?ext=xsd' - Errorcode: 1871.
[General] ======================================
[General] ======================================
[=ERROR=] AddonManager::LoadAddonInfos(): Failed to load extension addon info file '': 'Error loading from XML file 'extensions/UTXUITest/ui.xml'. Check the log for further information.'
if someone wants to try further here my File contents - i give up at this point for now:
ui.xml
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<addon xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="ut_lib_hotkey" xsi:noNamespaceSchemaLocation="http://utnas/~unitrader/XRebirthxsds/addon.xsd">
<environment type="fullscreen">
<file name="ui/ut_lib_hotkey.lua"/>
<dependency name="ego_fullscreenHelper"/>
<bindings context="INPUT_CONTEXT_BASE" alwaysactive="true">
<action id="INPUT_ACTION_STOP"/>
<action id="INPUT_ACTION_TOGGLECURSOR"/>
<action id="INPUT_ACTION_SCREENSHOT"/>
<action id="INPUT_ACTION_PAUSE"/>
<action id="INPUT_ACTION_DEBUG_FEATURE_1"/>
<action id="INPUT_ACTION_DEBUG_FEATURE_2"/>
<action id="INPUT_ACTION_TOGGLECOCKPIT"/>
<action id="INPUT_ACTION_TOGGLE_AUTOPILOT"/>
<action id="INPUT_ACTION_MUTE"/>
<action id="INPUT_ACTION_UT_PC"/>
<state id="INPUT_STATE_MOUSECLICK"/>
</bindings>
</environment>
</addon>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<diff>
<add sel="//context[@id="INPUT_CONTEXT_BASE"]">
<action id="INPUT_ACTION_UT_PC"/>
</add>
</diff>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<diff>
<add sel="/inputmap">
<action id="INPUT_ACTION_UT_PC" source="INPUT_SOURCE_KEYBOARD" code="INPUT_KEYCODE_E" />
</add>
</diff>
Code: Select all
local function init()
RegisterAddonBindings("ut_lib_hotkey")
end
local menu = {
name = "HotkeyCatcherFake"
}
function menu.hotkey(action)
AddUITriggeredEvent("Hotkey", action)
end
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help