Fractal Softworks Forum

Please login or register.

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

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

Cycerin

  • Admiral
  • *****
  • Posts: 1665
  • beyond the infinite void
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1005 on: October 14, 2013, 09:10:05 AM »

Derp derp, api.setBackgroundSpriteName("graphics/BR/backgrounds/obsidianBG.jpg"); during the public void part of a mission definition doesn't crash the game, but it doesn't actually change the background either. What am I doing wrong?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24103
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1006 on: October 14, 2013, 09:47:47 AM »

Derp derp, api.setBackgroundSpriteName("graphics/BR/backgrounds/obsidianBG.jpg"); during the public void part of a mission definition doesn't crash the game, but it doesn't actually change the background either. What am I doing wrong?

Use descriptor.json instead. I'm pretty sure whatever is in there overrides what you might have set via setBackgroundSpriteName().
Logged

Psiyon

  • Admiral
  • *****
  • Posts: 772
  • Trippy
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1007 on: October 14, 2013, 09:50:57 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!
I mean I can't directly alter the variables in the class like className.variable = anothervariable; without using statics.

If I could, I would just get and save the persistent data on each load/save, and wouldn't bother doing it inside the scripts themselves.
Logged

Kiloman

  • Ensign
  • *
  • Posts: 35
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1008 on: October 14, 2013, 10:05:30 AM »

I mean I can't directly alter the variables in the class like className.variable = anothervariable; without using statics.

If I could, I would just get and save the persistent data on each load/save, and wouldn't bother doing it inside the scripts themselves.

No, you can't do className.variableName unless they are static, because if they're not static they're instance variables, as in, you create a new instance of the class and then modify their value on that object, usually with setter/getter methods.

http://docs.oracle.com/javase/tutorial/java/javaOO/classvars.html
Logged

Psiyon

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

I know, I was just explaining what I meant to Thaago. :P
Logged

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7206
  • Harpoon Affectionado
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1010 on: October 14, 2013, 05:35:45 PM »

Ah, I see what you mean. Its very tempting to use statics and classes for data storage, but I've found (in my admittedly limited java programming) that things just get screwed up for a variety of reasons. Its also a pain if you ever want multiple copies of your data - with statics its extremely difficult if not impossible. With instances... you make a new instance :P.
Logged

silentstormpt

  • Admiral
  • *****
  • Posts: 1060
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1011 on: October 14, 2013, 07:20:04 PM »

Has someone made any usage of the ShipAPI.setSprite("thisshipcategoryid","thisshipgraphics2")

Code: java
	/**
* Note: If also changing bounds, make sure they are still within the armor grid
* of the ship, which is determined by the original sprite.
* @param category under "graphics" in settings.json
* @param key id under category.
*/
void setSprite(String category, String key);

Im very interested get 2 "transformer" ships in
« Last Edit: October 14, 2013, 07:23:11 PM by silentstormpt »
Logged

NikolaiLev

  • Captain
  • ****
  • Posts: 325
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1012 on: October 16, 2013, 08:37:43 AM »

Is it possible to allow a fighter wing capability to be usable in boarding actions in the campaign?  Think a wing of small boarding craft.
Logged


etherealblade

  • Commander
  • ***
  • Posts: 134
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1013 on: October 17, 2013, 02:16:48 AM »

Well I got awesome news. My mod now loads my empty ships and 2 weapons into the game without crashes. Thats a great step however. Only 6 of the 10 ship sprits show in the codex. What is the remedy for this derp? The files are in the right places and are .png. They happen to be frigates. The only thing that shows in the pictures are lights where the engines are.
YERP!!!! ;D
Spoiler
[close]

DERP!!!  :'(
Spoiler
[close]

I should also mention that yes the name of the .png and the name in the .shp file is the same, otherwise I woulda gots a crash
Logged
Spoiler

[close]

dmaiski

  • Captain
  • ****
  • Posts: 422
  • resistance is futile
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1014 on: October 17, 2013, 02:42:30 AM »

the .png needs to be in 32bit encoding
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!

Hyph_K31

  • Admiral
  • *****
  • Posts: 1605
  • O' Hear My Name and Tremble! Ug Ug.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1015 on: October 17, 2013, 05:56:22 PM »

Is it at all possible to have a mission only be available when a set of specified mods are installed, and have that mission use ships from all mods involved? This would be incredibly useful for things like cross-mod/faction missions, and would also provide some interesting synergy between mods.

Just an idea I had whilst chatting with MesoTroniK, and wondered if it can be done.

If I didn't make sense... Ask Meso, he knows what I'm on about.

Edit:

I just realised this could be done with extras/side mods... But that's not nearly as fun.
« Last Edit: October 17, 2013, 06:07:07 PM by Hyph_K31 »
Logged

"GEDUNE, stop venting in front of your classmates!"

dmaiski

  • Captain
  • ****
  • Posts: 422
  • resistance is futile
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1016 on: October 17, 2013, 11:01:26 PM »

maybe try to make the ModPlugin check if it can find the mods you want, and then if it dose load an alternative mission_list.cvs?

kinda like the exterin
Spoiler
{
        try
        {
            Global.getSettings().getScriptClassLoader().loadClass("data.scripts.world.ExerelinGen");
        }
        catch (ClassNotFoundException ex)
        {
            new XXXX().generate(Global.getSector());
        }
}
[close]

well its an idea i dont really have time atm to try it out
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!

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7206
  • Harpoon Affectionado
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1017 on: October 18, 2013, 02:02:47 PM »

Is it possible in dialogs to add options without replacing the whole dialog? For example, say I want to make a mod that adds an option on top of the base choices when interacting with a specific station. I know I can do that by copying the base files and replacing the whole interaction dialog plugin. However, if all I wanted was to add an option with some logic, that seems wasteful and also non-compatible with any other mod that wants to modify the same entity. (A 'supplemental' pickPriority that instead of generating a whole new dialog receives as an argument the existing dialog of the highest priority non-supplemental thing. Getting its optionSelected argument called might be a bit of an issue, depending on how things are structured under the hood...)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24103
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1018 on: October 18, 2013, 02:15:54 PM »

Is it possible to allow a fighter wing capability to be usable in boarding actions in the campaign?  Think a wing of small boarding craft.

It's possible, but not simple. It involves providing a different version of the fleet interaction dialog plugin.

maybe try to make the ModPlugin check if it can find the mods you want, and then if it dose load an alternative mission_list.cvs?

kinda like the exterin
Spoiler
{
        try
        {
            Global.getSettings().getScriptClassLoader().loadClass("data.scripts.world.ExerelinGen");
        }
        catch (ClassNotFoundException ex)
        {
            new XXXX().generate(Global.getSector());
        }
}
[close]

well its an idea i dont really have time atm to try it out

Yeah, that approach should work.


Is it possible in dialogs to add options without replacing the whole dialog? For example, say I want to make a mod that adds an option on top of the base choices when interacting with a specific station. I know I can do that by copying the base files and replacing the whole interaction dialog plugin. However, if all I wanted was to add an option with some logic, that seems wasteful and also non-compatible with any other mod that wants to modify the same entity. (A 'supplemental' pickPriority that instead of generating a whole new dialog receives as an argument the existing dialog of the highest priority non-supplemental thing. Getting its optionSelected argument called might be a bit of an issue, depending on how things are structured under the hood...)

It's not currently possible, but I completely get what you're asking for/where you're coming from. Basically, this would require structuring the core implementation of the interaction plugin so that it itself could have plugins. That's potentially doable, but also kind of commits station interactions to that specific structure, and that's not something I'm comfortable doing.

I may end up doing just that later on down the line for sanity reasons - say, when expanding the fleet interaction dialog - perhaps with actual dialog - gets unmanageable without some kind of overarching structure. This kind of thing always works best when there's a vanilla use case to drive it, not just because it also directly contributes to dev progress but because it makes it much easier to get the design right.
Logged

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7206
  • Harpoon Affectionado
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1019 on: October 18, 2013, 02:18:49 PM »

Fair enough! I've come up with a work around for the specific thing I was doing, so no rush from me :).
Logged
Pages: 1 ... 66 67 [68] 69 70 ... 709