Hello,
I am writing set of scripts for parsing save file and analyzing economy and ship statuses. As part of this I want to know where I can find which action represented by which line in text resources.
for example I think "commandaction.docking" is displayed in ship info as "Docking"
<page id="1011" title="AI Commands" descr="0" voice="no">
<t id="1008">Docking</t>
Where can I find all commands mapping to text?
Text lines for AI command states
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Moderator (Script&Mod)
- Posts: 14571
- Joined: Sun, 20. Nov 05, 22:45
shouldnt they be referenced in the {Text-Id,PageID} format, like for your example {1011,1008} ?
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

-
- Moderator (Script&Mod)
- Posts: 13489
- Joined: Sun, 15. Feb 04, 20:12
Re: Text lines for AI command states
Hi solntcev
Cheers Euclid

The pid 1011 covers all those commands. I'm not sure what else you are looking for.solntcev wrote: ........
Where can I find all commands mapping to text?
Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786
-
- Posts: 357
- Joined: Thu, 27. Jun 13, 18:33
Re: Text lines for AI command states
I have not found references to 1011 lines in this format in game XML files.UniTrader wrote:shouldnt they be referenced in the {Text-Id,PageID} format, like for your example {1011,1008} ?
But somewhere they listed, because in game UI, they are translated.
Yes, it covers, but I want fo find mapping table for "command" -> "1011 text line". I don't want to make it manually, in case new commands will appear in future updates.euclid wrote: The pid 1011 covers all those commands. I'm not sure what else you are looking for.
But I suspect it may be hardcoded in game exe file

-
- Posts: 236
- Joined: Mon, 29. Dec 03, 15:22
-
- Posts: 357
- Joined: Thu, 27. Jun 13, 18:33
-
- Posts: 585
- Joined: Thu, 26. Feb 04, 00:08
Commands are set using:
As far as I know the t file interpretations are used exclusively in the UI as only the UI can display text that is meaningful to the player. The command status of a ship relates to its controlling npc and operates as a stack, so you will find code in the UI Lua files (now available as source in 3.50 b1) such as: as an example of how to parse the command data and format it into a variable called "updatetext".
You can then write the variable into a cell in the UI or to the log book/debug log.
If you just want to set the command or know what the ship is doing in an AI script then the set_command, set_command_action functions and the command.action lookup properties for each npc commander are what you need - you can find all of these documented in /libraries/aiscripts.xsd. and scriptproperties.html in the root game folder.
Keep in mind also that you cannot display anything in the UI directly from AI scripts unless you write a UI (Lua) script that parses the data and writes it to a widget in the UI. The exception to this is that you can write directly to the logbook and also place help messages on the centre of the screen.
Hope this helps
Wysi
Code: Select all
<set_command command="command.freetrade" />
<set_command_action commandaction="commandaction.searchingtrades" />
Code: Select all
-- Get userdata values for command stack from npc
local aicommandstack, aicommand, aicommandparam, aicommandaction, aicommandactionparam = GetComponentData(npc_id, "aicommandstack", "aicommand", "aicommandparam", "aicommandaction", "aicommandactionparam")
local numaicommands = #aicommandstack
if 0 < numaicommands then
aicommand = aicommandstack[1].command
aicommandparam = aicommandstack[1].param
end
updatetext = tostring(updatetext .. "" .. ReadText(1001, 78) ..
ReadText(1001, 120) .. " " ..
string.format(aicommand, (IsComponentClass(aicommandparam, "component") and GetComponentData(aicommandparam, "name")) or nil))
if 1 < numaicommands then
aicommandaction = aicommandstack[numaicommands].command
aicommandactionparam = aicommandstack[numaicommands].param
end
if aicommandaction ~= "" then
updatetext = tostring(updatetext .. " - " .. string.format(aicommandaction, (IsComponentClass(aicommandactionparam, "component") and GetComponentData(aicommandactionparam, "name")) or nil))
end
You can then write the variable into a cell in the UI or to the log book/debug log.
If you just want to set the command or know what the ship is doing in an AI script then the set_command, set_command_action functions and the command.action lookup properties for each npc commander are what you need - you can find all of these documented in /libraries/aiscripts.xsd. and scriptproperties.html in the root game folder.
Keep in mind also that you cannot display anything in the UI directly from AI scripts unless you write a UI (Lua) script that parses the data and writes it to a widget in the UI. The exception to this is that you can write directly to the logbook and also place help messages on the centre of the screen.
Hope this helps
Wysi

-
- Posts: 2774
- Joined: Tue, 29. Oct 13, 21:59
Look in libraries/aiscripts.xsd forsolntcev wrote:Yes, but where exactly can I find, that "command.explore" action is displayed as {1011,27} in UI?
Where I can find list of ALL actions and their text lines?
Code: Select all
<xs:simpleType name="commandlookup">
X Rebirth - A Sirius Cybernetics Corporation Product
Split irritate visiting pilot with strange vocal patterns.
Split irritate visiting pilot with strange vocal patterns.