Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 191 192 [193] 194 195 ... 710

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

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2880 on: July 19, 2016, 11:59:47 AM »

Gotcha, fair enough. This code is just a snippet, it's missing some vital stuff like imports, the actual class definition, etc. It would also need to be either 1) pre-complied or 2) adjusted to be compilable with the Java compiler the game comes with (called "Janino").

If you want to tackle it, I'd suggest looking at the code for hullmods the game comes with as a first step, and possibly at some very basic Java tutorials just to get an understanding for what a class definition is/what it looks like.
Logged

joe130794

  • Commander
  • ***
  • Posts: 226
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2881 on: July 19, 2016, 12:07:40 PM »

Will do at some point, Thanks for your help.
Logged

joe130794

  • Commander
  • ***
  • Posts: 226
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2882 on: July 20, 2016, 01:55:39 PM »

Can anyone tell me what this error is. I'm trying to add another weapon to my mod but seem to get this error everytime I try to start it and I can't see anything wrong with the files. it's a modified swarmer.

Spoiler
8976 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.IllegalArgumentException: No enum constant com.fs.starfarer.api.combat.WeaponAPI.AIHints.50
java.lang.IllegalArgumentException: No enum constant com.fs.starfarer.api.combat.WeaponAPI.AIHints.50
   at java.lang.Enum.valueOf(Unknown Source)
   at com.fs.starfarer.loading.B.o00000(Unknown Source)
   at com.fs.starfarer.loading.WeaponSpreadsheetLoader.Ò00000(Unknown Source)
   at com.fs.starfarer.loading.SpecStore.ø00000(Unknown Source)
   at com.fs.starfarer.loading.ResourceLoaderState.init(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
[close]
« Last Edit: July 20, 2016, 02:06:33 PM by joe130794 »
Logged

gruberscomplete

  • Captain
  • ****
  • Posts: 253
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2883 on: July 20, 2016, 03:15:56 PM »

Can anyone tell me what this error is. I'm trying to add another weapon to my mod but seem to get this error everytime I try to start it and I can't see anything wrong with the files. it's a modified swarmer.

Spoiler
8976 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.IllegalArgumentException: No enum constant com.fs.starfarer.api.combat.WeaponAPI.AIHints.50
java.lang.IllegalArgumentException: No enum constant com.fs.starfarer.api.combat.WeaponAPI.AIHints.50
   at java.lang.Enum.valueOf(Unknown Source)
   at com.fs.starfarer.loading.B.o00000(Unknown Source)
   at com.fs.starfarer.loading.WeaponSpreadsheetLoader.Ò00000(Unknown Source)
   at com.fs.starfarer.loading.SpecStore.ø00000(Unknown Source)
   at com.fs.starfarer.loading.ResourceLoaderState.init(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
[close]

Sounds like you're trying to pass an enum into a function which does not take an enum paremeter. Can you post you're code for the weapon here?
« Last Edit: July 20, 2016, 03:18:40 PM by gruberscomplete »
Logged
Click here for FREE ships!               Plentysector               Robots With Souls

joe130794

  • Commander
  • ***
  • Posts: 226
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2884 on: July 22, 2016, 02:37:50 AM »

heres the weapon file
Spoiler
{
   "id":"jumperdrones",
   "specClass":"projectile",
   "type":"MISSILE",
   "size":"SMALL",
   "turretSprite":"graphics/weapons/swarmer_srm_launcher_turret_base.png",
   "hardpointSprite":"graphics/weapons/swarmer_srm_launcher_hardpoint_base.png",
   "hardpointOffsets":[15, -4, 15, -2, 15, 2, 15, 4],
   "turretOffsets":[10, -4, 10, -2, 10, 2, 10, 4],
   #"hardpointAngleOffsets":[-20, -10, 10, 20],
   #"turretAngleOffsets":[-20, -10, 10, 20],
   "hardpointAngleOffsets":[0, 0, 0, 0],
   "turretAngleOffsets":[0, 0, 0, 0],
   "barrelMode":"ALTERNATING",
   "animationType":"SMOKE",
   "interruptibleBurst":false,
   "displayArcRadius":500,
   "smokeSpec":{"particleSizeMin":10.0,
             "particleSizeRange":16.0,
             "cloudParticleCount":3,
             "cloudDuration":0.9,
             "cloudRadius":8.0,
             "blowbackParticleCount":4,
             "blowbackDuration":1.1,
             "blowbackLength":20.0,
             "blowbackSpread":10.0,
             "particleColor":[170,160,150,130]},
   "projectileSpecId":"jumperdrones",
   "fireSoundTwo":"swarmer_fire",
}
[close]

And the proj file

Spoiler
{
   "id":"jumperdrones",
   "specClass":"missile",   
   "missileType":"MISSILE",
   "sprite":"graphics/missiles/missile_SRM.png",
   "size":[3,7],   
   "center":[3,7],
   "collisionRadius":5,
   "collisionClass":"MISSILE_NO_FF",
   "explosionColor":[255,165,50,255],  # purely visual, will get a white additively blended core on top of this color
   "explosionRadius":60, # purely visual
   "fadeTime":1, # fadeout duration
   "engineSpec":{"turnAcc":1720,
              "turnRate":240,
              "acc":2500,
              "dec":800},
   #"engineSpec":{"turnAcc":240,
   #           "turnRate":120,
   #           "acc":400,
   #           "dec":400},             
   "engineSlots":[{"id":"ES1",
               "loc":[-7, 0],
                #"style":"MISSILE_MIDLINE",
                "style":"CUSTOM",
               "styleSpec":{
                  "mode":"QUAD_STRIP", # PARTICLES or QUAD_STRIP, determines which params are used
                  "engineColor":[255,145,75,255],
                  "contrailDuration":.5,
                  "contrailWidthMult":2,
                  "contrailWidthAddedFractionAtEnd":2,  # can be negative. makes trail spread out/narrow at the end
                  "contrailMinSeg":15, # min segment length, in pixels
                  "contrailMaxSpeedMult":.0f,
                  "contrailAngularVelocityMult":0.5f,
                  "contrailSpawnDistMult":.5, # how far away from engine it starts
                  "contrailColor":[100,100,100,150],
                  "type":"SMOKE" # GLOW or SMOKE; additive or regular blend mode
               },
                "width":2.0,
                "length":10.0,
                "angle":180.0}]
}
[close]
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2885 on: July 22, 2016, 07:09:00 AM »

This looks like an error with weapon_data.csv, actually. Looks like a "50" snuck into the hints column.
Logged

joe130794

  • Commander
  • ***
  • Posts: 226
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2886 on: July 22, 2016, 07:25:39 AM »

Ah right, This is the weapon csv data. I think I only got round to changing the name so it recognized the other files.
Spoiler
Puddle Jumper Drone Launcher,jumperdrones,1,250,1000,,175,,5,0,4,,6,0.25,HIGH_EXPLOSIVE,0,,0,4,2,0.2,0,0,0,0,,300,100,5,50,"ANTI_FTR, DO_NOT_AIM, SYSTEM,DO_NOT_CONSERVE",10
[close]
Logged

gruberscomplete

  • Captain
  • ****
  • Posts: 253
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2887 on: July 22, 2016, 03:03:00 PM »

Ships in my mod are very "Cowardly." They attack at maximum weapon range, and miss a lot because of that. Is there a way to make them come closer to enemies before shooting and not running away?
Logged
Click here for FREE ships!               Plentysector               Robots With Souls

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 #2888 on: July 22, 2016, 08:08:43 PM »

I have a question that how to get the FleetMemberAPI when a ship get captured?
Logged
My mods


celestis

  • Captain
  • ****
  • Posts: 285
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2889 on: July 23, 2016, 03:08:40 AM »

Hi! How to deal with suicidal ship behavior? I created a frigate with a long-range missile weapon (range=3500,DO_NOT_AIM,DO_NOT_CONSERVE) and a burst pd laser, and it always tries to fight at close range and dies. Why?! How to force it to kite?
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 #2890 on: July 23, 2016, 04:05:15 AM »

Hi! How to deal with suicidal ship behavior? I created a frigate with a long-range missile weapon (range=3500,DO_NOT_AIM,DO_NOT_CONSERVE) and a burst pd laser, and it always tries to fight at close range and dies. Why?! How to force it to kite?
You need at least one non-missile non-PD weapon for the AI to correctly estimate the range of engagement. So a Tactical Laser maybe? Or a civilian flag.
Logged
 

celestis

  • Captain
  • ****
  • Posts: 285
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2891 on: July 23, 2016, 04:39:55 AM »

Hi! How to deal with suicidal ship behavior? I created a frigate with a long-range missile weapon (range=3500,DO_NOT_AIM,DO_NOT_CONSERVE) and a burst pd laser, and it always tries to fight at close range and dies. Why?! How to force it to kite?
You need at least one non-missile non-PD weapon for the AI to correctly estimate the range of engagement. So a Tactical Laser maybe? Or a civilian flag.
Thanks a lot, I'll try to add laser! How weird...
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2892 on: July 23, 2016, 08:17:32 AM »

Ships in my mod are very "Cowardly." They attack at maximum weapon range, and miss a lot because of that. Is there a way to make them come closer to enemies before shooting and not running away?

Do they behave like civilian ships, or do they actually try to fight, but just prefer extreme range? If it's the latter, that's not going to be easy to work around, since it's in most cases good behavior. About the only thing that comes to mind is experimenting with aggressive officers to see if that makes a difference, and possibly adding in a single low-range weapon.


I have a question that how to get the FleetMemberAPI when a ship get captured?

I'm not sure exactly what you're asking, could you be more specific about the context this is in?

If you're asking to be *notified* when a ship gets captured, there's no way other than providing an alternate implementation of the FleetInteractionDialogPluginImpl.



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 #2893 on: July 23, 2016, 05:22:34 PM »

I have a question that how to get the FleetMemberAPI when a ship get captured?

I'm not sure exactly what you're asking, could you be more specific about the context this is in?

If you're asking to be *notified* when a ship gets captured, there's no way other than providing an alternate implementation of the FleetInteractionDialogPluginImpl.

Hmm, if a ship get captured, will it appear in reportBattleFinished's primary winner?
Logged
My mods


Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2894 on: July 23, 2016, 05:38:42 PM »

I think it will, yes.
Logged
Pages: 1 ... 191 192 [193] 194 195 ... 710