Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 2 [3]

Author Topic: Traditional Shields  (Read 12769 times)

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Traditional Shields
« Reply #30 on: January 15, 2014, 10:52:15 PM »

Tried setting this up, and the custom AI can handle it... but... ah... I missed something rather important. 

Apparently, weapons can't be used when this is active, if it uses the Phase Cloak trick.  That's kind of a show-stopper.

But if it doesn't use PHASE_CLOAK as the System type, it crashes somewhere in the internal AI system:

46703 [Thread-6] ERROR com.fs.starfarer.combat.String  - java.lang.ClassCastException: com.fs.starfarer.combat.systems.public cannot be cast to com.fs.starfarer.combat.systems.P
java.lang.ClassCastException: com.fs.starfarer.combat.systems.public cannot be cast to com.fs.starfarer.combat.systems.P
   at com.fs.starfarer.combat.ai.F.<init>(Unknown Source)
   at com.fs.starfarer.combat.ai.BasicShipAI.<init>(Unknown Source)
   at com.fs.starfarer.launcher.ModManager.super(Unknown Source)
   at com.fs.starfarer.combat.F.Òo0000(Unknown Source)
   at com.fs.starfarer.combat.F.øÒÒ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)

I guess the other way to go about this is to do something with the shield, treating this like a Repulsor. 

Meh, I hate doing it that way, I didn't like doing it with the Repulsor, but I'll check it out; it'd get rid of a lot of clunkiness if, to the player and AIs, it was just seen as a "shield" and left regular Systems intact.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Xalendi

  • Commander
  • ***
  • Posts: 198
    • View Profile
Re: Traditional Shields
« Reply #31 on: January 16, 2014, 11:00:57 AM »

You say I'd need to make a "shields up" sprite for each ship, but the blue glow that goes with it comes on automatically? Is it possible to change the colour of the blue glow? Also, to make it completely accurate, the shields would need to be an oval around the ships, not conforming like yours. Is that possible? I mean, given the choice between vanilla shields and conforming, I'd pick conforming, but it's not entirely accurate.

As to your technical difficulties - I really do not understand most of what you're saying. But what comes across is, using it as a system ID prevents weapons fire whilst shields are up, but you can't make shields act like this. Currently, the available shield options are Omni, Front, Phase and None. Could you not add another shield type in there, that uses the code you made? In the same way as you'd just insert a new planet, or a new engine type?
Logged

Xalendi

  • Commander
  • ***
  • Posts: 198
    • View Profile
Re: Traditional Shields
« Reply #32 on: January 16, 2014, 11:02:07 AM »

Also, I really must thank you for doing this. Every time I start to try, I look at the code and then sort of brain melt. You are awesome.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Traditional Shields
« Reply #33 on: January 16, 2014, 11:28:20 AM »

Quote
Also, to make it completely accurate, the shields would need to be an oval around the ships, not conforming like yours. Is that possible?
Not with this, no; at least, not without completely altering the bounds... which is theoretically possible, but not high on my to-do list, since that would require getting points on an oval, which is possible, of course but I'd need to translate that mathematics to Java. 

There would also be the problem of size; an oval that merely covered the bitmap is a non-trivial target, because of the way that Sprites work. Probably would have to be read in from JSON.

Quote
You say I'd need to make a "shields up" sprite for each ship, but the blue glow that goes with it comes on automatically? Is it possible to change the colour of the blue glow?
Well, after I did some things last night, I finally got it working as a "shield"- I finally figured out how to get rid of the "invisible shield" problems that Dmaiski ran into. 

Good news is that it can use regular Shield mechanics, doesn't break anything serious (at least, not in a TC, where I can keep weapons from ignoring it), the stock SS AI can use it.

Bad news is that it no longer has a "blue glow" that covers the whole Sprite, since it's no longer using a System and can't access the engine-side graphical effects.

Not quite sure how I'm going to deal with that yet- I'll probably just make the edge effect animated.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Xalendi

  • Commander
  • ***
  • Posts: 198
    • View Profile
Re: Traditional Shields
« Reply #34 on: January 16, 2014, 03:28:14 PM »

If it uses the regular shield mechanics, can you not patch in the shield colours as the glow?
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Traditional Shields
« Reply #35 on: January 16, 2014, 04:50:20 PM »

Sorry, I didn't communicate clearly :)  When I said, "uses Shield mechanics" I meant in terms of control flow- i.e. user gives the "raise the shields" command and the "shield" activates.  All that glowy stuff is engine-side OpenGL that I don't have direct access to, so it can't be used outside a System context, I think.
Logged
Please check out my SS projects :)
Xeno's Mod Pack
Pages: 1 2 [3]