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)

Author Topic: [0.95a]A problem about bar event  (Read 966 times)

cjy4312

  • Ensign
  • *
  • Posts: 40
    • View Profile
[0.95a]A problem about bar event
« on: July 16, 2021, 08:04:43 AM »

hi!

Im trying to addOption with same optionId
for example:

      {........
                 options.addOption("TextA", OptionId.A);
                 options.addOption("TextB", OptionId.B);
                 options.addOption("TextC", OptionId.B);
                 break; 
          case A:
                ....................
                   ........}
It will like this in game:
                         1.TextA
                         3.2TextB
                         TextC

If I use different optionId like
       {........
                 options.addOption("TextA", OptionId.A);
                 options.addOption("TextB", OptionId.B);
                 options.addOption("TextC", OptionId.C);
                 break; 
          case A:
                ....................
                   ........}
It will be normal:
                         1.TextA
                         2.TextB
                         3.TextC

Is this a bug?

*I uploaded two screenshots to show this thing


[attachment deleted by admin]
Logged

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: [0.95a]A problem about bar event
« Reply #1 on: July 16, 2021, 12:24:05 PM »

Bug or at least an oddity. Just use:


Case A:
  Do stuff;
  Break;
Case B:
Case C:
  Do stuff;
  Break;
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: [0.95a]A problem about bar event
« Reply #2 on: July 16, 2021, 12:43:31 PM »

Right yeah you can't have two options link to the same rule condition by having the option ids be the same - the game will link them on one line, but you can have the unique option ids link to essentially the same response by copying the initial rule you want to point to and having the second version's condition be the second option id you want to use.

Rough example:

options:
                 options.addOption("TextA", OptionId.A);
                 options.addOption("TextB", OptionId.B);
                 options.addOption("TextC", OptionId.C);

rule 1
condition: id == OptionId.A
run script A
generate text A

rule 2
condition: id == OptionId.B
run script B
generate text B

rule 3
condition: id == OptionId.C
run script B
generate text B
Logged

cjy4312

  • Ensign
  • *
  • Posts: 40
    • View Profile
Re: [0.95a]A problem about bar event
« Reply #3 on: July 16, 2021, 08:19:18 PM »

Right yeah you can't have two options link to the same rule condition by having the option ids be the same - the game will link them on one line, but you can have the unique option ids link to essentially the same response by copying the initial rule you want to point to and having the second version's condition be the second option id you want to use.

Rough example:

options:
                 options.addOption("TextA", OptionId.A);
                 options.addOption("TextB", OptionId.B);
                 options.addOption("TextC", OptionId.C);

rule 1
condition: id == OptionId.A
run script A
generate text A

rule 2
condition: id == OptionId.B
run script B
generate text B

rule 3
condition: id == OptionId.C
run script B
generate text B

thank u , im going to use this
Logged