Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 470 471 [472] 473 474 ... 710

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

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7065 on: February 17, 2021, 03:44:17 PM »

No documentation that I can find on this, so what does ShipAPI.isDefenseDisabled() mean? Is this when a ship is overloading?

If I'm creating a custom ship system AI, do I need to check for that in the first place?


The curse of posting here literally a second before I answer my own question is potent...

Nvm, I found it under FluxTrackerAPI. So I assume the above means something else.
« Last Edit: February 17, 2021, 04:10:25 PM by Morrokain »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7066 on: February 17, 2021, 04:10:58 PM »

speaking of missiles
Quote
Fixed issue causing ships with only missile weapons to close in to point-blank range regardless of weapon range
is there a way to induce this kind of behavior deliberately, in non-missile weapons? or will there be in the next version, since this is being fixed?
as in, make AI, both using and opposing said weapon, to ignore it's range when approaching or kiting an enemy
for the purpose of making LRM-equivalent weapons in other than missile slots

Hmm, I don't *think* so. You could probably set the DO_NOT_BACK_OFF flag and do something with that, but... it gets into custom AI territory pretty quickly.

No documentation that I can find on this, so what does ShipAPI.isDefenseDisabled() mean? Is this when a ship is overloading?

If I'm creating a custom ship system AI, do I need to check for that in the first place?


The curse of posting here literally a second before I answer my own question is potent...

Nvm, I found it under FluxTrackerAPI. So I assume the above means something else.

It returns true when the ship's defenses - that is, phase cloak or shields - is disabled due to the ship having reached 0 CR.
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 #7067 on: February 17, 2021, 04:21:01 PM »

It returns true when the ship's defenses - that is, phase cloak or shields - is disabled due to the ship having reached 0 CR.

Ah ok that makes sense. Thanks for the answer. :)
Logged

Finnfinn

  • Ensign
  • *
  • Posts: 1
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7068 on: February 18, 2021, 05:56:54 AM »

Howdy folks, new guy here! I'd like to play around with modding after my exams and would like your opinion on a little something.

I love Egosoft's X series of space sims. It would make for some great modding material (ship mods, faction mods, maybe even more) and the ship classes are easily mapped to their Starsector equivalents... except for M5 (scouting vessels), M4/M4+ (interceptors), M3/M3+ (fighters) and M8 (bombers).
I know that by name, these are prime candidates for wings to stick on carriers and I'd agree with some of them, especially with the scouts.
However, many of them have an impressive amount of customizability in terms of hardpoints, with the M3 Argon Nova offering 8 frontal hardpoints, one rear slot suitable for point defense and a missile launcher that can fire missiles suitable for inflicting considerable damage even to larger ships. They are more equivalent to Starsector frigates in terms of customizability and agility, making them simple wings wouldn't do them justice at all.

What do you think? Can one slap that amount of ordnance on wings without breaking the feel of the game in half? Will I need a major ship class overhaul? Or should I just dumb those classes down to a wide variety of fighters and call it a day? I hope I provided enough information, if something needs clarification go ahead and ask.
Logged

Tartiflette

  • Admiral
  • *****
  • Posts: 3529
  • MagicLab discord: https://discord.gg/EVQZaD3naU
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7069 on: February 18, 2021, 09:11:30 AM »

X3 and Starsector are different games following different rules. If you want to make a mod based on an existing game, interpretation is key: where do you want to stick to the original IP, where can you take liberties because doesn't really matter, where does the gameplay must go first. The closer you try to stay from the original IP, the less playable your mod will be by virtue of not following the proper set of rules.

Here is a thread about common modding guidelines that when followed produce a seamless experience with Vanilla. You can then make your own informed decisions about where and how much to deviate from them in your mod.
« Last Edit: February 18, 2021, 09:18:24 AM by Tartiflette »
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 #7070 on: February 18, 2021, 01:38:22 PM »

When setting a ShipwideAIFlag, is duration in frames or in seconds?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7071 on: February 18, 2021, 02:46:48 PM »

Seconds.
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 #7072 on: February 18, 2021, 03:45:51 PM »

Thanks. Got that part working as intended.
Logged

BeyondTheHorizon

  • Commander
  • ***
  • Posts: 183
  • Grand Admiral of the Galactic Empire
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7073 on: February 19, 2021, 03:20:14 AM »

Is there any way to get shipsystem's type? I want to determine if it's "TELEPORTER" type.
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 #7074 on: February 20, 2021, 12:37:46 PM »

Does:

Code
ShipwideAIFlags.setFlag(ShipwideAIFlags.AIFlags.DO_NOT_VENT, amount);

 - prevent the ship from venting in all situations or just some? (amount is the same amount between each time the script runs so theoretically it should always be on under that situation.)

I set that flag whenever hard flux is above 50% and there are still times where the AI will vent when surrounded and above 50% hard flux - leading to the instant death of the ship when it could have survived had it not done so.

Is there any way to absolutely prevent the AI from venting?
Or, alternatively, is there a way to manually cancel a vent in progress so that a ship system can activate?

*Edit* Ah, wait, strike the first part. I forgot that the script won't run if the system's ammo is zero or its on cooldown so that's why that is happening. I will have to set it even during those scenarios and hope that won't impact performance much.

Second question still stands, however, as that would actually be a better solution for this use case.
« Last Edit: February 20, 2021, 12:44:02 PM by Morrokain »
Logged

Stealth

  • Ensign
  • *
  • Posts: 47
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7075 on: February 20, 2021, 04:56:38 PM »

Hey so i followed this tutorial (i took his stuff on github) and got this error

Quote
16655 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.RuntimeException: Error compiling [data.scripts.McrnPlugin]
java.lang.RuntimeException: Error compiling [data.scripts.McrnPlugin]
   at com.fs.starfarer.loading.scripts.ScriptStore$3.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: Parsing compilation unit 'data.scripts.McrnPlugin'
   at org.codehaus.janino.JavaSourceIClassLoader.findIClass(JavaSourceIClassLoader.java:172)
   at org.codehaus.janino.IClassLoader.loadIClass(IClassLoader.java:254)
   at org.codehaus.janino.JavaSourceClassLoader.generateBytecodes(JavaSourceClassLoader.java:214)
   at org.codehaus.janino.JavaSourceClassLoader.findClass(JavaSourceClassLoader.java:178)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   ... 2 more
Caused by: org.codehaus.commons.compiler.CompileException: Compilation unit 'data.scripts.McrnPlugin' does not declare a class with the same name
   at org.codehaus.janino.JavaSourceIClassLoader.findIClass(JavaSourceIClassLoader.java:160)
   ... 7 more
« Last Edit: February 20, 2021, 05:08:47 PM by Stealth »
Logged
"it is what it is"  ~me every 30 seconds

Wispborne

  • Captain
  • ****
  • Posts: 413
  • Discord: wispborne
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7076 on: February 21, 2021, 01:23:52 PM »

Hey so i followed this tutorial (i took his stuff on github) and got this error

Quote
16655 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.RuntimeException: Error compiling [data.scripts.McrnPlugin]
java.lang.RuntimeException: Error compiling [data.scripts.McrnPlugin]
   at com.fs.starfarer.loading.scripts.ScriptStore$3.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: Parsing compilation unit 'data.scripts.McrnPlugin'
   at org.codehaus.janino.JavaSourceIClassLoader.findIClass(JavaSourceIClassLoader.java:172)
   at org.codehaus.janino.IClassLoader.loadIClass(IClassLoader.java:254)
   at org.codehaus.janino.JavaSourceClassLoader.generateBytecodes(JavaSourceClassLoader.java:214)
   at org.codehaus.janino.JavaSourceClassLoader.findClass(JavaSourceClassLoader.java:178)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   ... 2 more
Caused by: org.codehaus.commons.compiler.CompileException: Compilation unit 'data.scripts.McrnPlugin' does not declare a class with the same name
   at org.codehaus.janino.JavaSourceIClassLoader.findIClass(JavaSourceIClassLoader.java:160)
   ... 7 more

You should post your code, it'll be easier to help.

That error is saying that you need a class called "McrnPlugin" in your file. If it's called anything else, it'll crash.
Logged
Mod: Persean Chronicles | Mod Managers: SMOL & TriOS | Tool: VRAM Estimator | Tool: Forum+Discord Mod Database | If I'm inactive for 3 months, anyone can use any of my work for anything (except selling it or its derivatives).

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7077 on: February 21, 2021, 03:22:27 PM »

Hey so i followed this tutorial (i took his stuff on github) and got this error

Quote
16655 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.RuntimeException: Error compiling [data.scripts.McrnPlugin]
java.lang.RuntimeException: Error compiling [data.scripts.McrnPlugin]
   at com.fs.starfarer.loading.scripts.ScriptStore$3.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: Parsing compilation unit 'data.scripts.McrnPlugin'
   at org.codehaus.janino.JavaSourceIClassLoader.findIClass(JavaSourceIClassLoader.java:172)
   at org.codehaus.janino.IClassLoader.loadIClass(IClassLoader.java:254)
   at org.codehaus.janino.JavaSourceClassLoader.generateBytecodes(JavaSourceClassLoader.java:214)
   at org.codehaus.janino.JavaSourceClassLoader.findClass(JavaSourceClassLoader.java:178)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   ... 2 more
Caused by: org.codehaus.commons.compiler.CompileException: Compilation unit 'data.scripts.McrnPlugin' does not declare a class with the same name
   at org.codehaus.janino.JavaSourceIClassLoader.findIClass(JavaSourceIClassLoader.java:160)
   ... 7 more

You should post your code, it'll be easier to help.

That error is saying that you need a class called "McrnPlugin" in your file. If it's called anything else, it'll crash.

Not sure if this is relevant for your situation but just in case:

If the plugin is an EveryFrameCombatPlugin, then I believe it must also be defined in your settings file as well. Example:

Code
	# this section is meant to eventually replace the "magical" data/scripts/plugins directory
# add EveryFrameCombatPlugins here (with unique keys)
"plugins":{
"AO_CombatEnginePlugin":"data.scripts.plugins.AO_CombatEnginePlugin",
},

Logged

godream

  • Ensign
  • *
  • Posts: 3
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7078 on: February 22, 2021, 12:00:43 AM »

Hi all, just started modding some basics here and added 2 simple ships (frigate and destroyer) and they seem to work fine (I followed the basic guide on the wiki and the forums here...just 2 hulls with their sprites/variants) I have replace a the player ship and a handful of AI ships in a mission file to test them in combat etc and I constantly seem to get a null error crash at some point in the battle.

I have a 64-bit windows system with 8GB of Ram and a GTX 1060 8GB vram card...no additional mods on a clean install....just curious what might be causing this? it's just a handful of ships in the mission so I don't think it's a memory leak...I'd really appreciate any insight into what might be causing this :)

-Note I don't seem able to post using the code or spoiler commands to put the dozen or so lines of error code so as a workaround I've taken a screengrab and stuck it on imgur :/

here is the last few dozen lines of the log file that seem to reference the crash:
https://imgur.com/a/4NHIZse
« Last Edit: February 22, 2021, 12:07:02 AM by godream »
Logged

mendonca

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1159
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7079 on: February 22, 2021, 12:16:13 AM »

Hi, that might be an issue with your ships bounds (searching up 'Tesselator' on the forums shows a similar looking error here: LINK)

Does that sound likely? Do you know if you have set up the bounds for your ship files?
Logged


"I'm doing it, I'm making them purple! No one can stop me!"
Pages: 1 ... 470 471 [472] 473 474 ... 710