Author Topic: How the *** do you put your soldiers in psi training?  (Read 14755 times)

Offline bulltza

  • Sergeant
  • **
  • Posts: 25
    • View Profile
How the *** do you put your soldiers in psi training?
« on: March 27, 2013, 03:40:51 pm »
Hi guys, I just completed building a couple of psi lavoratories but I can't remember how to put my soldiers into that training. Maybe it is a bug? can someone drive me?

Offline kkmic

  • Commander
  • *****
  • Posts: 582
  • Undefined
    • View Profile
Re: How the *** do you put your soldiers in psi training?
« Reply #1 on: March 27, 2013, 04:56:25 pm »
At the end of a month, you'll get a popup that will allow you to assign soldiers to PSI training.

At least this is the vanilla behavior. I'm not sure if it was implemented or not in OXC.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: How the *** do you put your soldiers in psi training?
« Reply #2 on: March 27, 2013, 09:11:34 pm »
It works like the vanilla, you have to wait for the end of the month.

Offline bulltza

  • Sergeant
  • **
  • Posts: 25
    • View Profile
Re: How the *** do you put your soldiers in psi training?
« Reply #3 on: March 27, 2013, 09:19:53 pm »
I completely forgot about this behaviour!!! :o

Offline Ran

  • Colonel
  • ****
  • Posts: 196
    • View Profile
Re: How the *** do you put your soldiers in psi training?
« Reply #4 on: March 30, 2013, 02:38:22 am »
Psi-lavatories? ;D

I was searching for this option like a fool as well, I guess not having played the game for about 17 years does count as an excuse...

Offline luke83

  • Commander
  • *****
  • Posts: 1559
    • View Profile
    • openxcommods
Re: How the *** do you put your soldiers in psi training?
« Reply #5 on: March 30, 2013, 02:42:31 am »
Yes , Psi-Lavatories help you squeeze one out by moving the poop through your system with you Psi power and non of that pesky  squeezing.  8)


Back on topic ,,, Is this something that could be changed at a later date, i would rather do it as soon as i think about it via a button somewhere within the soldiers screen perhaps? I would also like to add a solders Training room later also like in apocalypse as such waiting for a pop-up for that also would give me the poops :o

Offline darkestaxe

  • Colonel
  • ****
  • Posts: 254
  • Emissary of the Brain
    • View Profile
Re: How the *** do you put your soldiers in psi training?
« Reply #6 on: April 07, 2013, 04:40:57 am »
I'm not sure how to implement telekinetic bowel movements but for psi labs I'd like to see an alternate implementation that doesn't limit you to the end of the month. Here's how I'd implement an alternate psy-training if I understood C++/OXC code:

  • Any soldier can be placed into or removed from psy-training at any time. The psy-training enrollment screen would be accessible from the 'soldiers' screen or psy-training could be toggled from a soldiers stat screen.
  • Initially soldiers will start with a negative psy-skill value which will be used to determine how many more days of psy-training they need to unlock their psy-potential. Their Psy-skill would still be hidden on their stat sheet, the purple notice in the upper left would say the number of days of psy-training remaining. (We don't want to add a new var to record the amount of psy training done if we don't need too. The battlescape code for psionic attack/defense strength would have to treat negative psy-skill as 0 psy-skill.)
  • Psy-Training would be calculated every day at 0:00
  • Soldiers with psy-skill < 0 would get ++psy-skill each day
  • Soldiers with psy-skill 0 would get +14 to +26 psy-skill
  • Soldiers with >1 and <19 psy-skill would get +1 psy-skill each day
  • Soldiers with >19 would have a chance of getting a psy-skill equal to 30 / (2*psy-skill)
  • Finally any soldiers purchased, whether or not alternate psy-training is being used, will start with -30 psy-skill. (Soldiers from old save-games that have 0 psy-skill and aren't in psy-training should have their psy-skill set to -30 as well. The actual -Psy value should be set in the ruleset and should just default to 30. Any soldiers with a psy-skill lower then the initial amount currently set in the ruleset (-45) should have their value reset to the starting value in the ruleset on their first day of psy-training.)

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Re: How the *** do you put your soldiers in psi training?
« Reply #7 on: April 08, 2013, 09:15:59 pm »
Good idea, darkestaxe. Do you have a working code?

Offline darkestaxe

  • Colonel
  • ****
  • Posts: 254
  • Emissary of the Brain
    • View Profile
Re: How the *** do you put your soldiers in psi training?
« Reply #8 on: May 09, 2013, 10:46:16 am »
Good idea, darkestaxe. Do you have a working code?

I wish I did :(

" Here's how I'd implement an alternate psy-training if I understood C++/OXC code:"

This means "I don't know how to make the code, but if I did this is what I'd do:"

I'm not a very experienced programmer and I don't know enough C++ to work on OpenXcom.

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Re: How the *** do you put your soldiers in psi training?
« Reply #9 on: May 09, 2013, 11:08:12 am »
If you want to do good, do it self))

https://github.com/SupSuper/OpenXcom/pull/461

Offline darkestaxe

  • Colonel
  • ****
  • Posts: 254
  • Emissary of the Brain
    • View Profile
Re: How the *** do you put your soldiers in psi training?
« Reply #10 on: May 10, 2013, 12:52:07 am »
Psy-skill amounts and stuff should be in the ruleset.

Code: [Select]
void Soldier::trainPsi()
 {
+  if (Options::getBool("quickPsiTraining"))
+  {
+    if (_currentStats.psiSkill > 0)
+    {
+      if (100 * 10/_currentStats.psiSkill > RNG::generate(0, 100))
+        _currentStats.psiSkill++;
+      if(_currentStats.psiSkill > 100)
+        _currentStats.psiSkill = 100;
+    }
+    else if (_currentStats.psiSkill < 0)
+    {
+      _currentStats.psiSkill++;
+      if (_currentStats.psiSkill == 0)  https:// initial training is over
+      {
+        _currentStats.psiSkill = RNG::generate(16, 24);
+      }
+    }
+    else if (_currentStats.psiSkill == 0)
+    {
+      _currentStats.psiSkill = -RNG::generate(20, 40);  https:// initial training from 20 to 40 days
+    }
+    return;
+  }
+
   _improvement = 0;
   if(_currentStats.psiSkill <= 16)
     _improvement = RNG::generate(16, 24);

This forces everyone to use our training amounts. I don't know how to reference the ruleset so I'll just guess.

Also if we skip 0 and start training at -1, then all untrained soldiers in our system will have psy-skill < 0 and all untrained soldiers in the vanilla system will have psy-skill = 0.

Also, doesn't OXC use a lot of unsigned ints? If it does, we might have a problem with -13 psy-skill meaning 12 days until you get psy-skill.

Here is pseudo-code of what I'm thinking of.

void Soldier::trainPsi()
{
  if (Options::getBool("quickPsiTraining"))
  {
    p =_currentStats.psiSkill;
    r = Ruleset.PsyTraining;

    https://Check for soldiers from legacy system or soldiers with too many training days left.
    if(p = 0 || p < r.MaxDaysToTrain() * -1)
    p = RNG::generate(r.MinDaysToTrain(), r.MaxDaysToTrain()) * -1; https:// Set soldier to first day of training
    elseif (p < -1)
      p++; https://Train soldier for one day
    elseif(p = -1)
      p = RNG::generate(Ruleset.Stats.Min.PsySkill, Ruleset.Stats.Max.PsySkill); https://Today is last day of training
    }
    elseif(p >= Ruleset.Stats.Cap.PsySkill())
      https:// do nothing; soldier is at the cap.
    else
    {
      /*Modders should be able to change the incriment probability calculations
       *Defaults: r.Mult = 1, r.Base = 0, r.Good = 10 r.incriment = 1.
       *Default chances are 10/psy-skill that soldier will learn 1 psy-skill today.*/

      rnd = RNG::generate(0, (r.Mult * p) + r.Base);
      if ( rnd <= r.Good )
        p += r.Incriment; https:// Modders can have +2 or +3 psy-skill a day if they really want
    }
  }
  else
  {
    https://normal monthly psy-training code
  }
}

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Re: How the *** do you put your soldiers in psi training?
« Reply #11 on: May 10, 2013, 11:12:38 am »
No. This is the first implementation of code.
Final commit is:
https://github.com/SupSuper/OpenXcom/pull/461/files#L24R457

As I understood objectives of the project OpenXcom, the ruleset file must contain only parameters of vanilla behavior. This is reason why I can't to save parameters of the option in the ruleset.

Offline darkestaxe

  • Colonel
  • ****
  • Posts: 254
  • Emissary of the Brain
    • View Profile
Re: How the *** do you put your soldiers in psi training?
« Reply #12 on: May 11, 2013, 08:58:44 am »
I think you're right, we're not supposed to be adding stuff to the ruleset for optional non-vanilla mods.

This however:
+    if (++_currentStats.psiSkill == 0)  https:// initial training is over
+      _currentStats.psiSkill = RNG::generate(ruleset.soldiers.xcom.minstats.psyskill(),
           ruleset.soldiers.xcom.maxstats.psyskill());

We should still use min-max stats from the ruleset. I was trying to find how this is supposed to be done but it isn't currently anyway.

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Re: How the *** do you put your soldiers in psi training?
« Reply #13 on: May 11, 2013, 10:04:23 am »
oops. You're right. The ruleset has these strings:
Code: [Select]
soldiers:
  - type: XCOM
    minStats:
      tu: 50
      stamina: 40
      health: 25
      bravery: 10
      reactions: 30
      firing: 40
      throwing: 50
      strength: 20
      psiStrength: 0
      psiSkill: 16
      melee: 20
    maxStats:
      tu: 60
      stamina: 70
      health: 40
      bravery: 60
      reactions: 60
      firing: 70
      throwing: 80
      strength: 40
      psiStrength: 100
      psiSkill: 24
      melee: 40
    armor: STR_NONE_UC
    standHeight: 22
    kneelHeight: 14

Checking the ruleset added to last commit.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: How the *** do you put your soldiers in psi training?
« Reply #14 on: May 11, 2013, 05:28:30 pm »
I don't mind adding new stuff to the ruleset as long as Xcom1Ruleset maintains the vanilla behavior.