OpenXcom Forum
OpenXcom => Troubleshooting => Topic started 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?
-
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.
-
It works like the vanilla, you have to wait for the end of the month.
-
I completely forgot about this behaviour!!! :o
-
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...
-
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
-
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.)
-
Good idea, darkestaxe. Do you have a working code?
-
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.
-
If you want to do good, do it self))
https://github.com/SupSuper/OpenXcom/pull/461 (https://github.com/SupSuper/OpenXcom/pull/461)
-
Psy-skill amounts and stuff should be in the ruleset.
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
}
}
-
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.
-
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.
-
oops. You're right. The ruleset has these strings:
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.
-
I don't mind adding new stuff to the ruleset as long as Xcom1Ruleset maintains the vanilla behavior.