OpenXcom Forum

OpenXcom => Troubleshooting => Topic started by: bulltza on March 27, 2013, 03:40:51 pm

Title: How the *** do you put your soldiers in psi training?
Post by: bulltza 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?
Title: Re: How the *** do you put your soldiers in psi training?
Post by: kkmic 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.
Title: Re: How the *** do you put your soldiers in psi training?
Post by: SupSuper on March 27, 2013, 09:11:34 pm
It works like the vanilla, you have to wait for the end of the month.
Title: Re: How the *** do you put your soldiers in psi training?
Post by: bulltza on March 27, 2013, 09:19:53 pm
I completely forgot about this behaviour!!! :o
Title: Re: How the *** do you put your soldiers in psi training?
Post by: Ran 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...
Title: Re: How the *** do you put your soldiers in psi training?
Post by: luke83 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
Title: Re: How the *** do you put your soldiers in psi training?
Post by: darkestaxe 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:

Title: Re: How the *** do you put your soldiers in psi training?
Post by: redv on April 08, 2013, 09:15:59 pm
Good idea, darkestaxe. Do you have a working code?
Title: Re: How the *** do you put your soldiers in psi training?
Post by: darkestaxe 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.
Title: Re: How the *** do you put your soldiers in psi training?
Post by: redv on May 09, 2013, 11:08:12 am
If you want to do good, do it self))

https://github.com/SupSuper/OpenXcom/pull/461 (https://github.com/SupSuper/OpenXcom/pull/461)
Title: Re: How the *** do you put your soldiers in psi training?
Post by: darkestaxe 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
  }
}
Title: Re: How the *** do you put your soldiers in psi training?
Post by: redv 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 (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.
Title: Re: How the *** do you put your soldiers in psi training?
Post by: darkestaxe 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.
Title: Re: How the *** do you put your soldiers in psi training?
Post by: redv 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.
Title: Re: How the *** do you put your soldiers in psi training?
Post by: SupSuper 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.