[WIP] X Rebirth: The New Frontier

The place to discuss scripting and game modifications for X Rebirth.

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

User avatar
Marvin Martian
Posts: 3547
Joined: Sun, 8. Apr 12, 09:40
x4

Post by Marvin Martian » Tue, 21. Aug 18, 14:08

Vectorial1024 wrote:New discovery! If you specifiy a buildmethod at your buildmodule but you don't have such production method for your wares/surface elements, the game falls back to default.

I tested this by editing my "proof-of-concept mod". The Albion station buildmodule (originally "albion" method in the mod) got changed to require "devries" method. And now the BoFu Star Complex requires Plasma Pumps, as in the default method.

Implementing Ship Parts (Weapons) or Weapon Parts for station is indeed possible. We just have to add something like <build method="usp_prod"/> to the station buildmodules, and volia, stations will require Ship Parts (Weapons)/Weapon Parts to build turrets. [EDIT: As to station components requiring the "usp_prod" method to be produced, we can ignore that. As a result, since that method does not exist for them, the game will just fall back to "default", using the Energy Cells, RMP, etc. Great!]

It should be easy work for us to add in the feature of stations requiring the universal wares.
new :lol: -- woohoo nice that you notice this finally too .. but .. i don't say different about the situation ... the problem is not to get the buildmethod to a builder(CV), the problem is, you need to add at each part in the warelist the $whatever$-Buildmethod entry - otherwise it will use default like you understand meanwhile

the big work is now to add the buildmethod entry (calculated for the actual costs) to each little stationpart (converted in Ship- better Stationparts), also for mod-station-parts and so on -- THATS why i say it is not possible (or realistic to do)

Vectorial1024
Posts: 224
Joined: Mon, 30. Jul 18, 04:16
x4

Post by Vectorial1024 » Tue, 21. Aug 18, 16:04

Marvin Martian wrote: new :lol: -- woohoo nice that you notice this finally too .. but .. i don't say different about the situation ... the problem is not to get the buildmethod to a builder(CV), the problem is, you need to add at each part in the warelist the $whatever$-Buildmethod entry - otherwise it will use default like you understand meanwhile

the big work is now to add the buildmethod entry (calculated for the actual costs) to each little stationpart (converted in Ship- better Stationparts), also for mod-station-parts and so on -- THATS why i say it is not possible (or realistic to do)
Ah I see. Yes, it would be too much work to add new buildmethods to each of the different station parts... let's drop the idea of Station Parts for now.

But still, if we add the <build method="universalparts"/> to the CVs, we will be able to fully use the Ship Parts (Weapons) already available, as if in building ships.

I wasn't looking close enough to how Ship Parts (Weapons) are produced last time. I think adding a consumption step of turret wares at Turret Forge modules is great, just that I am afraid station managers would somehow sell the unprocessed turret wares away... :roll:
That's why I think we should skip the turrets and directly produce Ship Parts (Weapons) instead.

BTW, I am now working on the md scripts regarding station destruction to see if I can help fix some bugs.

EDIT: Fixed typo of Ship Parts (Weapons)
The future awaits.

X4 Foundations mods:
Civilian Fleets: Managing your civilian ships has never been easier.
Station Logistics: Managing your station networks has never been easier.
Scrap Delivery Coordination: No more starving scrap processors.

User avatar
Marvin Martian
Posts: 3547
Joined: Sun, 8. Apr 12, 09:40
x4

Post by Marvin Martian » Tue, 21. Aug 18, 16:24

instead of patching CV you may also simply replace default ware for turret upgrades - but again, this is not the way i like to go, because this effect also vanilla spaces with classic productions

I'm inclined to redesign Shippart-Production-Stations to dedicated lines of Shippart, Shippart (weapons) and Recycle Turrets with .. here i fluctuate between use directly Ship Parts (Weapons) as secondary ressource for shipparts and assemble ShipParts with "Weapon"-Parts as dedicated step too

Vectorial1024
Posts: 224
Joined: Mon, 30. Jul 18, 04:16
x4

Post by Vectorial1024 » Tue, 21. Aug 18, 16:52

There is one thing I would like to know: is this mod supposed to be a total overhaul of XRB in many ways? That means this mod would change the game so much that incompatibility is expected and would pop up very frequently.

If we are not expecting this mod to play well with other mods, we can care less about other mods, and focus on our objectives etc.

Just go for it.
The future awaits.

X4 Foundations mods:
Civilian Fleets: Managing your civilian ships has never been easier.
Station Logistics: Managing your station networks has never been easier.
Scrap Delivery Coordination: No more starving scrap processors.

User avatar
Marvin Martian
Posts: 3547
Joined: Sun, 8. Apr 12, 09:40
x4

Post by Marvin Martian » Tue, 21. Aug 18, 19:09

I try to have less compatibility issues as possible, so other mods may work in case

Vectorial1024
Posts: 224
Joined: Mon, 30. Jul 18, 04:16
x4

Post by Vectorial1024 » Thu, 23. Aug 18, 04:45

Ships and weapons aside, I'd like some clarification on another matter.

How is ownership to a zone (and maybe a sector) determined? Are there some rules that states that this zone/sector goes to this faction?
The future awaits.

X4 Foundations mods:
Civilian Fleets: Managing your civilian ships has never been easier.
Station Logistics: Managing your station networks has never been easier.
Scrap Delivery Coordination: No more starving scrap processors.

User avatar
Marvin Martian
Posts: 3547
Joined: Sun, 8. Apr 12, 09:40
x4

Post by Marvin Martian » Thu, 23. Aug 18, 09:56

library SD_owner_check in NF_StationDestruct
this is old CWIR based code, so a bit longer

Priority should given to Mainfactions, but also relation to other in zone factions should take care of, a Outpost/Overwatch have special weighting

Vectorial1024
Posts: 224
Joined: Mon, 30. Jul 18, 04:16
x4

Post by Vectorial1024 » Thu, 23. Aug 18, 12:01

Marvin Martian wrote:library SD_owner_check in NF_StationDestruct
this is old CWIR based code, so a bit longer

Priority should given to Mainfactions, but also relation to other in zone factions should take care of, a Outpost/Overwatch have special weighting
Ah, old codes from CWIR. I was having a bit of difficulty tracing them, but anyways...

Here are the patterns I found from the given code:
  • If the original owner of the zone has a station inside the given zone, that owner continues to own the zone.
  • In the given zone, the faction with the most number of stations will own the zone.
  • In the case of Major Factions also having stations in the given zone, the Major Faction with the most number of stations will own the zone.
  • If there are multiple Major Factions contesting the ownership of the given zone, the ownership will be preferentially given to friendlier factions of the original owner.
  • Outpost/Overwatch stations will be considered at the last step when ownership still cannot be determined by Major/Minor factions. Example case would be a zone owned by PMC but only has a HOA Outpost.
  • In the case of "non-simple owner check", ownership of the given zone will depend on the combat ships inside the zone, as if those ships are stations:
    • Zone ownership is not changed if owner has ship inside it, similar to above.
    • The "most-ship rule", the "Major-first rule", and the "outpost-rule" applies similarly
    • When changing ownership due to combat ships, stations that are ownerless will be converted to the new owner. There are some problems here.
Finally! Look at the last pattern I listed: this must be the source of XEN Sky Meadows and XEN Overwatch popping up in my save-game... The station-destruction feature and the ownership-changing feature must have got mixed together...

If the patterns I found are correct, then I could immediately get to work to solve the long-time problem of XEN flipping station ownership when flipping zone ownership. Also, the code could be rewritten to be cleaner and more modular to help with future debugging.
The future awaits.

X4 Foundations mods:
Civilian Fleets: Managing your civilian ships has never been easier.
Station Logistics: Managing your station networks has never been easier.
Scrap Delivery Coordination: No more starving scrap processors.

User avatar
Marvin Martian
Posts: 3547
Joined: Sun, 8. Apr 12, 09:40
x4

Post by Marvin Martian » Thu, 23. Aug 18, 13:16

stations should destroyed (removed from buildspot) in case the 24h blocktime is out - in case it is not an buildspot station, it will converted to given to actual zone owner - so far, so work like intendet
it may possible you talk about "wild-spawned" stations, that should deleted, but it is possible following rules may cause in simple owner change

Vectorial1024
Posts: 224
Joined: Mon, 30. Jul 18, 04:16
x4

Post by Vectorial1024 » Thu, 23. Aug 18, 13:28

I can help fix/rewrite the station destruction and ownership scripts.

Coding and procedures aside, what should happen if Xenon (or Khaak, or some others) takes over a "wildspawn station"? It's not like they would need those stations anyway.

Suppose, after a fresh gamestart, the Xenon got to Alpha Quadrant, and won a battle. They naturally got the Sky Meadows there. They can't sell the Wheat produced. And, since the Xenon are machines, they shouldn't need food at all.

Should we do something about this?
The future awaits.

X4 Foundations mods:
Civilian Fleets: Managing your civilian ships has never been easier.
Station Logistics: Managing your station networks has never been easier.
Scrap Delivery Coordination: No more starving scrap processors.

User avatar
Marvin Martian
Posts: 3547
Joined: Sun, 8. Apr 12, 09:40
x4

Post by Marvin Martian » Thu, 23. Aug 18, 13:49

the problem is Alpha Quadrant has Sky Meadows an "unique" station, so the station is now "Civilian" means neutral to other factions, because IMO plot/missionrelated - so the station need to survive in each scenario - a solution would be to simply not reactivate (for new owner) "useless" stations
end of story is the zone is in fact ownerless, Xenon expand and will take the zone very fast from Toride space - so this isn't a bug, simply an sideeffect of intendet behavior and actuall parameters

overall i would prefer to handle all situations similar based on actuall activity. i see it as high priority to have the code most neutral as possible, because it will used at multible positions and it is more effective you not add special stuff for a single faction/race

Anyway, reminds me to add an handler if a supporting/pirate faction change behavior to Mainfaction :roll:

Vectorial1024
Posts: 224
Joined: Mon, 30. Jul 18, 04:16
x4

Post by Vectorial1024 » Thu, 23. Aug 18, 15:03

Marvin Martian wrote:...
Anyway, reminds me to add an handler if a supporting/pirate faction change behavior to Mainfaction :roll:
:D And let's also standardize the terms for factions a bit

here's my idea and suggestion:

Main Faction/Major Faction
These factions are strong enough to reasonably own a fleet.
Factions are promoted to Main Faction at game start (to account for the lonely Khaak at the edge of Toride), or when they own a sector. (Or perhaps when they own a Capital Shipyard?)
Example is Plutarch Mining Corporation and Heart of Albion.

Minor Faction
Basically, any faction that is not a Main Faction is a Minor Faction.
Example is Ledda Industrial, Wholesome Foods, Albion Energy Sub., etc.

Industrial Faction (New)
Factions that has the potential to become a Main Faction because they have the industrial power to do so.
Example is Ledda Industrial and JSS.

Pirate Faction
Factions that are pirates. Duh.
Example is Reivers and Atlas.

Mercenary Faction
This one I am not so sure.
Example is ACME, DW, SS ...?
The future awaits.

X4 Foundations mods:
Civilian Fleets: Managing your civilian ships has never been easier.
Station Logistics: Managing your station networks has never been easier.
Scrap Delivery Coordination: No more starving scrap processors.

User avatar
Marvin Martian
Posts: 3547
Joined: Sun, 8. Apr 12, 09:40
x4

Post by Marvin Martian » Thu, 23. Aug 18, 16:41

there is no further use in code of much other lists, the "Mainfactions" is a relict of CWIR code and now used to select ambitious factions
the only thing i have add now is little code to add/remove factionId in case there is any change in behavior
this is a "be or not to be" situation with this list

in a full lack of any Stations or competitive ships Khaak is no candidate for Corps mechanic ATM, they will be simply exists as jobs

Vectorial1024
Posts: 224
Joined: Mon, 30. Jul 18, 04:16
x4

Post by Vectorial1024 » Fri, 24. Aug 18, 18:35

I made a pull request on GitHub. It would fix the station destruction/ownership change mix-up bug.

Perhaps some more work is required to make sure the script connects well with the existing scripts; i am not so familiar with existing scripts :(
The future awaits.

X4 Foundations mods:
Civilian Fleets: Managing your civilian ships has never been easier.
Station Logistics: Managing your station networks has never been easier.
Scrap Delivery Coordination: No more starving scrap processors.

User avatar
Marvin Martian
Posts: 3547
Joined: Sun, 8. Apr 12, 09:40
x4

Post by Marvin Martian » Sat, 25. Aug 18, 17:27

thanks, take short look
first you write a lot of nice code as far i read, but WTH should this fix? :?

very interessting you use signal_cue_instantly to get a $result in the calling cue, very new behavior for me (don't imagine this may work)
anyway, your result doesn't look very usefull to me

maybe i'm wrong, but you fire around with signals more then the ships that will fight against the stations - for what?
it is actually an decision (no further logic behind - simply less cpu-usage) that only capital ship attack will able to destroy a station

you register and check attacks like a Boss but what should this good for - actually without cheaty set_hull-sh*t an OOZ attack won't hurt a station (drones/fighters do not do that), drones anyway not fly around OOZ, without capital they even not exist, so it seems to be useless to register all that stuff you do (as far i understand that code i read)

the "problem" was and still is, is the station buildlocation, maplocation or "free" and THAT won't checked from you, so i think there is nothing fixed you make some good checks but i do not see the benefit of them or what is it worth

i will take next days a deeper look, but the inital problem was - map-locations need to seperated from "freelocations" (null) to solve something

and at the ownership stuff seems to be isn't changed anything, so what is different to the actual code (that seems not good enough yet)

----

please do not missunderstand my resistance, i'm happy if someone add code and improve, but i will not add stuff it make no sense, or fix something that isn't broken (yet, maybe later then we can use it) or in this case do work thats not required
because at the end i need to do lots of rewrite stuff that the non i9 >6GHz CPU users can use the mod also

may point of view was to send destruction request "right" the station is down, for this a global.$table is ready and should automaticly extended if station.macro is missing with min.hull value - so i think there is no need for register attacks and calls for destruction, anyway, at the end of a endless chain of calls my actual solution will be used with Check hull le global.$table on your destruction routine :roll:

Vectorial1024
Posts: 224
Joined: Mon, 30. Jul 18, 04:16
x4

Post by Vectorial1024 » Sat, 25. Aug 18, 18:43

Ah, it's fine. That's how comments should be made - fully objective. It's OK.

The main idea that I am adding a lot of watching and signals is that I hope to bring back the "old behavior of station destruction" - if I remember correctly, in the old CWIR, a station is removed when it is "fully destroyed".

I plan to check if all the destructible station parts are destroyed. If that is true, then the station is "fully destroyed". Since this would probably take quite some CPU power, it will be done at a regular interval, just like in my submitted code.

Now that you have briefly read my code, I will take some time to focus the code and re-submit another pull request.

It seems I have a tendency to submit half-working prototypes too early :lol: but at least I can make sure the direction is right before I commit to it.
The future awaits.

X4 Foundations mods:
Civilian Fleets: Managing your civilian ships has never been easier.
Station Logistics: Managing your station networks has never been easier.
Scrap Delivery Coordination: No more starving scrap processors.

User avatar
Marvin Martian
Posts: 3547
Joined: Sun, 8. Apr 12, 09:40
x4

Post by Marvin Martian » Sat, 25. Aug 18, 19:42

But this is not intendet to work that way
Cwir deleted station simply directly after destruction
It is not so logical ships stay wrecked and stations disapear immediatly

—-

You may welcome to create alternitive code who allow to handle partial destruction of stations (buildsteps >A0) as opt-in
Wrecks of disabled basemodules should stay a couple of hours and then get removed
But that should be smart and efficient not such an firework of calls please

aftokinito
Posts: 229
Joined: Sun, 30. Mar 08, 17:29
x4

Post by aftokinito » Sun, 26. Aug 18, 02:19

Is there any way to set the price of the items produced at building modules? Specifically, is there any way to set the prices of L/XL ships on player built shipyards?
I know how to do it for small ships since those count as wares but bigger ships count as buildings.

It is a bit weird that I have to pay 50M for a ship on my own shipyard that has all the items already.

User avatar
Marvin Martian
Posts: 3547
Joined: Sun, 8. Apr 12, 09:40
x4

Post by Marvin Martian » Sun, 26. Aug 18, 09:17

isn't the price of the ship calculated based on actual price level of buy wares?

to skip pricing at order process i think you need to change UI-lua files

in may opinion it make sense to pay for ships you order, because trader need to buy new wares afterwards - if he earn more money then required you will get it anyway back, otherwise you can grab money of his account

if you want to make it cheaper (or 0), you may edit trade.shipyard (for queue-orders) or npc_shipdealer_pl - but this won't prevent UI to block your request in case you have not enough money

Trup2
Posts: 35
Joined: Wed, 5. Nov 14, 20:49
x4

Post by Trup2 » Mon, 27. Aug 18, 13:13

Catch some kind of bug i think.

when sratring new game as a company, game began to freeze after 20 min.

Any other game start running smooth...were can be a problem can't even imagine =)

Without NF mod everything run smooth.

Post Reply

Return to “X Rebirth - Scripts and Modding”