Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Pages: 1 ... 522 523 [524] 525 526 ... 706

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

6chad.noirlee9

  • Captain
  • ****
  • Posts: 368
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7845 on: August 10, 2021, 06:47:18 PM »

is there a way to change jump location/alter the star in a systems size cause ive got a jump point no one can get to in my home system on random sector mode
Logged
edit: edit: maybe were just falling with style LOL.  make a bubble, make the space in front of it smaller and just fall forward

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7846 on: August 10, 2021, 08:09:36 PM »

Ok will do and I'll report my findings back here.

Spoiler
It looks like a condition is waiting to be met where a JVM resource has some sort of contention with another resource in a referenced object that points to the same resource on multiple threads??

I was right on the method in question, but I don't completely understand because the thread is still considered Runnable. It also looks like it is attempting to read a file in some parts (my knowledge of this is based upon incredibly light research though... now my interest is peaked to be sure!  :D

Anyway that would make sense if the file was, for instance, in a shared folder or *possibly* if merging were present at the moment both the threads were run but that's a very, very loosely educated guess. And even still, its a mod-added faction so it wouldn't be file merging with a vanilla faction anyway... and those all work. But, that could be irrelevant to what's actually happening here and from what I've gather its very operating system dependent. I'm on windows 10 if that helps at all.

There is a seemingly good article about this I will read up on to find out more in case its helpful.

These seem like the most relevant parts:

"Thread-3" prio=6 tid=0x000000000c3bf800 nid=0x53e4 runnable [0x000000000d0ae000]
   java.lang.Thread.State: RUNNABLE
   at com.fs.starfarer.api.impl.campaign.graid.ShipWeaponsGroundRaidObjectivePluginIm pl.performRaid(ShipWeaponsGroundRaidObjectivePluginImpl.java:300)

"RMI Scheduler(0)" daemon prio=6 tid=0x000000004fcf6800 nid=0x8c08 waiting on condition [0x0000000011b4e000]
   java.lang.Thread.State: TIMED_WAITING (parking)
   at sun.misc.Unsafe.park(Native Method)
   - parking to wait for  <0x00000000a4389c78> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)

"Reference Handler" daemon prio=10 tid=0x0000000009eb6800 nid=0x3d08 in Object.wait() [0x000000000b25f000]
   java.lang.Thread.State: WAITING (on object monitor)
   at java.lang.Object.wait(Native Method)
   - waiting on <0x00000000a060e458> (a java.lang.ref.Reference$Lock)
   at java.lang.Object.wait(Object.java:503)
   at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
   - locked <0x00000000a060e458> (a java.lang.ref.Reference$Lock)


Full Thread Dump:
Spoiler
"RMI TCP Connection(3)-192.168.1.84" daemon prio=6 tid=0x00000000163a5000 nid=0x2910 runnable [0x0000000024fce000]
   java.lang.Thread.State: RUNNABLE
   at java.net.SocketInputStream.socketRead0(Native Method)
   at java.net.SocketInputStream.read(Unknown Source)
   at java.net.SocketInputStream.read(Unknown Source)
   at java.io.BufferedInputStream.fill(Unknown Source)
   at java.io.BufferedInputStream.read(Unknown Source)
   - locked <0x00000000a45fa4c8> (a java.io.BufferedInputStream)
   at java.io.FilterInputStream.read(Unknown Source)
   at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
   at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
   at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.access$400(Unknown Source)
   at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$1.run(Unknown Source)
   at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
   - <0x00000000a45fa688> (a java.util.concurrent.ThreadPoolExecutor$Worker)

"JMX server connection timeout 27" daemon prio=6 tid=0x000000000c782000 nid=0x65e8 in Object.wait() [0x0000000024dcf000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
   at java.lang.Object.wait(Native Method)
   - waiting on <0x00000000a4386408> (a [I)
   at com.sun.jmx.remote.internal.ServerCommunicatorAdmin$Timeout.run(Unknown Source)
   - locked <0x00000000a4386408> (a [I)
   at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
   - None

"RMI Scheduler(0)" daemon prio=6 tid=0x000000004fcf6800 nid=0x8c08 waiting on condition [0x0000000011b4e000]
   java.lang.Thread.State: TIMED_WAITING (parking)
   at sun.misc.Unsafe.park(Native Method)
   - parking to wait for  <0x00000000a4389c78> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
   at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(Unknown Source)
   at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
   at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
   - None

"RMI TCP Accept-0" daemon prio=6 tid=0x0000000017481000 nid=0x5de4 runnable [0x00000000010de000]
   java.lang.Thread.State: RUNNABLE
   at java.net.DualStackPlainSocketImpl.accept0(Native Method)
   at java.net.DualStackPlainSocketImpl.socketAccept(Unknown Source)
   at java.net.AbstractPlainSocketImpl.accept(Unknown Source)
   at java.net.PlainSocketImpl.accept(Unknown Source)
   - locked <0x00000000a43a3e00> (a java.net.SocksSocketImpl)
   at java.net.ServerSocket.implAccept(Unknown Source)
   at java.net.ServerSocket.accept(Unknown Source)
   at sun.management.jmxremote.LocalRMIServerSocketFactory$1.accept(Unknown Source)
   at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(Unknown Source)
   at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
   - None

"Thread-8" prio=6 tid=0x000000000c731000 nid=0x23c waiting on condition [0x0000000010e2f000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
   at java.lang.Thread.sleep(Native Method)
   at sound.OooO$2.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
   - None

"Thread-4" daemon prio=6 tid=0x000000000bf5d000 nid=0x2b4c waiting on condition [0x000000000d59f000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
   at java.lang.Thread.sleep(Native Method)
   at com.fs.starfarer.combat.CombatMain$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
   - None

"Thread-3" prio=6 tid=0x000000000c3bf800 nid=0x53e4 runnable [0x000000000d0ae000]
   java.lang.Thread.State: RUNNABLE
   at com.fs.starfarer.api.impl.campaign.graid.ShipWeaponsGroundRaidObjectivePluginIm pl.performRaid(ShipWeaponsGroundRaidObjectivePluginImpl.java:300)
   at com.fs.starfarer.api.impl.campaign.rulecmd.salvage.MarketCMD.performRaid(MarketCMD.java:1876)
   at com.fs.starfarer.api.impl.campaign.rulecmd.salvage.MarketCMD.raidConfirm(MarketCMD.java:1735)
   at com.fs.starfarer.api.impl.campaign.rulecmd.salvage.MarketCMD.execute(MarketCMD.java:346)
   at com.fs.starfarer.campaign.rules.super.execute(Unknown Source)
   at com.fs.starfarer.campaign.rules.C.runScript(Unknown Source)
   at com.fs.starfarer.api.impl.campaign.rulecmd.FireBest.applyRule(FireBest.java:106)
   at com.fs.starfarer.api.impl.campaign.rulecmd.FireBest.execute(FireBest.java:51)
   at com.fs.starfarer.api.impl.campaign.rulecmd.FireBest.fire(FireBest.java:57)
   at com.fs.starfarer.api.impl.campaign.RuleBasedInteractionDialogPluginImpl.fireBes t(RuleBasedInteractionDialogPluginImpl.java:177)
   at com.fs.starfarer.api.impl.campaign.RuleBasedInteractionDialogPluginImpl.optionS elected(RuleBasedInteractionDialogPluginImpl.java:210)
   at com.fs.starfarer.ui.newui.Stringsuper$1.o00000(Unknown Source)
   at com.fs.starfarer.ui.newui.OoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.actionPerformed(Unknown Source)
   at com.fs.starfarer.ui.newnew.buttonPressed(Unknown Source)
   at com.fs.starfarer.ui.I.Ò00000(Unknown Source)
   at com.fs.starfarer.ui.I.processInput(Unknown Source)
   at com.fs.starfarer.ui.Stringsuper.super(Unknown Source)
   at com.fs.starfarer.BaseGameState.traverse(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.o00000(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
   - None

"DestroyJavaVM" prio=6 tid=0x0000000002d60800 nid=0x48d8 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
   - None

"AWT-Windows" daemon prio=6 tid=0x000000000c3c0800 nid=0x99f0 runnable [0x000000000d2ae000]
   java.lang.Thread.State: RUNNABLE
   at sun.awt.windows.WToolkit.eventLoop(Native Method)
   at sun.awt.windows.WToolkit.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
   - None

"Java2D Disposer" daemon prio=10 tid=0x000000000c2b6800 nid=0x60d8 in Object.wait() [0x000000000ceae000]
   java.lang.Thread.State: WAITING (on object monitor)
   at java.lang.Object.wait(Native Method)
   - waiting on <0x00000000a07bbaf8> (a java.lang.ref.ReferenceQueue$Lock)
   at java.lang.ref.ReferenceQueue.remove(Unknown Source)
   - locked <0x00000000a07bbaf8> (a java.lang.ref.ReferenceQueue$Lock)
   at java.lang.ref.ReferenceQueue.remove(Unknown Source)
   at sun.java2d.Disposer.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
   - None

"Service Thread" daemon prio=6 tid=0x0000000009f0e000 nid=0x3cb4 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
   - None

"C2 CompilerThread1" daemon prio=8 tid=0x0000000009efe800 nid=0xa408 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
   - None

"C2 CompilerThread0" daemon prio=8 tid=0x0000000009efd000 nid=0x9b78 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
   - None

"Attach Listener" daemon prio=10 tid=0x0000000009efc000 nid=0x91c8 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
   - None

"Signal Dispatcher" daemon prio=10 tid=0x0000000009ef9000 nid=0x8778 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
   - None

"Finalizer" daemon prio=8 tid=0x0000000009ec0800 nid=0x95d0 in Object.wait() [0x000000000b45e000]
   java.lang.Thread.State: WAITING (on object monitor)
   at java.lang.Object.wait(Native Method)
   - waiting on <0x00000000a060e838> (a java.lang.ref.ReferenceQueue$Lock)
   at java.lang.ref.ReferenceQueue.remove(Unknown Source)
   - locked <0x00000000a060e838> (a java.lang.ref.ReferenceQueue$Lock)
   at java.lang.ref.ReferenceQueue.remove(Unknown Source)
   at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)

   Locked ownable synchronizers:
   - None

"Reference Handler" daemon prio=10 tid=0x0000000009eb6800 nid=0x3d08 in Object.wait() [0x000000000b25f000]
   java.lang.Thread.State: WAITING (on object monitor)
   at java.lang.Object.wait(Native Method)
   - waiting on <0x00000000a060e458> (a java.lang.ref.Reference$Lock)
   at java.lang.Object.wait(Object.java:503)
   at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
   - locked <0x00000000a060e458> (a java.lang.ref.Reference$Lock)

   Locked ownable synchronizers:
   - None

"VM Thread" prio=10 tid=0x0000000009eb2800 nid=0x52e0 runnable

"GC task thread#0 (ParallelGC)" prio=6 tid=0x0000000002d77800 nid=0x77d8 runnable

"GC task thread#1 (ParallelGC)" prio=6 tid=0x0000000002d79000 nid=0x59e8 runnable

"GC task thread#2 (ParallelGC)" prio=6 tid=0x0000000002d7b000 nid=0x8d6c runnable

"GC task thread#3 (ParallelGC)" prio=6 tid=0x0000000002d7c800 nid=0x4428 runnable

"VM Periodic Task Thread" prio=10 tid=0x0000000009f21000 nid=0x5e04 waiting on condition

JNI global references: 276


[close]

And here is a snippet of the threads in the thread monitor with the timestamp that I killed the application in case that is also useful:
Spoiler

[close]
[close]
« Last Edit: August 10, 2021, 10:06:23 PM by Morrokain »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7847 on: August 10, 2021, 08:17:47 PM »

This is the main thread, looks like:
"Thread-3" prio=6 tid=0x000000000c3bf800 nid=0x53e4 runnable [0x000000000d0ae000]
   java.lang.Thread.State: RUNNABLE
   at com.fs.starfarer.api.impl.campaign.graid.ShipWeaponsGroundRaidObjectivePluginIm pl.performRaid(ShipWeaponsGroundRaidObjectivePluginImpl.java:300)


If you take a look at line 300 in ShipWeaponsGroundRaidObjectivePluginImpl, you can see that's a while loop that looks like it could potentially keep going forever. Probably not under vanilla conditions, though, so maybe something will jump out at you as far as weapon value etc that might cause the loop to keep going. Just offhand looking at that method for a couple of minutes, it seems like this could happen if some weapons had a base value of zero.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7848 on: August 10, 2021, 08:28:28 PM »

This is the main thread, looks like:
"Thread-3" prio=6 tid=0x000000000c3bf800 nid=0x53e4 runnable [0x000000000d0ae000]
   java.lang.Thread.State: RUNNABLE
   at com.fs.starfarer.api.impl.campaign.graid.ShipWeaponsGroundRaidObjectivePluginIm pl.performRaid(ShipWeaponsGroundRaidObjectivePluginImpl.java:300)


If you take a look at line 300 in ShipWeaponsGroundRaidObjectivePluginImpl, you can see that's a while loop that looks like it could potentially keep going forever. Probably not under vanilla conditions, though, so maybe something will jump out at you as far as weapon value etc that might cause the loop to keep going. Just offhand looking at that method for a couple of minutes, it seems like this could happen if some weapons had a base value of zero.

Its an interface for me. I can't actually look at the code. I'll double check the weapons value issue. None should have that except maybe fighter weapons, and those shouldn't be possible to drop. If you want to PM me the method or just the while loop I can look in further detail if want but no worries if you'd rather not.

*EDIT* Nvm my IDE was just scoping me to the interface. There is a ShipWeaponsGroundRaidObjectivePluginImpl available in the API. My bad.
« Last Edit: August 10, 2021, 08:32:39 PM by Morrokain »
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7849 on: August 10, 2021, 09:16:06 PM »

is there a way to change jump location/alter the star in a systems size cause ive got a jump point no one can get to in my home system on random sector mode

There is a console command RunCode iirc, or something like that.

You could maybe try:

Code
        StarSystemAPI system = Global.getSector().getStarSystem("Name Of Star System");
        JumpPointAPI jumpPoint = (JumpPointAPI) system.getEntityById("jump_point_id");
        jumpPoint.setCircularOrbit(jumpPoint.getOrbitFocus(), jumpPoint.getCircularOrbitAngle(), 5000, jumpPoint.getCircularOrbitPeriod());

 - where you get the jump point ID by putting the game into dev mode and dumping the memory at the related jump point in hyperspace (which you should be able to reach) and looking for "entity.Id = "whatever_the_id_is" in the memory list.

Then you can enter the orbit radius (the number in the second line of code) to change how far out or close it is to the object it orbits.

If you need to change that to something else, then get the ID of the object you want it to orbit (same method as getting the jump point id only in-system this time when interacting with the entity) and replace "jumpPoint.getOrbitFocus()" with "system.getEntityById("entity_id")"

I have no clue if that would actually work in-campaign though.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7850 on: August 10, 2021, 10:05:23 PM »

Just offhand looking at that method for a couple of minutes, it seems like this could happen if some weapons had a base value of zero.

All of my weapons have a base value greater than zero and even if they didn't I'm pretty sure line 312 would throw an ArithmeticException because it would be a divide by zero error and not be what the thread dump indicated? It could not actually capture that though, idk.

But I *think* I figured it out.

Spoiler
See lines 191 - 194:
Code
		int maxTier = 0;
if (market.getSize() >= 6) {
maxTier = 1;
}

The maxTier is set to 1000 if its a military base or the market has heavy industry. (So a patrol HQ and size under 6 gets a max tier of 1.

But what if the faction doesn't know any weapons below tier 2?

Then that would mean the picker on line 221 wouldn't get anything added to it when iterating over the faction's known weapons:
Code
			if (spec.getTier() > maxTier) continue;

 - and if the picker is empty, then when it tries and adds the weapons to the weaponSubset on lines 240 - 247 based upon the number of marines sent on the raid, the weapon spec is always null again because weaponSubset is empty too:
Code
		for (int i = 0; i < 4 + marinesAssigned; i++) {
WeaponSpecAPI spec = pickerW.pick();
if (spec != null) {
float w = pickerW.getWeight(spec);
weaponSubset.add(spec, w);
pickerW.remove(spec);
}
}

 - and so when a weapon is picked on line 301 and it checks for null on line 302:
Code
			if (weapon != null) {

 - it never passes because there isn't a non-null entry and there is not an "else" route for the loop to take - hence an infinite loop.

Now to see if that is actually the case with the 3 factions. I think it might as they are all high tech with rare high tier stuff. And the one that doesn't have this problem has some low tier stuff mixed in.

Assuming this is the case, an isEmpty() check on the picker and some kind of message that the structure "has nothing of value" or "is too well guarded" would help modders not have to retrace this, but I'll have to confirm that this is what's going on first.

The only other thing I can think of right now (and I'm done working on this tonight) is that lootMult would be passed in as 0, but even that I think would eventually break the while loop from line 318:

Code
weaponValue -= val * num;

 - and val is always non-zero and num is always at least 1.
[close]
Logged

JAL28

  • Commander
  • ***
  • Posts: 217
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7851 on: August 11, 2021, 01:58:33 AM »

Is there a way to configure supplies/month and DP costs of ships through raws? For example setting 40 DP to 35 DP etc
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7852 on: August 11, 2021, 08:11:33 AM »

Oh, hmm, so the code you're seeing doesn't have a bunch of "else" clauses there, like so?

Code
if (weapon != null) {
    int min = 1, max = 2;
    ...
    if (num > 0) {
        looted.addWeapons(weapon.getWeaponId(), num);
        weaponValue -= val * num;
        totalValue += val * num;
    } else {
        break;
    }
} else {
    break;
}

If it doesn't, looks like this was fixed in dev, then.

Is there a way to configure supplies/month and DP costs of ships through raws? For example setting 40 DP to 35 DP etc

What do you mean "raws"?
Logged

Originem

  • Purple Principle
  • Captain
  • ****
  • Posts: 430
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7853 on: August 11, 2021, 09:24:32 AM »

Is there some way to cut/link the module during the combat?
Logged
My mods


Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7854 on: August 11, 2021, 09:26:16 AM »

ShipAPI.setStationSlot(null) should let you detach it.  Not sure about re-attaching, that might or might not work.
Logged

Originem

  • Purple Principle
  • Captain
  • ****
  • Posts: 430
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7855 on: August 11, 2021, 09:39:49 AM »

ShipAPI.setStationSlot(null) should let you detach it.  Not sure about re-attaching, that might or might not work.
Hmmm, so what's the ai of detached module? could it perform like a normal ship? if couldn't, will resetDefaultAI() takes effect?
Logged
My mods


Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7856 on: August 11, 2021, 09:43:16 AM »

Offhand, yes and if not also yes.
Logged

lethargie

  • Commander
  • ***
  • Posts: 183
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7857 on: August 11, 2021, 10:00:56 AM »

How do a make a quest giver (from a bar quest) available as a contact?
I have made a custom bar quest. Everything seems to work properly. But once the quest is finished the quest giver disappear and dosnt appear as a potential contact. I tried aping the settings of the findOrCreateGiver() of other bar quest but to no avail
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7858 on: August 11, 2021, 10:02:30 AM »

if (barEvent) {
   setGiverIsPotentialContactOnSuccess(1f);
}

1f is the probability, if you want to make it guaranteed.
Logged

Neb

  • Ensign
  • *
  • Posts: 2
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7859 on: August 11, 2021, 10:03:19 AM »

Hello again!

I try to create a custom mine strike system but i don't know what im doing.
My approach was to just copy all the files related to vanilla mine strike and then modifying them.
It kind of worked but my mines still look the same even tho I changed the particle color in the wpn file and the weapon graphics.
Logged
Pages: 1 ... 522 523 [524] 525 526 ... 706