Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 526 527 [528] 529 530 ... 710

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

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24112
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7905 on: August 25, 2021, 07:25:09 PM »

Ahh, right, that makes sense. Looking at what setCombatNotOverForAtLeast() does, it's asymmetrical anyway - it cancels out "no-one's left or everyone is retreating" on the enemy side only. So, I think just doing an "if (ship.getOriginalOwner() != 0)" is sufficient here. The battle will end if this is the only kind of ship left on the player side and it gets disabled, but it already would anyway.

(If you decide to use an Aspect in the player fleet, it seems like the simplest solution would be to have a variant with the shard spawner in "suppressedMods". At least, I think that ought to work, though not 100% sure.)
Logged

shoi

  • Admiral
  • *****
  • Posts: 658
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7906 on: August 25, 2021, 09:44:01 PM »

Is there a way to get ships with Fighter hullsize to capture objectives?

The workaround I have been using to command them is setting the ship to frigate hullsize before issuing any order, which works for literally everything else... but capture orders seem to be immediately cancelled as soon as the ships hullsize is set back to fighter. It seems they still 'have' the assignment because if I alternate between the two hullsizes, the ship will attempt to return to carrying out objective-based orders on frigate hullsize, but return to the default 'no orders' behavior when switched to fighter hullsize.

Edit: Is there some way to get text input from the player with the API?
« Last Edit: August 27, 2021, 01:53:13 AM by shoi »
Logged

JAL28

  • Commander
  • ***
  • Posts: 217
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7907 on: August 29, 2021, 03:21:02 AM »

Does anyone know how to cause a text choice to randomly pick one of many dialogue options available?

To be specific, I want to mod in more dialogue for the foreign sector comm relay interaction in Beyond The Sector, letting it pick one of many options available.

But I’m no script wizard, and very few interactions anywhere seem to do this, so I’m not sure how to do it.
Logged

6chad.noirlee9

  • Captain
  • ****
  • Posts: 368
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7908 on: August 29, 2021, 05:48:38 AM »

Is there a way to get ships with Fighter hullsize to capture objectives?

The workaround I have been using to command them is setting the ship to frigate hullsize before issuing any order, which works for literally everything else... but capture orders seem to be immediately cancelled as soon as the ships hullsize is set back to fighter. It seems they still 'have' the assignment because if I alternate between the two hullsizes, the ship will attempt to return to carrying out objective-based orders on frigate hullsize, but return to the default 'no orders' behavior when switched to fighter hullsize.

Edit: Is there some way to get text input from the player with the API?


neophyte is an understatement concerning my coding abilities, however, isnt there some way to set the size as frigate but for collision purposes set it as fighter?
i can see the workaround in my head but have no idea how to write the code
it would be a long line of code to be sure..... you would have to make some exception rules (i think thats how it works) where in it points to fighter for collision and being able to dock but the actual class is frigate
anyway in my head i see it as that.....have the size as frigate with something that redirects to the code that handles fighters for things that you want to be fighter status like collision and pd weapon damage

.....is that how youve made it work so far anyway?
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

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24112
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7909 on: August 29, 2021, 01:47:26 PM »

Is there a way to get ships with Fighter hullsize to capture objectives?

The workaround I have been using to command them is setting the ship to frigate hullsize before issuing any order, which works for literally everything else... but capture orders seem to be immediately cancelled as soon as the ships hullsize is set back to fighter. It seems they still 'have' the assignment because if I alternate between the two hullsizes, the ship will attempt to return to carrying out objective-based orders on frigate hullsize, but return to the default 'no orders' behavior when switched to fighter hullsize.

Edit: Is there some way to get text input from the player with the API?

Hmm - having dug around a bit, I don't think it's possible directly. Honestly, I'm not 100% clear on all the details under the hood, it'd require a lot more digging around to be certain one way or another.

Does anyone know how to cause a text choice to randomly pick one of many dialogue options available?

To be specific, I want to mod in more dialogue for the foreign sector comm relay interaction in Beyond The Sector, letting it pick one of many options available.

But I’m no script wizard, and very few interactions anywhere seem to do this, so I’m not sure how to do it.

I'm not sure what you're asking. What do you mean by "letting it pick"? If you could describe the exact interaction flow you want that'd help.
Logged

JAL28

  • Commander
  • ***
  • Posts: 217
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7910 on: August 29, 2021, 04:28:46 PM »

I mean out of maybe 10 available options, when you press Continue it uses one of them for the interaction, kinda like those random number generators except with text options
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24112
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7911 on: August 29, 2021, 04:31:44 PM »

When you say "options" it sounds like you're talking about, like, numbered options presented to the player. But I'm starting to think that maybe you just mean "possibilities"? That is, there's just one option - "Continue" - and when the player selects it, one of 10 different things happens.

If so: you can achieve this by just having 10 different rules with the same set of conditions that match this continue option. If the rules all 1) pass their conditions and 2) have the *same number of conditions* (the rule's "score"), then one of them will be picked randomly.
Logged

JAL28

  • Commander
  • ***
  • Posts: 217
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7912 on: August 29, 2021, 08:35:28 PM »

When you say "options" it sounds like you're talking about, like, numbered options presented to the player. But I'm starting to think that maybe you just mean "possibilities"? That is, there's just one option - "Continue" - and when the player selects it, one of 10 different things happens.

If so: you can achieve this by just having 10 different rules with the same set of conditions that match this continue option. If the rules all 1) pass their conditions and 2) have the *same number of conditions* (the rule's "score"), then one of them will be picked randomly.

Yeah, I was talking about possibilities.

Is it possible to do this via simply copying the existing interaction’s code, then pasting it and re-writing the text displayed?
« Last Edit: August 29, 2021, 08:39:00 PM by JAL28 »
Logged

theDragn

  • Captain
  • ****
  • Posts: 307
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7913 on: August 30, 2021, 01:44:28 PM »

I'm having a bit of trouble with a deco weapon- I've set it to display hull damage decals, but it's not. It's in a deco slot too, in case that's an issue. The deco weapon goes over the large slot, and under everything else, which I've set using renderOrderMod in the .ship file.

.wpn file:
Spoiler
{
   "id":"apex_deco_caiman_center",
   "specClass":"beam",
   "type":"DECORATIVE",
   "size":"LARGE",
   "showDamageWhenDecorative":true,
   "renderBelowAllWeapons":false,
   "turretSprite":"graphics/ships/decos/apex_caiman_center.png",
   "hardpointSprite":"graphics/ships/decos/apex_caiman_center.png",
   "turretOffsets":[0, 0],
   "turretAngleOffsets":[0],
   "hardpointOffsets":[0, 0],
   "hardpointAngleOffsets":[0],   
   "fringeColor":[255,255,255,255],
   "coreColor":[255,255,255,255],
   "glowColor":[255,255,255,255],
   "width":1.0,
   "textureType":ROUGH,
   "textureScrollSpeed":1.0,
   "pixelsPerTexel":1.0,
}
[close]


Also, is there a way to figure out if a ship is trying to turn to present less-damaged armor? Like the bit where a ship has stripped armor and will try to turn away from that point if its shields are down.
« Last Edit: August 30, 2021, 01:52:24 PM by theDragn »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24112
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7914 on: August 30, 2021, 04:25:25 PM »

Yeah, I was talking about possibilities.

Is it possible to do this via simply copying the existing interaction’s code, then pasting it and re-writing the text displayed?

Hmm, probably? You could also do something more elegant where you put the code in a separate rule with a unique trigger and FireBest <that trigger> from all your "different text" rules.

Also, if all you want is just different text, you can do this via the text column, by separating the possible text with an "OR" on a separate line, like so:

<text 1>
OR
<text 2>
OR
<text 3>

etc.

I'm having a bit of trouble with a deco weapon- I've set it to display hull damage decals, but it's not. It's in a deco slot too, in case that's an issue. The deco weapon goes over the large slot, and under everything else, which I've set using renderOrderMod in the .ship file.

.wpn file:
...

Hmm - the only thing that comes to mind is that the damage decals for a decorative weapon are fairly small and anything larger than a standard large-sized weapon is unlikely to be covered by them - at least, if I remember correctly how this works.

If this isn't the problem, then the only thing that I can think of is to start with a case where it *is* working and try to isolate the particular change that makes it not work...

Also, is there a way to figure out if a ship is trying to turn to present less-damaged armor? Like the bit where a ship has stripped armor and will try to turn away from that point if its shields are down.

It doesn't set any flag when it's doing that, so not directly, no.
Logged

JAL28

  • Commander
  • ***
  • Posts: 217
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7915 on: August 30, 2021, 04:37:17 PM »

Yeah, I was talking about possibilities.

Is it possible to do this via simply copying the existing interaction’s code, then pasting it and re-writing the text displayed?

Hmm, probably? You could also do something more elegant where you put the code in a separate rule with a unique trigger and FireBest <that trigger> from all your "different text" rules.

Also, if all you want is just different text, you can do this via the text column, by separating the possible text with an "OR" on a separate line, like so:

<text 1>
OR
<text 2>
OR
<text 3>

etc.

I tried the copy-paste method and the game crashed for “duplicate keys” so this is probably the ideal method.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24112
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7916 on: August 30, 2021, 05:51:16 PM »

I tried the copy-paste method and the game crashed for “duplicate keys”

That probably means you didn't change the rule id for your new rules. Each rule needs to have a unique rule id.
Logged

MeinGott

  • Ensign
  • *
  • Posts: 35
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7917 on: August 31, 2021, 08:31:23 AM »

Hello,
I tried to make Heavy Weapons Integration, so in 1st step I took Heavy Ballistics Integration from source archive, changed the name wherever it was due, added .cvs entry accordingly and changed package name in code's first line to data.hullmods. Didnt change what it does yet, just wanted to see if the game would start.
Then I took
Spoiler
22456 [Thread-3] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.RuntimeException: Error loading [data.hullmods.mm_hwi]
java.lang.RuntimeException: Error loading [data.hullmods.mm_hwi]
   at com.fs.starfarer.loading.scripts.ScriptStore$3.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassFormatError: Inconsistent constant value type in class file data/hullmods/mm_hwi
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(Unknown Source)
   at org.codehaus.janino.JavaSourceClassLoader.defineBytecode(JavaSourceClassLoader.java:244)
   at org.codehaus.janino.JavaSourceClassLoader.findClass(JavaSourceClassLoader.java:194)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   ... 2 more
[close]
to the knee.
It obviously tells me nothing as I am uneducated schmuck. Is the solution compiling it manually or something completly else?

Thank you from the mountain, as we say in my country.
« Last Edit: August 31, 2021, 08:35:33 AM by MeinGott »
Logged

Yunru

  • Admiral
  • *****
  • Posts: 1560
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7918 on: August 31, 2021, 09:00:05 AM »

Hello,
I tried to make Heavy Weapons Integration, so in 1st step I took Heavy Ballistics Integration from source archive, changed the name wherever it was due, added .cvs entry accordingly and changed package name in code's first line to data.hullmods. Didnt change what it does yet, just wanted to see if the game would start.
Then I took
Spoiler
22456 [Thread-3] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.RuntimeException: Error loading [data.hullmods.mm_hwi]
java.lang.RuntimeException: Error loading [data.hullmods.mm_hwi]
   at com.fs.starfarer.loading.scripts.ScriptStore$3.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassFormatError: Inconsistent constant value type in class file data/hullmods/mm_hwi
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(Unknown Source)
   at org.codehaus.janino.JavaSourceClassLoader.defineBytecode(JavaSourceClassLoader.java:244)
   at org.codehaus.janino.JavaSourceClassLoader.findClass(JavaSourceClassLoader.java:194)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   ... 2 more
[close]
to the knee.
It obviously tells me nothing as I am uneducated schmuck. Is the solution compiling it manually or something completly else?

Thank you from the mountain, as we say in my country.
I presume this is a loose file, rather than compiled?
The compiler packaged with the game really doesn't like generic object types.

If you just handle things on an individual basis, it's more work but the compiler doesn't argue. For example, here's my Missile-based variant:
Code
	public void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id) {
stats.getDynamic().getMod(Stats.LARGE_MISSILE_MOD).modifyFlat(id, -10);
}

public String getDescriptionParam(int index, HullSize hullSize) {
if (index == 0) return "10";
return null;
}

@Override
public boolean affectsOPCosts() {
return true;
}

shoi

  • Admiral
  • *****
  • Posts: 658
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7919 on: August 31, 2021, 09:02:22 AM »

I'm having a bit of trouble with a deco weapon- I've set it to display hull damage decals, but it's not. It's in a deco slot too, in case that's an issue. The deco weapon goes over the large slot, and under everything else, which I've set using renderOrderMod in the .ship file.

.wpn file:
Spoiler
{
   "id":"apex_deco_caiman_center",
   "specClass":"beam",
   "type":"DECORATIVE",
   "size":"LARGE",
   "showDamageWhenDecorative":true,
   "renderBelowAllWeapons":false,
   "turretSprite":"graphics/ships/decos/apex_caiman_center.png",
   "hardpointSprite":"graphics/ships/decos/apex_caiman_center.png",
   "turretOffsets":[0, 0],
   "turretAngleOffsets":[0],
   "hardpointOffsets":[0, 0],
   "hardpointAngleOffsets":[0],   
   "fringeColor":[255,255,255,255],
   "coreColor":[255,255,255,255],
   "glowColor":[255,255,255,255],
   "width":1.0,
   "textureType":ROUGH,
   "textureScrollSpeed":1.0,
   "pixelsPerTexel":1.0,
}
[close]


Also, is there a way to figure out if a ship is trying to turn to present less-damaged armor? Like the bit where a ship has stripped armor and will try to turn away from that point if its shields are down.

may not be your paricular issue, but iirc what determines if the decal gets the damage overlay is if the cell of the ship its on takes damage. So if the decal isn't on those exact coordinates where damage is taken, it won't be reflected
Logged
Pages: 1 ... 526 527 [528] 529 530 ... 710