Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 518 519 [520] 521 522 ... 710

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

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7785 on: July 29, 2021, 12:11:30 PM »

Is there a rules.csv variable from the tutorial that I can use to detect if players did the tutorial or not?

Because I know there's a skip tutorial I'm not sure if those variables are picked up to be true automatically if the player skipped the tutorial since I don't want to make dialogue assume they saved Ancrya.

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7786 on: July 29, 2021, 12:57:11 PM »

Is there a rules.csv variable from the tutorial that I can use to detect if players did the tutorial or not?

Because I know there's a skip tutorial I'm not sure if those variables are picked up to be true automatically if the player skipped the tutorial since I don't want to make dialogue assume they saved Ancrya.

Code
return memory.getBoolean("$ngcSkipTutorial");

Put that in a rule command script under execute and call that script as a condition for whatever rules you are creating. That variable should stay in memory indefinitely iirc.

Alternatively I think you can have $ngcSkipTutorial as a condition, but I'm not sure if its under LOCAL or PLAYER in memory or if it will work just like that. It might take some trial and error.

*EDIT* code typo fixed  :P
« Last Edit: July 29, 2021, 10:00:57 PM by Morrokain »
Logged

PureTilt

  • Lieutenant
  • **
  • Posts: 54
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7787 on: July 30, 2021, 04:56:18 AM »

(WeaponAPI).getAmmoPerSecond() and (WeaponAPI).getAmmoTracker().getAmmoPerSecond() both return base ammo regeneration. Is that a bug or there no real way to know when something modified ammo regeneration?
Logged




Sutopia

  • Admiral
  • *****
  • Posts: 1005
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7788 on: July 30, 2021, 06:06:24 AM »

(WeaponAPI).getAmmoPerSecond() and (WeaponAPI).getAmmoTracker().getAmmoPerSecond() both return base ammo regeneration. Is that a bug or there no real way to know when something modified ammo regeneration?
I thought that’s done by getting the tracker then manually add ammo using get and set in the advance() method? I don’t recall there’s a mutable stat to modify that.

——————

Is there a way to prevent a faction from giving survey missions?
Logged


Since all my mods have poor reputation, I deem my efforts unworthy thus no more updates will be made.

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7790 on: July 30, 2021, 08:07:43 AM »

What determines what colour shield a ship has?
"style": "MIDLINE" in a .ship file

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24113
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7791 on: July 30, 2021, 08:45:11 AM »

(WeaponAPI).getAmmoPerSecond() and (WeaponAPI).getAmmoTracker().getAmmoPerSecond() both return base ammo regeneration. Is that a bug or there no real way to know when something modified ammo regeneration?
I thought that’s done by getting the tracker then manually add ammo using get and set in the advance() method? I don’t recall there’s a mutable stat to modify that.

Right! There will be in the next release, incidentally.

Is there a way to prevent a faction from giving survey missions?

Hmm, looking at SurveyPlanetMissionIntel, I don't think so.

Is there a rules.csv variable from the tutorial that I can use to detect if players did the tutorial or not?

Because I know there's a skip tutorial I'm not sure if those variables are picked up to be true automatically if the player skipped the tutorial since I don't want to make dialogue assume they saved Ancrya.

Code
return memory.getBoolean("$ngcSkipTutorial");

Put that in a rule command script under execute and call that script as a condition for whatever rules you are creating. That variable should stay in memory indefinitely iirc.

Alternatively I think you can have $ngcSkipTutorial as a condition, but I'm not sure if its under LOCAL or PLAYER in memory or if it will work just like that. It might take some trial and error.

*EDIT* code typo fixed  :P

Worth nothing, perhaps: the game assumes that the events in the tutorial happened, regardless of whether you did it this time around or not. You get extra rep with the Hegemony, can talk to the lieutenant at the bar at Coatl as if you met him during the events of the tutorial, etc.
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7792 on: July 30, 2021, 12:28:34 PM »

Hmmm...

is there a good method in rules.csv to store variables inside the person interacted with? I don't want to use global variables.. unless that seems to be the only way?

For example, I interacted with Person A and I want to set a variable within Person A's memory that Player cannot talk to Person A until another time being. However when I talk to Person B, they seem to inherit Person A's memory, so I'm assuming $entity.DONOTINTERACT is not the right way to do it.  ;D

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24113
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7793 on: July 30, 2021, 12:38:41 PM »

When you're inside the conversation, just doing:
$variable = whatever
Will store it in the person's memory.

$entity.variable will store it in the memory of the entity you're interacting with. In the case of a typical market, this'll be the planet or station - which, of note, will depend on what the player clicked on to interact with it. So usually you'd use $market.variable if you wanted that sort of thing. But, right, you're looking for just $variable, I think.
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7794 on: July 30, 2021, 12:42:33 PM »

When you're inside the conversation, just doing:
$variable = whatever
Will store it in the person's memory.

$entity.variable will store it in the memory of the entity you're interacting with. In the case of a typical market, this'll be the planet or station - which, of note, will depend on what the player clicked on to interact with it. So usually you'd use $market.variable if you wanted that sort of thing. But, right, you're looking for just $variable, I think.
Oh wow that was easier than I thought, thanks!

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7795 on: July 30, 2021, 12:51:54 PM »

Hmmm...

is there a good method in rules.csv to store variables inside the person interacted with? I don't want to use global variables.. unless that seems to be the only way?

For example, I interacted with Person A and I want to set a variable within Person A's memory that Player cannot talk to Person A until another time being. However when I talk to Person B, they seem to inherit Person A's memory, so I'm assuming $entity.DONOTINTERACT is not the right way to do it.  ;D

Well, Alex ninjaed with an easier solution in this case (also didn't know that so good to know), but since I used this in the past to store unique information globally for various things I'll go ahead and post it.  ;D

What you might try doing is a bit of a hacky workaround:

The person has a unique name (presumably), so add the unique name to the variable in the entity (I still wouldn't do global unless there isn't a way around it.) Then, in the rule command script that is part of your condition, have a control part of the variable to check for, and then cross-reference that with the name of the PersonAPI the player is talking to to determine whether the condition is true or false.

Example:

PersonAPI name: Third Oberon

variable A: $entity.DONOTINTERACT - set it to true, then add

variable B: $entity.DONOTINTERACT_THIRDOBERON = true

Script:

Code
if (memory.getBoolean("$entity.DONOTINTERACT");) {
     String memKey = "$entity.DONOTINTERACT" + "_" + PersonAPI.getName().getFirstName().toUpperCase() + PersonAPI.getName().getLastName().toUpperCase();
     return memory.getBoolean(memKey);
} else {
     return false;
}
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7796 on: July 30, 2021, 01:43:49 PM »

Hmmm...

is there a good method in rules.csv to store variables inside the person interacted with? I don't want to use global variables.. unless that seems to be the only way?

For example, I interacted with Person A and I want to set a variable within Person A's memory that Player cannot talk to Person A until another time being. However when I talk to Person B, they seem to inherit Person A's memory, so I'm assuming $entity.DONOTINTERACT is not the right way to do it.  ;D

Well, Alex ninjaed with an easier solution in this case (also didn't know that so good to know), but since I used this in the past to store unique information globally for various things I'll go ahead and post it.  ;D

What you might try doing is a bit of a hacky workaround:

The person has a unique name (presumably), so add the unique name to the variable in the entity (I still wouldn't do global unless there isn't a way around it.) Then, in the rule command script that is part of your condition, have a control part of the variable to check for, and then cross-reference that with the name of the PersonAPI the player is talking to to determine whether the condition is true or false.

Example:

PersonAPI name: Third Oberon

variable A: $entity.DONOTINTERACT - set it to true, then add

variable B: $entity.DONOTINTERACT_THIRDOBERON = true

Script:

Code
if (memory.getBoolean("$entity.DONOTINTERACT");) {
     String memKey = "$entity.DONOTINTERACT" + "_" + PersonAPI.getName().getFirstName().toUpperCase() + PersonAPI.getName().getLastName().toUpperCase();
     return memory.getBoolean(memKey);
} else {
     return false;
}
Oh yeah, that code is definitely really useful when I think I need to have uhh "clones" of a certain person A around as an officer, administrator, and other various things...  ;)

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7797 on: July 30, 2021, 02:21:22 PM »

Oh yeah, that code is definitely really useful when I think I need to have uhh "clones" of a certain person A around as an officer, administrator, and other various things...  ;)

Right I used it to store officer data globally. That way, even if the reference to the PersonAPI was destroyed for some reason, you could just build it back using the stored information - including skills. So even if the officer "left the fleet" for any reason, and you wanted to have them reappear in a story encounter, you could do so fairly easily.

It's really essentially to ensure that story characters are always available at any given encounter - though this was back in 0.8 so none of the new story framework was available so it might not even be necessary now or could be done more easily. Still, its nice to know its available.
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7798 on: July 30, 2021, 06:08:34 PM »

What determines... planet class? And can I do anything about it by setting it code-wise? I have this procgen planet with a size 1 but yet... very decent hazard rating and conditions.

Originem

  • Purple Principle
  • Captain
  • ****
  • Posts: 430
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7799 on: July 31, 2021, 08:04:27 AM »

Is there any way to show custom confirm dialog without using interaction dialog in the campaign layer?
What I know is:
boolean showConfirmDialog(String message, String ok, String cancel, float width, float height, Script onOk, Script onCancel);
It's not customizable, so will it be some customized functions?
Logged
My mods


Pages: 1 ... 518 519 [520] 521 522 ... 710