Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 683 684 [685] 686 687 ... 711

Author Topic: Misc modding questions that are too minor to warrant their own thread  (Read 1729591 times)

betcher

  • Ensign
  • *
  • Posts: 2
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10260 on: October 22, 2023, 05:33:57 PM »

Anyone know where to go to modify how long planets wont let you interact with them if you fought in the area around them? Had some mercs try to kill me and suddenly I couldnt turn in a prisoner. I didnt have my identification on so it shouldnt have mattered by 72 days later when it expired I still couldnt go in. I want to atleast halve the calculation they have for it. I killed 2 fleets without ID that shouldnt make me lose out on a planet for months
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24146
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10261 on: October 23, 2023, 04:21:07 PM »

I'm making a custom AI admiral and I've run into a couple issues.

1. How do I directly tell a ship to fulfill an assignment? None of the arguments for createAssignment(assignment, target, useCommandPoint) allow me to specify which ships are actually going to fulfill this assignment, instead leaving it to the AI to determine that on its own. Sometimes I'd like to assign specific ships to do a specific function. For example to create a wolfpack of specific hulls that form up on a leader, and then the leader goes to a waypoint.

2. I can't figure out how to get the API to give me a list of assignments and what object they're attached to. (ie, defend order attached to an objective, or engage order attached to a ship).
I've made a workaround for this second one, but just in case someone knows, I'd like to use an API solution if possible instead of my own janky one.

You can use giveAssignment() and getAllAssignments().


I have had trouble setting fleets to orbit, but do not remember the specifics atm. Maybe I just wasn't doing it right.

Ah, hmm - yeah, possibly could be troublesome if some bit of core code keeps overriding it or some such.

Is there a way to apply beam effect like tachyon lance with pierceSet like this:
"pierceSet": [
  PROJECTILE_FF,
  PROJECTILE_NO_FF,
  PROJECTILE_FIGHTER,
  MISSILE_FF,
  MISSILE_NO_FF,
  FIGHTER,
  SHIP,
  ASTEROID
  ],

Yes? I'm not understanding the question - what's the actual problem here?


Anyone know where to go to modify how long planets wont let you interact with them if you fought in the area around them? Had some mercs try to kill me and suddenly I couldnt turn in a prisoner. I didnt have my identification on so it shouldnt have mattered by 72 days later when it expired I still couldnt go in. I want to atleast halve the calculation they have for it. I killed 2 fleets without ID that shouldnt make me lose out on a planet for months

You could modify MarketCMD.HOSTILE_ACTIONS_TIMEOUT_DAYS in a ModPlugin.onApplicationLoad() in your mod.
Logged

betcher

  • Ensign
  • *
  • Posts: 2
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10262 on: October 23, 2023, 05:27:49 PM »

Anyone know where to go to modify how long planets wont let you interact with them if you fought in the area around them? Had some mercs try to kill me and suddenly I couldnt turn in a prisoner. I didnt have my identification on so it shouldnt have mattered by 72 days later when it expired I still couldnt go in. I want to atleast halve the calculation they have for it. I killed 2 fleets without ID that shouldnt make me lose out on a planet for months

You could modify MarketCMD.HOSTILE_ACTIONS_TIMEOUT_DAYS in a ModPlugin.onApplicationLoad() in your mod.
Thanks I had no idea where to even start, all the things I opened had no variables and I ran out of folders. My usual program couldnt search anything at all and opening things in notepad made things act weird unless they were straight numbers. Ended up finding 4 options so its just a matter of playing with them until I get the desired result. It happened again earlier today, 3 months for a minor conflict they started and only 1 fight
« Last Edit: October 23, 2023, 05:34:08 PM by betcher »
Logged

Vitmainlem

  • Ensign
  • *
  • Posts: 4
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10263 on: October 24, 2023, 07:37:55 AM »

Is there a way to apply beam effect like tachyon lance with pierceSet like this:
"pierceSet": [
  PROJECTILE_FF,
  PROJECTILE_NO_FF,
  PROJECTILE_FIGHTER,
  MISSILE_FF,
  MISSILE_NO_FF,
  FIGHTER,
  SHIP,
  ASTEROID
  ],

Yes? I'm not understanding the question - what's the actual problem here?


-----So the I make a beam that pierce everything, which makes beam not hitting anything and that causing problem to apply beam effect like tachyon lance effect. Are there Any solution for this?

Logged

Sorrydough

  • Ensign
  • *
  • Posts: 30
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10264 on: October 24, 2023, 07:14:56 PM »

You can use ... getAllAssignments().
Yes, I'm using this. But it only gives me the location of the assignment, not what it's attached to. I have to manually iterate over every battlefield object to find what ship or objective or whatever is at that location. Because AssignmentTargetAPI only has location, velocity and owner. It doesn't have the target object.
« Last Edit: October 24, 2023, 07:39:47 PM by Sorrydough »
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 3023
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10265 on: October 24, 2023, 07:29:07 PM »

You can use ... getAllAssignments().
Yes, I'm using this. But it only gives me the location of the assignment, not what it's attached to. I have to manually iterate over every battlefield object to find what ship or objective or whatever is at that location. Because AssignmentTargetAPI only has location, velocity and owner. It doesn't actually have the target object.

It is the target, but you need to cast it to the correct type to determine what it is. See what extends AssignmentTargetAPI. For example, ship targets are DeployedFleetMemberAPI.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24146
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10266 on: October 26, 2023, 04:33:36 PM »

-----So the I make a beam that pierce everything, which makes beam not hitting anything and that causing problem to apply beam effect like tachyon lance effect. Are there Any solution for this?

Ah, I see - yeah, the on-hit effect is not going to get called for anything that's pierced, so you'd have to script that separately somehow.

You can use ... getAllAssignments().
Yes, I'm using this. But it only gives me the location of the assignment, not what it's attached to. I have to manually iterate over every battlefield object to find what ship or objective or whatever is at that location. Because AssignmentTargetAPI only has location, velocity and owner. It doesn't actually have the target object.

It is the target, but you need to cast it to the correct type to determine what it is. See what extends AssignmentTargetAPI. For example, ship targets are DeployedFleetMemberAPI.

And for battle objectives, you can check then cast it to BattleObjectiveAPI.
Logged

TrashMan

  • Admiral
  • *****
  • Posts: 1325
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10267 on: October 28, 2023, 08:19:11 AM »

Best way to implement a tractor beam effect?

Negative impact value for a weapon doesn't do anything. Changing targets speed temporarily on weapon impact? Direct application of force? If so, is there an existing method for it?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24146
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10268 on: October 28, 2023, 03:51:11 PM »

Best way to implement a tractor beam effect?

Negative impact value for a weapon doesn't do anything. Changing targets speed temporarily on weapon impact? Direct application of force? If so, is there an existing method for it?

Probably modifying the velocities of the involved entities directly. The physics-math for this is simple (F = ma and so on, which can of course be simplified if one doesn't care about mass etc), though getting it to feel good would likely take a bunch of experimentation.

You could also have a large positive impact value - iirc for a beam this will cause the target to slow down quite a bit. The impact value is ignored for non-beams.
Logged

TrashMan

  • Admiral
  • *****
  • Posts: 1325
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10269 on: October 29, 2023, 06:52:17 AM »

Wouldn't a high impact value PUSH away the target?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24146
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10270 on: October 29, 2023, 11:42:00 AM »

I don't remember how it works, but I wouldn't read too much into the name of a spreadsheet column for a feature that never really panned out and isn't exactly "supported" beyond the edge case of the graviton beam. Judging from what the graviton beam does to fighters and missiles, the answer is "no" :)
Logged

Dazs

  • Admiral
  • *****
  • Posts: 1070
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10271 on: October 29, 2023, 11:42:27 AM »

Hello all. I was hoping someone could help me in hiding the commodities available for my mod Hiver Swarm. It is my most requested fix and I have tried several ways but I cannot seem to figure it out. They always have the best prices so they fill the top of the lists but they are hostile to all so the player cannot trade with them. Essentially what I would like is when someone either looks up the best buy/sell with F1 or open the tab that commodities from the Hiver faction are not shown.

Any help would be appreciated, thanks.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24146
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10272 on: October 29, 2023, 11:59:59 AM »

You have a few options, at least for the F1 cargo tooltip that shows best places to buy/sell:

1) Remove the Submarkets.SUBMARKET_OPEN submarket from your colonies.

2) market.setEconGroup(<some string>). This will place your markets in a separate sub-economy, so may have undesired effects as e.g. they will not be able to satisfy demand from the core economy.

3) market.setHidden(true). This will hide the colony in some other ways, iirc, such as not having trade fleets from or to it, being targeted for certain missions, etc.

Either one of the three should do it.
Logged

Dazs

  • Admiral
  • *****
  • Posts: 1070
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10273 on: October 29, 2023, 12:16:15 PM »

You have a few options, at least for the F1 cargo tooltip that shows best places to buy/sell:
First off thank you for getting back to me so fast.
1) Remove the Submarkets.SUBMARKET_OPEN submarket from your colonies.
I do not believe I have that string anywhere in my mod. I coded it over a year ago so what file would that be in so I can double check.
2) market.setEconGroup(<some string>). This will place your markets in a separate sub-economy, so may have undesired effects as e.g. they will not be able to satisfy demand from the core economy.
I did try that one before and it had too many negative effects to their economy.
3) market.setHidden(true). This will hide the colony in some other ways, iirc, such as not having trade fleets from or to it, being targeted for certain missions, etc.
Either one of the three should do it.
I believe I tried this one as well and if memory serves it had the unintended consequence of having their internal trade fleets not trade with each other which gutted their ability to form fleets. Of course as above, I did this months ago and maybe I am thinking of something else I tried. What file would I add that line to as I may have put it in an incorrect location.

Sorry for being a pest, I am not very experienced in Java and self-taught so there are gaps for sure.

nathan67003

  • Commander
  • ***
  • Posts: 158
  • Excellent imagination, mediocre implementation.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10274 on: October 29, 2023, 12:55:17 PM »

You could also have a large positive impact value - iirc for a beam this will cause the target to slow down quite a bit. The impact value is ignored for non-beams.
How much would this turn fighters into the ultimate spin-your-flesh-off machines? I know graviton beams do a slight number on fighters but I'm wondering how ridiculous it can feasibly get with much larger values.

Related, how would one go about making a beam that has momentum to it? Before that, is it even possible to alter the momentum vector (accurate term to describe what's happening but not necessarily the way things are implemented) with a projectile impact or such?
« Last Edit: October 29, 2023, 12:57:38 PM by nathan67003 »
Logged
I have some ideas but can't sprite worth a damn and the ideas imply really involved stuff which I've no clue how to even tackle.
Pages: 1 ... 683 684 [685] 686 687 ... 711