Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Xalendi

Pages: [1]
1
Modding / Accidental hi-res sprites
« on: January 18, 2014, 09:14:31 AM »
I seem to have discovered a method of creating hi-res sprites.

First, create your sprite as normal, so for a frigate as an example, it should be about 110 pixels tall.
Use the ship editor, create the ship, get it working in game.
Boot up photoshop, or the image editor of your choice.
Look at the dimensions of your lo-res sprite - find the size in centimeters
create the hi-res version of your sprite
go to image size, set the dpi to 400, then enter the size in centimeters of your lo-res sprite. The image should end up slightly larger than before.
Save the image as a .png, overwriting the lo-res .png.

Bam! Hi-res sprite.

I've tested this in game, the sprite is exactly to scale to all other ships, both in campaign, battles, and variant editor.

I've just no idea why.

So...did I discover this? Or is this an incredibly obvious thing that everyone knew about?

2
Modding / Traditional Shields
« on: December 29, 2013, 05:05:11 PM »
This started as a question in the misc modding thread, on how to make the flux meter work like traditional shields - more specifically, the shields from Sins of a Solar Empire

This is what we have so far:

Ok, I'm terrible at coding. I can modify existing code to suit my purposes, but I am incapable of creating existing code from scratch. That being said, I've thought of a way of making my shields work. I just need a hand making it all code-ish.

Code
when ship enters battlefield, set flux to 99%, set shields On, disable right mouse click
if flux => 99%, pause regen*
stats.getShieldDamageTakenMult().modifyPercent(id, -200); (thanks Sundog)
if flux => 1, shields On
if flux < 1, shields Off

* I figure if I give the flux dissipation stat in the CSV a negative modifier, then it'll add to flux, rather than remove it...right?
 Also, where would I put this code? In the Hull file of each ship?

Any help on this would be greatly appreciated.

Two questions:
1. What's the best way to run a script at the beginning and end of each battle?
2. Is an EveryFrameCombatPlugin the best way to automate flux manipulation and shield toggling, or is there some sort of every-frame-per-ship pluggin that would dispense with the need to iterate over each ship and store info about them in a HashMap?

@xenoargh/Hyph_K31: I hadn't thought of counting drones to see if they're deployed. Unless they're at zero or max you'd have to count them over several frames to see if they're increasing or decreasing. Not exactly elegant, but it should work.

@Xalendi: No problem. Thanks for the interesting brain teaser :)

Ok, I'm terrible at coding. I can modify existing code to suit my purposes, but I am incapable of creating existing code from scratch.
It might be easier to write code from scratch than you think. Assuming you don't already, you should use an IDE like Eclipse or NetBeans. These will tell you about most errors before they happen, allow you to explore your possibilities while writing, and automagically fix certain issues, among many other benefits. They're free.
Tutorials to set up IDEs for Starsector:
NetBeans: http://fractalsoftworks.com/forum/index.php?topic=3173.msg45967
Eclipse: http://fractalsoftworks.com/forum/index.php?topic=4344.msg67576#msg67576

You could try using a negative flux dissipation, but watch out for unintended side-effects (e.g. flux might jump straight from 98% to 100% and shut off the shield). By manually managing shield regeneration you could avoid this (assuming it happens).

As for where to put the code, you'll need two .java files. You'll probably want to put the shield damage inverting line in a new hull mod script (you can find examples of such in many faction mods (e.g. Blackrock)). I think the rest of your code will go in an EveryFrameCombatPlugin, but I haven't used one yet and I'm not certain it's the appropriate way to do something like this (hence the questions above).

Your pseudo-code looks good, but you might want to use a Halo-style delay before shields begin to regenerate to prevent them from constantly turning back on while they're depleted and under fire.

Now, with all that said, this is a non-trivial undertaking for someone who doesn't have much programming experience. If you're feeling up to the task it would be a great way to learn, and I'd be happy to help you with getting started and troubleshooting any issues you run into.


That would be appreciated, thank you.
This is all for my Sins mod - I gave up getting it balanced with vanilla, and am now making it a total conversion.

In Sins, shields are constantly regenerating, with no delay, so that's no problem.

I have no idea what an IDE is. I use Notepad++ to play with the code.

Would I be correct in assuming the .java files get called by the mod_info.json, in a similar way to how the "replace files" bit works?

I know what an EveryFrameCombatPlugin sounds like it does - runs a given script every time a battle has a new frame, so something like 60 times per second. However, 1) I have no idea how to do that, and 2) wouldn't that cause massive slowdowns, if it's constantly running a script that fast?

Also, just realised - The V key would have to be disabled, otherwise it'd be a suicide button.

Quote
In Sins, shields are constantly regenerating, with no delay, so that's no problem.
Actually getting that to work with SS is going to be pretty hard, but probably it can be done:

1.  Have shields that go up and stay up (custom System AI required, or an extension of the default SS AI).

2.  Shots need to pierce Shields but do damage when inside the Shield, reduced by the percentage of Hard Flux vs. Max Flux. 

3.  If a ship is at 99% of Max Flux or is Overloading, it needs to be immediately made non-Overloading (I think that's possible by reducing the Overload time penalty to nearly-zero) and Shields need to go back up.

4.  Shield opening times probably need to be made a lot faster (built-in Hull Mod).

Shield-piercing shot examples can be found in Vacuum's source (see SpecialShotBehaviors.java and do some reading to see how I did that for Exigency's shield-piercing shots; basically, the shot needs to search for a ShipAPI Entity nearby, and if in bounds, do damage and remove itself).  The rest of it is either Hull Mods, System AI (but very simple- Shields being overridden is a straightforward flag) and an EveryFrameScript.

I may be being daft here, but why do shots need to pierce shields? They don't in Sins. I agree with knocking down the Overload time to near-zero, though. And the fast shields is a good idea.

Also, is it possible to give shields x and y coordinates, instead of a central point? Then we could have ovoid shields that fit the ship shapes.

Quote
I may be being daft here, but why do shots need to pierce shields? They don't in Sins.
Because in Sins, shields become less effective as they absorb damage.  SS's mechanic doesn't work that way- a shield is 100% effective at absorbing damage until Overload, period.  To really re-create that mechanic, you'd have to treat Shields and Flux very differently.

Couldn't there be a line of code that reads something like "shield efficiency = (base shield efficiency) * (flux percentage)"?

EDIT: no, wait, that still wouldn't work...that just makes the shield fall faster, rather than allowing damage through...

EDIT2: How about a line that reads something like,

"ShieldStrength = (base shield efficiency) * (flux percentage)
If flux >= 1, then BonusHullDamage = damage*ShieldStrength"

Well, aside from (base shield efficiency)  / (flux percentage) (you want Shields to get weaker as Flux goes up, rather than the inverse), yeah. 

Then you'd need to write an applyDamage() event that ignores Shields (see API).

well, nah, it'd be the inverse, since we're doing full flux (well - 99%) is full shields.

I didn't know about the applyDamage() command, but that works with the pseudo-code I came up with.

I guess that depends on how you define (flux percent), yes- I assumed it started at 100% and went down :)

Yeah. On the other hand, I made a mistake with my maths as well. If we took the

"ShieldStrength = (base shield efficiency) * (flux percentage)
If flux >= 1, then BonusHullDamage = damage*ShieldStrength"

code as is, then the bonus damage would be wrong, causing more total damage than the enemy ship can actually dish out.

 It actually needs to be BonusHullDamage = damage*(1/ShieldStrength), i.e. the inverse, if I've worked my maths out right.

If that makes sense.

EDIT: No, that doesn't work either...hang on.

EDIT2: Right, so the actual formula is:

"ShieldStrength= (baseShieldEfficiency) * (FluxPercentage)
If Flux >= 1, then BonusHullDamage = damage - (damage*ShieldStrength)"

Gods...I hate maths...

I haven't had the pleasure of playing Sector of Sins yet. Downloading now.

So we're talking about doing partial damage through shields now? Intimidating...

I wouldn't worry about performance issues from using EveryFrameCombatPlugin unless you're doing something crazy.

An IDE (Integrated Development Environment) is just a fancy text editor with a bunch of features for coding. Some people consider Notepad++ an IDE, but it lacks any of the nifty features I mentioned (unless you go crazy with extensions).

You're right about the V key and venting, as a mater of fact it made me realize just how bad my idea was for inverting flux. I didn't even consider what it would do to the AI (make it suicidal). Please accept my humble apologies for making such an inane suggestion.

To my knowledge, ovoid shields are impossible.

Maybe we should move this to another thread to keep this one uncluttered. This could get complicated  :)

3
Modding / Layered Sprites?
« on: October 16, 2013, 02:21:58 AM »
Is it possible to make a sprite in such a way that part of it always stays on top, no matter what? So for example, you could have an engine cowling that shows the exhaust through gaps, or something?

4
Mods / [0.6.1a] Sector of Sins v0.7 [UPDATED] TEC faction added!
« on: October 10, 2013, 02:56:28 AM »
Sector of Sins


-


This mod adds Sins of a Solar Empire units to StarSector


-

Ship Sprites
Spoiler
Advent
Spoiler
Utility:



Strike Craft:



Frigates:


Destroyer:


Cruiser:


Capital Ships:


Titan:
Spoiler

[close]
[close]
TEC
Spoiler
Utility:


Strike Craft:


Frigates:


Cruisers:


Capital Ships:


Titans:
Spoiler

[close]
[close]
[close]

-
Current version: 0.7
Current contents: 36 ships - 4 strike craft squadrons, 11 frigates, 1 destroyer, 3 cruisers, 11 capitals, 3 titans and 3 utility vessels
To do: Add Vasari ships, create faction, starbases and system for the Vasari.

Code
Changelog:
0.7 - updated file structure and naming conventions
        added TEC faction and ships
        increased starting ship options - both Advent and TEC options give the choice between three different starting ships
        added Celanus, the TEC system
0.6 - updated file structure
        removed Iconus Guardian
        added Advent fighter and bomber squadrons
        added Unity, the Advent system
        added Advent faction
        increased accuracy of ships when compared to [i]Sins[/i]. For example, Destra only has four weapons now - all plasma cannons, just like in [i]sins[/i]
0.5a - fixed TradeDrone crash
-


Compatibility issues? I have no idea. Try it. If something goes wrong, tell me and I'll add it here.

-


UPDATED VERSION V0.7!

https://www.dropbox.com/s/4l05rib81hephm8/Sector%20of%20Sins%20v0.7.rar

IMPORTANT: This version drastically changes the structure of the mod. Do not just write over the previous version with this mod, delete the previous version completely before installing this one.

---


All Sins of a Solar Empire content is used with permission of Ironclad Games. www.sinsofasolarempire.com

5
Modding / Complete modding newb here
« on: October 01, 2013, 12:11:07 AM »
Hi,

I made a sprite, based upon my favourite ship from my favourite space rts, but I have no idea how to make it a ship in the game. All the tutorials are gibberish to me. Can someone please give me clear, precise instructions as to go about taking the sprite below and making it available from the shop in the campaign? With hardpoints for guns, and flyable and suchlike?

Spoiler

[close]

6
General Discussion / Daft Question?
« on: September 25, 2013, 09:56:32 PM »
Ok, this may sound daft, but how do I change the quantities of stuff when I'm buying them? The shop has 900+ supplies, gives me a price for the lot, as well as telling me how much they are individually...but insists on trying to sell them me as a lump. How do I buy just one or two of an item, instead of eleventy billion?

7
Bug Reports & Support / Update and Reg key?
« on: September 25, 2013, 08:37:49 PM »
Hi,

I bought starsector some time ago, months and months ago. I stopped playing for a while but it's still installed on my system. I have no idea what details I used to buy the game, so I have no clue what my key is. If I install the new update, will I still be able to play? Or will it ask me for my key?

Pages: [1]