amurph0 wrote:Thanks Nividium.
How can i link this to the ship command menu. There is a tutorial for making commands somewhere ain't there?
To create and link a command to a script, you need to create a t-file and a setup script. The t-file creates the button ie command that shows up on a ships command menu and the setup script links the command to the main script or points to it for execution.
Your t-file should contain the following code: (substitute the <t id with one that is available within the "custom", "special" or "general command slots etc, see list). Then save the t-file, check for an available number in the list ie: 7095-L044.xml.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<language id="44">
<!-- Setup Name Prefix Command Button Slot -->
<page id="2008" title="Script Object Commands" descr="">
<t id="857">COMMAND_NAME_PREFIX</t>
</page>
<page id="2010" title="Script Cmd Names" descr="">
<t id="857">Name Prefix</t>
</page>
<page id="2011" title="Script Cmd Shorts" descr="">
<t id="857">NP</t>
</page>
<page id="2022" title="Command Info" descr="">
<t id="857">This area is used for a description text for when the player presses the i key. Put what you want in here.\n</t>
</page>
</language>
Your setup file needs to point to your main script and uses the t-file to bind the command button to your main script. So, put in something like this: (then save the file as setup.name.prefix)
Code: Select all
001 load text: id=7095
002 global script map: set: key=COMMAND_TYPE_GENERAL_57, class=Moveable Ship, race=Player, script='my.main.script.file.name', prio=0
003 set script command upgrade: command=COMMAND_TYPE_GENERAL_57 upgrade=[true]
004 return null