[WIP][Mod]Collect All Wares In Zone

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

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

[WIP][Mod]Collect All Wares In Zone

Post by Tyrant597 »

Working on a default behavior to collect all wares in a target zone. That part works fine.
I'm having trouble with the following:

1. Cancelling orders on the ship when the user sets a new default behavior. <cancel_all_orders /> seems to have no effect on, for example, "Fly and Wait". Do I need to pass a releasesignal to the current order? Is it possible to cancel a user-issued wait command? Current workaround: just cancel any orders manually.
2. Docking and waiting until a drop is found in current zone. As soon as I use <create_order />, the script re-initializes and starts over from the top. That's if I tell it to just "Dock". If I tell it to "Dock and Wait", it will wait forever, not sure how to interrupt the wait. Currently just have it waiting 30 seconds, after which it undocks and the script restarts. :? Not ideal.

Anyone know what I'm doing wrong?
Uploaded to Github here: https://github.com/Tyrant597/CollectAllWaresInZone

Collect All Wares In Zone
Really recommended for use with my mod: Collect Inventory Wares
You don't talks about X:Rebirth...
X4 Mods: Collect Inventory Wares Stations Supply Build Storage Mass Move Marines
docwho83
Posts: 169
Joined: Mon, 15. Jun 09, 23:10
x4

Re: [WIP][Mod]Collect All Wares In Zone

Post by docwho83 »

Not sure how to help on the code side. Not played with it yet about to rip open the files. Anyway my question I have as it drives me up a wall but there is no point in having it collect wares in a zone unless that the zone I am in. Being OOS removes all crates. (WTF) come on give us teleport and expect us to being in zones while we have orders collect wares. Hopefully you can make it leave the crates alone while out of sector. Be nice if my miners could do both at the same time. Mine and collect drops.

Thanks
My Mods
RepairLasers Player controlled drone Also on steam
[Minefield] fell affliction minefield removed Also on steam
[Buildmodule] add research for buildmodule leak steals
Tyrant597
Posts: 299
Joined: Wed, 9. Apr 08, 05:52
x4

Re: [WIP][Mod]Collect All Wares In Zone

Post by Tyrant597 »

docwho83 wrote: Thu, 27. Dec 18, 00:57 Not sure how to help on the code side. Not played with it yet about to rip open the files. Anyway my question I have as it drives me up a wall but there is no point in having it collect wares in a zone unless that the zone I am in. Being OOS removes all crates. (WTF) come on give us teleport and expect us to being in zones while we have orders collect wares. Hopefully you can make it leave the crates alone while out of sector. Be nice if my miners could do both at the same time. Mine and collect drops.

Thanks
I just use it to collect drops from destroyed ships.
You don't talks about X:Rebirth...
X4 Mods: Collect Inventory Wares Stations Supply Build Storage Mass Move Marines
pesoda
Posts: 16
Joined: Thu, 13. Dec 18, 19:45
x4

Re: [WIP][Mod]Collect All Wares In Zone

Post by pesoda »

Just a small comment. If you are planning to expand a coverage of this mod to universe-wide using default order, "AutoCollect" or similar name will give us more vivid and catchy impression. Is it too early to talk about this?
Tyrant597
Posts: 299
Joined: Wed, 9. Apr 08, 05:52
x4

Re: [WIP][Mod]Collect All Wares In Zone

Post by Tyrant597 »

pesoda wrote: Thu, 27. Dec 18, 06:21 Just a small comment. If you are planning to expand a coverage of this mod to universe-wide using default order, "AutoCollect" or similar name will give us more vivid and catchy impression. Is it too early to talk about this?
I have no intention of doing so. What is a more vivid and catchy impression?
You don't talks about X:Rebirth...
X4 Mods: Collect Inventory Wares Stations Supply Build Storage Mass Move Marines
pesoda
Posts: 16
Joined: Thu, 13. Dec 18, 19:45
x4

Re: [WIP][Mod]Collect All Wares In Zone

Post by pesoda »

Tyrant597 wrote: Thu, 27. Dec 18, 14:20
pesoda wrote: Thu, 27. Dec 18, 06:21 Just a small comment. If you are planning to expand a coverage of this mod to universe-wide using default order, "AutoCollect" or similar name will give us more vivid and catchy impression. Is it too early to talk about this?
I have no intention of doing so. What is a more vivid and catchy impression?
I see. This mod looked like the one of the missing pieces of vanilla, so can be named vanilla like and is remembered easily by player, I meant. Little thing.
TheDeliveryMan
Posts: 950
Joined: Sat, 10. Dec 11, 03:10
x4

Re: [WIP][Mod]Collect All Wares In Zone

Post by TheDeliveryMan »

Tyrant597 wrote: Wed, 26. Dec 18, 01:22 Working on a default behavior to collect all wares in a target zone. That part works fine.
I'm having trouble with the following:

1. Cancelling orders on the ship when the user sets a new default behavior. <cancel_all_orders /> seems to have no effect on, for example, "Fly and Wait". Do I need to pass a releasesignal to the current order? Is it possible to cancel a user-issued wait command? Current workaround: just cancel any orders manually.
2. Docking and waiting until a drop is found in current zone. As soon as I use <create_order />, the script re-initializes and starts over from the top. That's if I tell it to just "Dock". If I tell it to "Dock and Wait", it will wait forever, not sure how to interrupt the wait. Currently just have it waiting 30 seconds, after which it undocks and the script restarts. :? Not ideal.

Anyone know what I'm doing wrong?
I'm just looking at your code, haven't tested it in-game yet.

What do you expect to happen if, for example, the player issues a manual trade run to the freighter and then, before it has finished, sets the default behaviour to "Collect Wares In A Zone" ?
Tyrant597
Posts: 299
Joined: Wed, 9. Apr 08, 05:52
x4

Re: [WIP][Mod]Collect All Wares In Zone

Post by Tyrant597 »

TheDeliveryMan wrote: Thu, 27. Dec 18, 17:26 I'm just looking at your code, haven't tested it in-game yet.

What do you expect to happen if, for example, the player issues a manual trade run to the freighter and then, before it has finished, sets the default behaviour to "Collect Wares In A Zone" ?
I haven't tested that exact scenario, but I imagine it would finish whatever orders are in its queue, then the default behavior takes over.
You don't talks about X:Rebirth...
X4 Mods: Collect Inventory Wares Stations Supply Build Storage Mass Move Marines

Return to “X4: Foundations - Scripts and Modding”