Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Pages: 1 ... 427 428 [429] 430 431 ... 706

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

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6420 on: May 19, 2020, 01:12:03 PM »

I think the one in the hound/ folder will get used, but I'm not sure. This is (of course) an oversight. I guess you could change one of them and see which one gets picked up if you need to be sure :)
Logged

lethargie

  • Commander
  • ***
  • Posts: 183
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6421 on: May 19, 2020, 01:51:07 PM »

in the same kind of question. Both module_bastion_pd1.ship And module_bastion_pd1_lowtech.ship got the same hullId: module_bastion_pd1.

However, they link to different sprites, is there really one sprite we never see, or is there some mechanism to separate hull with same id?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6422 on: May 19, 2020, 02:32:59 PM »

One's probably (very likely, actually, almost certainly) an older/unused version, yeah.
Logged

bananana

  • Commander
  • ***
  • Posts: 226
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6423 on: May 19, 2020, 07:13:24 PM »

question

i have noticed that weapons with very low turn rate value (3 or less) when placed on a hardpoint become unable to actively turn at all. they do keep constant facing direction if the mount arc allows it, i.e. they will keep facing the same direction when the host ship is turning, as long as that direction is within the mount's arc.

so

is there a way i can mitigate this problem in a specific slot using scripts?
can i somehow force set turnrate value of any weapon mounted in this specific slot to some fixed value or add flat bonus(not multiplier) to a turn rate value ?
Logged
Any and ALL sprites i ever posted on this forum are FREE to use. even if i'm using them myself. Don't ever, EVER ask for permission, or i will come to your home and EAT YOUR DOG!!!
i do NOT want to see my name appear in the credits section of any published mod and will consider it a personal insult.

SafariJohn

  • Admiral
  • *****
  • Posts: 3010
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6424 on: May 19, 2020, 08:29:12 PM »

Gauss has turn rate 3 and does turn when in a hardpoint. You can easily check this on a Dominator.
Logged

bananana

  • Commander
  • ***
  • Posts: 226
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6425 on: May 19, 2020, 08:53:46 PM »

Gauss has turn rate 3 and does turn when in a hardpoint. You can easily check this on a Dominator.
2 or less then, my mistake
Spoiler
[close]
the weapon in gif has turnrate of exactly 2
upon closer look i see that it does in fact try to follow mouse, but can actually do that only when ship is turning opposite direction
inertia-assisted aiming?

upd
upon closer look i can see that it does in fact turn - almost imperceptibly slow, but it does turn.
so, my question stands - how can i buff turnrate of a hardpoint mounted weapon by a flat value or force set it to a fixed value ?
« Last Edit: May 19, 2020, 09:06:19 PM by passwalker »
Logged
Any and ALL sprites i ever posted on this forum are FREE to use. even if i'm using them myself. Don't ever, EVER ask for permission, or i will come to your home and EAT YOUR DOG!!!
i do NOT want to see my name appear in the credits section of any published mod and will consider it a personal insult.

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6426 on: May 20, 2020, 04:55:48 PM »

Figured I'd ask this here since this thread is more for this type of thing:

Where can I find a list of variables that are replaceable in the text portion of Rules.csv? Things like $personRank, $PersonRank, $playerName, $hisOrHer, etc.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6427 on: May 20, 2020, 05:02:07 PM »

upon closer look i can see that it does in fact turn - almost imperceptibly slow, but it does turn.
so, my question stands - how can i buff turnrate of a hardpoint mounted weapon by a flat value or force set it to a fixed value ?

Set the base turn rate to 3? :) No way to specifically do what you're asking.

Figured I'd ask this here since this thread is more for this type of thing:

Where can I find a list of variables that are replaceable in the text portion of Rules.csv? Things like $personRank, $PersonRank, $playerName, $hisOrHer, etc.

See: CoreRuleTokenReplacementGeneratorImpl

Note that you can also provide a custom one if needed.

Also regular variables from memory get substituted, you can either check the memory via the devMode dialog option or look in CoreCampaignPlugin.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6428 on: May 20, 2020, 05:15:10 PM »

See: CoreRuleTokenReplacementGeneratorImpl

Note that you can also provide a custom one if needed.

Also regular variables from memory get substituted, you can either check the memory via the devMode dialog option or look in CoreCampaignPlugin.

Thanks! In this case, I'm parsing a returned string that is sometimes randomly selected and replacing found variables that way since the string is being pulled from a different spreadsheet instead of being contained in rules. I already have the parsing/replacement algorithm working, I just need all the variable definitions to check for. I haven't stress tested using every variable yet, but I doubt it will be an issue.

I will implement the custom generator if needed, but as long as I have the hooks to get the entity information for each variable then it shouldn't be necessary- though I haven't looked at it yet. It might give me some pointers on keeping the algorithm efficient. Thanks again for all the help you give to modders. :)

*EDIT* Oh you know what, I can use the public method to get all the replacement tokens for the script in a map. That will save a lot of time!
« Last Edit: May 20, 2020, 05:29:20 PM by Morrokain »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6429 on: May 20, 2020, 05:33:47 PM »

... ah. This method:

Misc.getStringWithTokenReplacement()

May be relevant to your interests. It basically, as far as I can see, does what you're trying to do.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6430 on: May 20, 2020, 07:52:55 PM »

... ah. This method:

Misc.getStringWithTokenReplacement()

May be relevant to your interests. It basically, as far as I can see, does what you're trying to do.

Ah thanks. I should have asked lol. That will save me the time of defining all the keys. And now I have my own parsing logic in case I want to use it to define my own tokens without overriding the generator.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6431 on: May 20, 2020, 08:08:19 PM »

You don't have to override the generator, multiple ones can coexist at once. See CoreLifecyclePluginImpl:

Code
public void onGameLoad(boolean newGame) {
...
/* the token replacement generators don't get saved
  add them on every game load */
Global.getSector().getRules().addTokenReplacementGenerator(new CoreRuleTokenReplacementGeneratorImpl());
...
}
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6432 on: May 20, 2020, 09:00:20 PM »

You don't have to override the generator, multiple ones can coexist at once. See CoreLifecyclePluginImpl:

Code
public void onGameLoad(boolean newGame) {
...
/* the token replacement generators don't get saved
  add them on every game load */
Global.getSector().getRules().addTokenReplacementGenerator(new CoreRuleTokenReplacementGeneratorImpl());
...
}

So I could use this to add my own map of tokens as a separate generator class that could then be accounted for when using the Misc method to replace rules tokens? (which could then be used on the spreadsheet strings?) That would be the use case I would think I would need.

I've handled that functionality in my util class, though, so may as well use it for now (hehe makes me feel better about spending time on it :-[ 8)), but if that is possible I will keep it in my back pocket if performance becomes an issue since a map seems very efficient to use.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6433 on: May 20, 2020, 09:14:57 PM »

So I could use this to add my own map of tokens as a separate generator class that could then be accounted for when using the Misc method to replace rules tokens? (which could then be used on the spreadsheet strings?) That would be the use case I would think I would need.

Correct!
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Logged
Pages: 1 ... 427 428 [429] 430 431 ... 706