[MOD] Manual Command Extension v0.10.2 {Discontinued}
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
Black_Sails
- Posts: 95
- Joined: Wed, 1. Aug 07, 06:35

I've been digging through the aiscripts, and I just don't get it-why can't our player owned ships utilize these types of functions:
move.refuel -looks like scripting for the ship to look for fuel trade offers, dock + purchase fuel. Although I'm guessing this is what happens when the captain complains there isn't enough fuel and you click on the window and tell him to find fuel?
move.patrol
move.seekenemies
move.escort
multiple fight scripts. and fight.defend.capital.
I'm trying to learn how these scripts link into the game, if they do in fact exist. Like since the defense officers "orders" are set to defending, is it supposed to be calling the fight.defend.capital script? I can't find the file that specifies this.
Another idea I have is that when you recruit officers, they keep their current faction relations, so won't engage? I thought about toying with the hireable NPC faction settings to perhaps player and experimenting with what happens but I'm assuming massive game breakage lol. Still having difficulties locating the actually hireable NPCs though-I found a file in libraries, characters.xml but I'm not sure this is exactly what I'm looking for.
move.refuel -looks like scripting for the ship to look for fuel trade offers, dock + purchase fuel. Although I'm guessing this is what happens when the captain complains there isn't enough fuel and you click on the window and tell him to find fuel?
move.patrol
move.seekenemies
move.escort
multiple fight scripts. and fight.defend.capital.
I'm trying to learn how these scripts link into the game, if they do in fact exist. Like since the defense officers "orders" are set to defending, is it supposed to be calling the fight.defend.capital script? I can't find the file that specifies this.
Another idea I have is that when you recruit officers, they keep their current faction relations, so won't engage? I thought about toying with the hireable NPC faction settings to perhaps player and experimenting with what happens but I'm assuming massive game breakage lol. Still having difficulties locating the actually hireable NPCs though-I found a file in libraries, characters.xml but I'm not sure this is exactly what I'm looking for.
-
Baleur
- Posts: 587
- Joined: Fri, 28. Oct 05, 13:37

-
rifter08
- Posts: 43
- Joined: Sat, 8. Sep 12, 03:33

-
Tyrant597
- Posts: 299
- Joined: Wed, 9. Apr 08, 05:52

On a scale of 1 to [X-Rebirth: Release] =) How bad would this be for aborting running scripts on a ship?
Code: Select all
<get_control_entities object="$target" groupname="$ControlEntities"/>
<do_all exact="$ControlEntities.count" counter="$Counter">
<abort_scripts entity="$ControlEntities.{$Counter}"/>
You don't talks about X:Rebirth...
X4 Mods: Collect Inventory Wares Stations Supply Build Storage Mass Move Marines
X4 Mods: Collect Inventory Wares Stations Supply Build Storage Mass Move Marines
-
Jack08
- Posts: 2993
- Joined: Sun, 25. Dec 05, 10:42

Im not sure what your asking, "Clear All Orders" is pretty much forfiled by "Hold Position", no?aegisx wrote:Nice work!
Would a Clear all Orders command be possible? Or how about a Show Orders?
I am aware that the construction ship doesn't seem to have the menu options, however thanks for the report - i did not know that the architect menu option is in the same place however, i will look into that!Bean03 wrote:Bug Report:
The new order command does not show on construction vehicles. This may be due to the Call Architect option that is available under my ship.
This may have nothing to do with your mod but I thought i'd point it out since this prevents these ships from utilizing your mod.
You may want to add in a check that the New Order menu option is available and if it is not create it in an open slot. Menu item 4 is empty for me in this situation.
I have experienced this in the standard game, "Take me to..." doesn't seem to work very well at the moment.Petroph wrote:I think I may have found a potential bug. If you add a ship to your squad. And ask it to take you somewhere, and he completes the order, the ship gets locked up and the game freezes. Not sure if this has anything to do with telling the ship to hold position prior to issuing the order to take me somewhere.
This is what this mod is designed to do, bridge the gap between the code back end and your user interface - alot of the code needed for these commands already exists in the game (some are going to need modification or special writing) but for the majority all im doing is safely overriding the AI and telling it what to do, rather then have the AI try to decide whats best, which it never does.Black_Sails wrote:I've been digging through the aiscripts, and I just don't get it-why can't our player owned ships utilize these types of functions:
move.refuel -looks like scripting for the ship to look for fuel trade offers, dock + purchase fuel. Although I'm guessing this is what happens when the captain complains there isn't enough fuel and you click on the window and tell him to find fuel?
move.patrol
move.seekenemies
move.escort
multiple fight scripts. and fight.defend.capital.
I'm trying to learn how these scripts link into the game, if they do in fact exist. Like since the defense officers "orders" are set to defending, is it supposed to be calling the fight.defend.capital script? I can't find the file that specifies this.
Another idea I have is that when you recruit officers, they keep their current faction relations, so won't engage? I thought about toying with the hireable NPC faction settings to perhaps player and experimenting with what happens but I'm assuming massive game breakage lol. Still having difficulties locating the actually hireable NPCs though-I found a file in libraries, characters.xml but I'm not sure this is exactly what I'm looking for.
I am actually working on move.refuel at the moment, it doesn't seem to want to function.
Now the defense officer on the other hand i dont understand, it seems in this iteration of X ships only have one script stack, im starting to think turret targeting and attack protocols are in the EXE.
I have not looked into officer relations, im not sure if they are relevant or not, but without the ability to see the turret code, because i cant find it, i cant really say for sure.
-
Jack08
- Posts: 2993
- Joined: Sun, 25. Dec 05, 10:42

Extremely, Extremely Bad.Tyrant597 wrote:On a scale of 1 to [X-Rebirth: Release] =) How bad would this be for aborting running scripts on a ship?
Code: Select all
<get_control_entities object="$target" groupname="$ControlEntities"/> <do_all exact="$ControlEntities.count" counter="$Counter"> <abort_scripts entity="$ControlEntities.{$Counter}"/>
I do something similar, however i've made sure im not going to terminate something sensitive, like a trade script. Also, if you terminate a jump script, you can potentially leave the ship in a dirty state, deadlocking it - something MCE doesnt protect you from yet.
-
Dungeoncrawler
- Posts: 1093
- Joined: Sun, 7. Dec 03, 05:32

-
Jack08
- Posts: 2993
- Joined: Sun, 25. Dec 05, 10:42

-
Black_Sails
- Posts: 95
- Joined: Wed, 1. Aug 07, 06:35

I worked abit, using your code as a base (as at that point, I wasn't exactly sure how to add things into menus). I mimicked your style of adding new commands by modifying the relevant files, with the same syntax, and added in move.patrol, move.escort, move.seekenemies, but I kept seeing errors in the uimenu.xml file in the documents directory. It seems that there is a coding error in egosofts seekenemies script-I was seeing errors there before I even started adding mods or playing with them myself. And since it looks like the patrol script depends on seekenemies, I'm assuming thats why it didn't work.Jack08 wrote:This is what this mod is designed to do, bridge the gap between the code back end and your user interface - alot of the code needed for these commands already exists in the game (some are going to need modification or special writing) but for the majority all im doing is safely overriding the AI and telling it what to do, rather then have the AI try to decide whats best, which it never does.Black_Sails wrote:I've been digging through the aiscripts, and I just don't get it-why can't our player owned ships utilize these types of functions:
move.refuel -looks like scripting for the ship to look for fuel trade offers, dock + purchase fuel. Although I'm guessing this is what happens when the captain complains there isn't enough fuel and you click on the window and tell him to find fuel?
move.patrol
move.seekenemies
move.escort
multiple fight scripts. and fight.defend.capital.
I'm trying to learn how these scripts link into the game, if they do in fact exist. Like since the defense officers "orders" are set to defending, is it supposed to be calling the fight.defend.capital script? I can't find the file that specifies this.
Another idea I have is that when you recruit officers, they keep their current faction relations, so won't engage? I thought about toying with the hireable NPC faction settings to perhaps player and experimenting with what happens but I'm assuming massive game breakage lol. Still having difficulties locating the actually hireable NPCs though-I found a file in libraries, characters.xml but I'm not sure this is exactly what I'm looking for.
I am actually working on move.refuel at the moment, it doesn't seem to want to function.
Now the defense officer on the other hand i dont understand, it seems in this iteration of X ships only have one script stack, im starting to think turret targeting and attack protocols are in the EXE.
I have not looked into officer relations, im not sure if they are relevant or not, but without the ability to see the turret code, because i cant find it, i cant really say for sure.
I couldn't get the escort script to work as I couldn't figure out the proper syntax to designate the player's ship as a target. I continued to receive an error about how the target param was not passed onto the escort script, which requires a target to function.
Code: Select all
["message"]="Error: When calling script move.escort on entity 0xAD5D - script parameter \"target\" was not provided!",},
[2485.000000]={Code: Select all
["message"]="Error: Error in AI script move.seekenemies on entity 0x1268F: Property lookup failed: this.ship.distanceto.[component.{0x65ccL},position.[-27745.275391m, -823.915649m, 7077.757813m]]\
* Expression: this.ship.distanceto.[$destination, $pos]",},I also dug around and was unable to find any scripts relating to the turrets or defense officer on the ship. Another thing I was trying to figure out..how would you be able to select a ship from within the game, specify it as the "target", and pass that back into the script for an "attack selected target" style command?
I hope you don't mind me playing around with your code-I have no intentions on posting anything that I manage to get working as a mod. I haven't modded before but felt a strong desire to upon seeing the scripts existing..but for some reason, unused within the game.
-
swatti
- Posts: 1278
- Joined: Sun, 7. Dec 03, 12:03

It took days for you to make what Egosoft could not in years... Wow...
ISSUE:
Captured/boarded a Fedhelm, a mining-ship and it has no docking-ports of any kind by the looks of it, thus i cant transfer a captain or assignt it to my squad, can i use this mod to make it move or somethin? My marine-officer is stuck onboard along with my stupidly expensive marines.
ISSUE:
Captured/boarded a Fedhelm, a mining-ship and it has no docking-ports of any kind by the looks of it, thus i cant transfer a captain or assignt it to my squad, can i use this mod to make it move or somethin? My marine-officer is stuck onboard along with my stupidly expensive marines.
-
Black_Sails
- Posts: 95
- Joined: Wed, 1. Aug 07, 06:35

Also-about the turrets. This is the only relevant code I've found so far referencing them. Its in the move.attack.object.capital file in aiscripts, starting at line 190
following this looks to be the attacking script. The "apply strengths" comments don't make much sense to me though.
Code: Select all
<do_if value="$enemies.count" min="1">
<activate_battlestate object="this.ship" state="battlestate_red" />
<activate_flaks object="this.ship" /> Code: Select all
<!-- For each enemy, apply strength-->
<do_while value="$enemies.count" min="1">
<debug_text text=" ' unknown. fight. enemies: ' + $enemies " chance="$debugoutputchance" />
<do_all exact="$enemies.count" counter="$i">
<!-- Search/Attacking waiting time -->
<wait min="500ms" max="10s" profile="decreasing" />
<do_if value="@$enemies.{$i}">
<set_value name="$target" exact="$enemies.{$i}" />
<!-- exclude the player ship in OOS case, this scenario wouldn't make any sense anyway -->
<do_if value="$target != player.primaryship">
<!-- Get and apply strengths-->
<do_if value="$target.isoperational" chance="70" comment="chance of fail">
<!-- do not attack objects that are too far away, gravidar range can be 50km+ !! -->
<do_if value="this.ship.distanceto.{$target} lt 4km">
<!-- Get the strength in 'result'-->
<get_attackstrength object="this.ship" target="$target" result="$result" />
<!-- Check for ships of player -->
<do_if value="$target.isplayerowned" chance="100">
<do_if value="$result gt $target.hull*0.2 or $target.hull lt $target.maxhull*0.3">
<!-- Signal to warning about a player´s ship under attack -->
<signal_objects object="$target" param="'ShipOwnedAttacked'" param2="$target" param3="$target" />
<!-- <wait exact="1min" comment="wait to give a chance to the player (not fair for NPC)"/> -->
</do_if>
</do_if>
<!-- Apply the strength to target -->
<apply_attackstrength object="$target" attacker="this.ship" strength="$result" result="$isdead" />
<debug_text text="'%1 OOS. Apply strength of %2 against %3 is: %4(%5|%6). Is killed: %7'.[player.age,this.ship.knownname,$target.knownname,$result,$target.hull,$target.shield,$isdead]" chance="$debugoutputchance" />
</do_if>
</do_if>
</do_if>
</do_if>
</do_all>-
Jack08
- Posts: 2993
- Joined: Sun, 25. Dec 05, 10:42

I haven't a clue, have you tried? you may have to get the ship repaired. Ooo, comand idea! Send for Repair.swatti wrote:It took days for you to make what Egosoft could not in years... Wow...
ISSUE:
Captured/boarded a Fedhelm, a mining-ship and it has no docking-ports of any kind by the looks of it, thus i cant transfer a captain or assignt it to my squad, can i use this mod to make it move or somethin? My marine-officer is stuck onboard along with my stupidly expensive marines.
im going to guess "strengths" is a german way of saying "weights", weight targets and attack by priority?Black_Sails wrote:...
HAH, theres a warning about player ships being under attack, i cant help but notice it doesnt work
-
shane1022
- Posts: 11
- Joined: Mon, 18. Nov 13, 18:37
Hello! I just wanted to tell you that after installing your mod, and the The mod to make cap ships not use jump fuel, my cap ships will no longer jump to a new part of the galaxy. They will just anywhere inside of DV but will not jump to ALB. I just wanted to post it on both mod pages so we can figure it out.
-
Black_Sails
- Posts: 95
- Joined: Wed, 1. Aug 07, 06:35

I'm going to try this..out of curioisity..maybe I can get the ship to be stationary, run the defense script, and see what happens when it stays in "battlestate red". Although I have a feeling that matching the srcmovemode with the fight.defend.capital isn't the correct way to do it.
Code: Select all
<!-- Set ship to defend itself -->
<do_if value="event.param == 'gEC_Defense'">
<activate_battlestate object="this.ship" state="battlestate_red" />
<activate_flaks object="this.ship" />
<set_value name="$scrMoveMode" exact="'fight.defend.capital'" />
<abort_called_scripts/>
</do_if> -
Jack08
- Posts: 2993
- Joined: Sun, 25. Dec 05, 10:42

If you didnt touch the menus, where is the gEC_Defence Signal coming from?Black_Sails wrote:I'm going to try this..out of curioisity..maybe I can get the ship to be stationary, run the defense script, and see what happens when it stays in "battlestate red". Although I have a feeling that matching the srcmovemode with the fight.defend.capital isn't the correct way to do it.
Code: Select all
<!-- Set ship to defend itself --> <do_if value="event.param == 'gEC_Defense'"> <activate_battlestate object="this.ship" state="battlestate_red" /> <activate_flaks object="this.ship" /> <set_value name="$scrMoveMode" exact="'fight.defend.capital'" /> <abort_called_scripts/> </do_if>
thats verry odd, as far as i know both mods change diffrent filesshane1022 wrote:Hello! I just wanted to tell you that after installing your mod, and the The mod to make cap ships not use jump fuel, my cap ships will no longer jump to a new part of the galaxy. They will just anywhere inside of DV but will not jump to ALB. I just wanted to post it on both mod pages so we can figure it out.
-
shane1022
- Posts: 11
- Joined: Mon, 18. Nov 13, 18:37
thats verry odd, as far as i know both mods change different files
yes but I believe one of the mods has a bug that makes it so your cap ships wont jump to another part of the galaxy. I just wanted to point it out to both authors because I don't have a way to test it without creating a new save and I don't have time for that tonight.
Last edited by shane1022 on Tue, 19. Nov 13, 09:18, edited 1 time in total.
-
Black_Sails
- Posts: 95
- Joined: Wed, 1. Aug 07, 06:35

I added onto the menus, but by following the syntax I saw from your mod. So for additional "actions", in the player.default.xml file, I added in for example the gEC_Defense signal. I added it below the conditions to check for as well on line 126. Then, on orders, I added it into the menu with this line
<add_player_choice_sub text="{7777,4} section=gOrders_ECDefense" .....
I used the id 4 field under the t file for this and renamed it to Defense. I'm not exactly clear on the purposes of the T file however, I just followed the format you used in your extensions.
edit: I think I see it now. The T field is the text that is actually used in the menu. I'm completely new to this so I'm just learning how everything fits in together..
<add_player_choice_sub text="{7777,4} section=gOrders_ECDefense" .....
I used the id 4 field under the t file for this and renamed it to Defense. I'm not exactly clear on the purposes of the T file however, I just followed the format you used in your extensions.
edit: I think I see it now. The T field is the text that is actually used in the menu. I'm completely new to this so I'm just learning how everything fits in together..
-
jocan2003
- Posts: 629
- Joined: Tue, 6. Mar 07, 17:48

Oh snaps.... finaly basic commands done in less than a few day by a guy alone... they had 7 years and didnt implement the most basic and important stuff....
Anyway big thanks to you, one question tho, if i tell a trader to hold, then make him do a trade run, after his run will he come back into follow mode? or stay on hold?
Anyway big thanks to you, one question tho, if i tell a trader to hold, then make him do a trade run, after his run will he come back into follow mode? or stay on hold?
-
Jack08
- Posts: 2993
- Joined: Sun, 25. Dec 05, 10:42

it *should* revert back to hold. this is its intended and coded behavior but its also untested behavior.jocan2003 wrote:Oh snaps.... finaly basic commands done in less than a few day by a guy alone... they had 7 years and didnt implement the most basic and important stuff....
Anyway big thanks to you, one question tho, if i tell a trader to hold, then make him do a trade run, after his run will he come back into follow mode? or stay on hold?
-
swatti
- Posts: 1278
- Joined: Sun, 7. Dec 03, 12:03

Nope, wont work, since the ship has no captain, i cant give it any orders nor "contact" it via coms.Jack08 wrote:I haven't a clue, have you tried? you may have to get the ship repaired. Ooo, comand idea! Send for Repair.swatti wrote:It took days for you to make what Egosoft could not in years... Wow...
ISSUE:
Captured/boarded a Fedhelm, a mining-ship and it has no docking-ports of any kind by the looks of it, thus i cant transfer a captain or assignt it to my squad, can i use this mod to make it move or somethin? My marine-officer is stuck onboard along with my stupidly expensive marines.
Property owned, CO-button only gives "details" and "back" buttons.
Is there a way to give commands to "any friendly ship" with out it being in a squad?
