Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 65 66 [67] 68 69 ... 711

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

Okim

  • Admiral
  • *****
  • Posts: 2161
    • View Profile
    • Okim`s Modelling stuff
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #990 on: October 12, 2013, 11:18:28 AM »

If I made a starbase with its own defence fleet that could be attacked, by basically making a ship with no move speed, how could I prevent it from ever getting boarded? I don't particularly want players to be playing with the starbases.

Two ways.

1. - put a check into fleetinteraction dialog that checks for boardable ships. If starbase = no boarding. This requires a jar file to be created.
2. - make a script that automatically destructs the specified hulls during combat. Destroyed = no boarding.

Both options are used in Ironclads, though only the last one can be freely taken (as the first one is hidden in jar). The file that you need is 'isHuskCheck' in scripts/plugins.

silentstormpt

  • Admiral
  • *****
  • Posts: 1060
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #991 on: October 12, 2013, 12:02:06 PM »

Im stuck on a null error that happens whenever a ship is created, due to the lack of any useful info on the log file, cant seem to find what exactly is crashing it.

Code
18219 [Thread-6] ERROR com.fs.starfarer.combat.String  - java.lang.NullPointerException
java.lang.NullPointerException
at com.fs.starfarer.combat.entities.ship.OooO.String(Unknown Source)
at com.fs.starfarer.combat.entities.ship.OooO.advance(Unknown Source)
at com.fs.starfarer.combat.entities.Ship.advance(Unknown Source)
at com.fs.starfarer.combat.CombatEngine.advance(Unknown Source)
at com.fs.starfarer.title.OoOO.super(Unknown Source)
at com.fs.starfarer.OoOO.øÒÒ000(Unknown Source)
at com.fs.super.oOOO.Ò00000(Unknown Source)
at com.fs.starfarer.combat.String.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #992 on: October 12, 2013, 12:14:46 PM »

@silentstormpt: I think that's got something to do with the ship's engines, but can't tell exactly what.
Logged

silentstormpt

  • Admiral
  • *****
  • Posts: 1060
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #993 on: October 12, 2013, 12:17:17 PM »

@silentstormpt: I think that's got something to do with the ship's engines, but can't tell exactly what.

Probably this hullmod ive been working on, trying to "remove" some of the non-required stats for the SC2 mod:

Code: java
package data.hullmods;

import com.fs.starfarer.api.combat.MutableShipStatsAPI;
import com.fs.starfarer.api.combat.ShipAPI.HullSize;

public class StarControlHullMod extends BaseHullMod
{
    @Override
    public void applyEffectsBeforeShipCreation( HullSize hullSize, MutableShipStatsAPI stats, String id )
    {
        //stats.getBaseSupplyUsePerDay().modifyPercent(id, -100f);
        stats.getBaseSupplyUsePerDay().modifyFlat(id, -(stats.getBaseSupplyUsePerDay().getBaseValue()));
        stats.getCRLossPerSecondPercent().modifyPercent(id, -100f);
        //stats.getCRLossPerSecondPercent().modifyFlat(id, -(stats.getCRLossPerSecondPercent().getBaseValue()));
        stats.getCRPerDeploymentPercent().modifyPercent(id, -100f);
        //stats.getCRPerDeploymentPercent().modifyFlat(id, -(stats.getCRPerDeploymentPercent().getBaseValue()));
        //stats.getEngineDamageTakenMult().modifyPercent(id, -100f);
        stats.getWeaponDamageTakenMult().modifyFlat(id, -(stats.getWeaponDamageTakenMult().getBaseValue()));
        //stats.getWeaponDamageTakenMult().modifyPercent(id, -100f);
        stats.getDamageToTargetEnginesMult().modifyFlat(id, -(stats.getEngineDamageTakenMult().getBaseValue()));
        //stats.getDamageToTargetEnginesMult().modifyPercent(id, -100f);
        stats.getDamageToTargetWeaponsMult().modifyFlat(id, -(stats.getDamageToTargetWeaponsMult().getBaseValue()));
        //stats.getDamageToTargetWeaponsMult().modifyPercent(id, -100f);
        stats.getVentRateMult().modifyFlat(id, -(stats.getVentRateMult().getBaseValue())); //Try venting now! Muhahhahha!
        //stats.getVentRateMult().modifyPercent(id, -100f);
        //stats.getOverloadTimeMod().modifyFlat(id, -(stats.getOverloadTimeMod().getFlatBonus())); //No overloading for you.
        stats.getOverloadTimeMod().modifyPercent(id, -100f);
        //stats.getBaseRepairCost().modifyPercent(id, -100f);
        stats.getBaseRepairCost().modifyFlat(id, -(stats.getBaseRepairCost().getBaseValue())); //No costs on repairs tho, hull hp = crew
        stats.getZeroFluxSpeedBoost().modifyPercent(id, -100f); //No zero-flux bonus
    }
}

Never made a hullmod this extreme....
Logged

TrashMan

  • Admiral
  • *****
  • Posts: 1325
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #994 on: October 13, 2013, 03:05:27 AM »

Question:
I want to make a ship with missile pods...actually built in-missile launchers. Actually missile silos. So not tracking turrets.

Now I know one can animate a weapon to play the animation when it fires...but can one trigger animation in different circumstances? Like - when selecting a weapon group or similar.
I'm not sure what the best way to do this weapon would be.
Logged

dmaiski

  • Captain
  • ****
  • Posts: 422
  • resistance is futile
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #995 on: October 13, 2013, 03:32:35 AM »

@TrashMan
look at my BISO mod, many BISO ships have missile silos instead of missile pods

@Alex
Logged
BISO
(WIP) lots of shiny new weapons ( :-[ i have more weapons then sprites :-[ )

i got a cat pad
its like a mouse pad but better!

TrashMan

  • Admiral
  • *****
  • Posts: 1325
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #996 on: October 13, 2013, 04:10:44 AM »

Thanks, but that doesnt actually answer all of my questions.

I do wonder how you prevent the turret from tracking?
Logged

dmaiski

  • Captain
  • ****
  • Posts: 422
  • resistance is futile
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #997 on: October 13, 2013, 06:47:54 AM »

Weapons.csv
Turn rate
0

Roughly, I'm writing from memory on an iPhone

Depending on how you want it to launch do:
Launch velocity 0
Max/min spread 0

That's all in weapons.csv


Also if you have a large multi missile silo you may want to add turret offsets in the .wpn file and an alternative sprite to represent your missile loaded vertically in the silo


In weapons.csv you define your missiles max speed with projectile speed and launch velocity with same named column

To define the missiles accel you have to go into the missiles .proj file there the code is self explanatory

1warning missiles will not accelerate unless they are facing target(or you made custom ai script) so make sure you give an appropriate turn rate
Logged
BISO
(WIP) lots of shiny new weapons ( :-[ i have more weapons then sprites :-[ )

i got a cat pad
its like a mouse pad but better!

Cycerin

  • Admiral
  • *****
  • Posts: 1665
  • beyond the infinite void
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #998 on: October 13, 2013, 08:21:49 AM »

What exactly can a .system file modify? I know you can add glows to weapons, jitter overlay to the ship, and mod the engines - but how much can you mod when it comes to the engines? Can you increase contrail smoke particle duration and amount/size, for instance?

EDIT: It would be cool if the AI became aware of the new position of a phase teleporting ship during the effect itself as opposed to when it's finished/arrives, it's quite noticeable with slow phase teleporters when the AI can't see the huge ominous Karkinos fading in and doesn't try to get out of the way, and shouldnt make a difference to the Hyperion. IDK.
« Last Edit: October 13, 2013, 12:44:30 PM by Cycerin »
Logged

dmaiski

  • Captain
  • ****
  • Posts: 422
  • resistance is futile
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #999 on: October 13, 2013, 08:58:25 AM »

nevermind misunderstood you.

you can increase engine glow length and size, probably more ill look it up

Spoiler
Code
	"engineGlowColor":[255,0,0,255],
"engineGlowContrailColor":[0,0,255,255],

"engineGlowContrailWidthMult":.1,
"engineGlowContrailLengthMult":.1,
"engineGlowContrailGlowMult":.1,

"engineSmokeContrailWidthMult":.1,
"engineSmokeContrailLengthMult":.1,
"engineSmokeContrailGlowMult":.1,

"engineSmokeWidthMult":.1,
"engineSmokeLengthMult":.1,
"engineSmokeGlowMult":.1,

"engineContrailWidthMult":.1,
"engineContrailLengthMult":.1,
"engineContrailGlowMult":.1,

"engineGlowLengthMult":2.5,
"engineGlowWidthMult":3,
"engineGlowGlowMult":2,

"flameoutOnImpactChance":0.5,
[close]
all had no effect (although i can turn engines red and contrail blue
so go poke alex
« Last Edit: October 13, 2013, 09:40:12 AM by dmaiski »
Logged
BISO
(WIP) lots of shiny new weapons ( :-[ i have more weapons then sprites :-[ )

i got a cat pad
its like a mouse pad but better!

Psiyon

  • Admiral
  • *****
  • Posts: 772
  • Trippy
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1000 on: October 13, 2013, 02:39:42 PM »

I'm having a hell of a time trying to get persistent data to work. No matter what I do, the data never actually makes it into the savegame file.

Here's what I'm doing with my scripts that need access to the data:

(Link to the ascData class: http://fractalsoftworks.com/forum/index.php?topic=5061.msg116257#msg116257 )

       ascData DATA = (ascData) Global.getSector().getPersistentData().get("ASCDATA");
I declare DATA as a class data member, and assign it to the ascData instance stored under the key "ASCDATA".

............

     if (DATA == null) {
           DATA = new ascData();
     }
Because that might be null if nothing was stored there, so I make sure to create a new instance.


......... Then my scripts do whatever it is they do, and they usually end up modifying "DATA" in some way.

At the end of the script:
     Global.getSector().getPersistentData().put("ASCDATA", DATA);
I place the modified DATA object into the game's persistent data map under the key "ASCDATA".

The way I see it, this should be happening:

My scripts, when they run, load in the persistent data. They modify it as necessary. They save it back into the persistent data map, replacing the former "DATA" object. The next time a script runs, it uses the updated "DATA" object, and everything is fine.

This works as long as the game isn't restarted. As soon as it is, everything goes back to the ascData class's defaults for some reason. I don't understand why it isn't saving. This is all that appears in the savegame:

        <string>ASCDATA</string>
        <data.asc.ascData></data.asc.ascData>

Obviously, the persistent data for the key "ASCDATA" is totally empty, other than the reference to the class itself.

Is there something blatantly obvious that I'm doing wrong here? Because I've searched for hours and tried a million different things, and have had absolutely no progress whatsoever.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1001 on: October 13, 2013, 02:48:19 PM »

@Psiyon: All your data members in AscData are static. Only non-static data members get saved since only non-static data members are actually part of the object. Static data members are part of the class.

@Cycerin: I'm fairly certain that everything that exists is used by one of the vanilla systems, so I'd look through all those.

EDIT: It would be cool if the AI became aware of the new position of a phase teleporting ship during the effect itself as opposed to when it's finished/arrives, it's quite noticeable with slow phase teleporters when the AI can't see the huge ominous Karkinos fading in and doesn't try to get out of the way, and shouldnt make a difference to the Hyperion. IDK.

Right, that makes sense. Not exactly trivial to do, though.
Logged

Zaphide

  • Admiral
  • *****
  • Posts: 799
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1002 on: October 13, 2013, 02:49:29 PM »

I'm having a hell of a time trying to get persistent data to work. No matter what I do, the data never actually makes it into the savegame file.

Here's what I'm doing with my scripts that need access to the data:

(Link to the ascData class: http://fractalsoftworks.com/forum/index.php?topic=5061.msg116257#msg116257 )

       ascData DATA = (ascData) Global.getSector().getPersistentData().get("ASCDATA");
I declare DATA as a class data member, and assign it to the ascData instance stored under the key "ASCDATA".

............

     if (DATA == null) {
           DATA = new ascData();
     }
Because that might be null if nothing was stored there, so I make sure to create a new instance.


......... Then my scripts do whatever it is they do, and they usually end up modifying "DATA" in some way.

At the end of the script:
     Global.getSector().getPersistentData().put("ASCDATA", DATA);
I place the modified DATA object into the game's persistent data map under the key "ASCDATA".

The way I see it, this should be happening:

My scripts, when they run, load in the persistent data. They modify it as necessary. They save it back into the persistent data map, replacing the former "DATA" object. The next time a script runs, it uses the updated "DATA" object, and everything is fine.

This works as long as the game isn't restarted. As soon as it is, everything goes back to the ascData class's defaults for some reason. I don't understand why it isn't saving. This is all that appears in the savegame:

        <string>ASCDATA</string>
        <data.asc.ascData></data.asc.ascData>

Obviously, the persistent data for the key "ASCDATA" is totally empty, other than the reference to the class itself.

Is there something blatantly obvious that I'm doing wrong here? Because I've searched for hours and tried a million different things, and have had absolutely no progress whatsoever.

Are your ascData class members still all static? If they are they will not save into the save file. Given how you have laid out above how you are using it I'm fairly sure they don't need to be statics to meet your purposes :)

ED: ninja'd :)
Logged

Psiyon

  • Admiral
  • *****
  • Posts: 772
  • Trippy
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1003 on: October 14, 2013, 07:15:36 AM »

Ah, I see. Thanks for the help. I figured that statics would be saved if I used persistent data. Seems I was wrong.

Too bad I can't directly manipulate instance variables within the class itself... oh well. I guess converting everything to use persistent data won't be too painful.
Logged

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7233
  • Harpoon Affectionado
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1004 on: October 14, 2013, 08:33:42 AM »

Ah, I see. Thanks for the help. I figured that statics would be saved if I used persistent data. Seems I was wrong.

Too bad I can't directly manipulate instance variables within the class itself... oh well. I guess converting everything to use persistent data won't be too painful.

What do you mean by directly manipulate instance variables? That sounds like exactly the thing you can and should be doing. I think the only thing you need to do is get rid of those statics!
Logged
Pages: 1 ... 65 66 [67] 68 69 ... 711