Home » PLAYER'S HQ 1.13 » JA2 Complete Mods & Sequels » Stracciatella Project (Platform Independent JA2) » IMP test attitude and traits
IMP test attitude and traits[message #259829] Thu, 19 August 2010 09:59 Go to next message
Kokkolar is currently offline Kokkolar

 
Messages:18
Registered:July 2010
Location: Russia
In IMP test i try to get special attitude like optimist, loner etc and trait like nervous, claustrophobic etc, but all the time my IMP charecter gets "normal" - attitude and "normal/psycho" - trait. I have never received "loner-nervous" or something like that, but i tried to do it using this file http://ja2.monkeyphysics.com/home/imp.

Is it vanilla "official bug" like impossibility to lvl up for Len Anderson?

Report message to a moderator

Private
Re: IMP test attitude and traits[message #259830] Thu, 19 August 2010 10:19 Go to previous messageGo to next message
Muffin is currently offline Muffin

 
Messages:6
Registered:February 2010
In vanilla Len can't level up, that's WAD (working as designed), something along the line of "to old" and to "unchangeable opinion".
But somewhere around here should be a Editor for the prof.dat, with which you could change this quite easily (just uncheck a checkbox).


The IMP has 3 characteristics (besides physical stats like markmansship):
- Attitude (e.g. normal, loner, optimist etc)
- up to 2 skills (Auto-Weapons, Ambidexterity etc), note that you could have most skills 2 times (expert level)
- a Disability (psycho, fear of insects, nonswimmer etc)

if you want a specific combination, take only the corresponding answers (e.g. no effect). if you take 4times optimist and 1time normal you got a 50-50chance for either. Note that you can skip questions (at least if i remember correctly).

Report message to a moderator

Private
Re: IMP test attitude and traits[message #259857] Thu, 19 August 2010 15:56 Go to previous messageGo to next message
Kokkolar is currently offline Kokkolar

 
Messages:18
Registered:July 2010
Location: Russia
my IMP test

6(optimist)231-4443(optimist)-1(forgetful)158-1(forgetful)444

And my merc gets normal-normal again. (-_-)

version stracc 7059hotfix3

Report message to a moderator

Private
Re: IMP test attitude and traits[message #259924] Thu, 19 August 2010 23:40 Go to previous messageGo to next message
bbun is currently offline bbun

 
Messages:74
Registered:April 2004
Location: Amsterdam
Regarding the properties of IMPs (and mercs in general), Muffin is right. Also refer to my online Prof.dat editor: http://ja2.monkeyphysics.com/profdat

Lovely that you found your way to my custom IMP file, Kokkolar. I can't tell you why you have no luck getting a specific personality trait Neutral I do know how the game determines your Personality and Attitude though:

Based on all the answers from the quiz, the game selects 1 attitude, 2 skills and 1 disability (actually called personality in the code) randomly from the selections based on answers. So there is a random factor...

Report message to a moderator

Corporal
Re: IMP test attitude and traits[message #259962] Fri, 20 August 2010 11:33 Go to previous messageGo to next message
dnyarri is currently offline dnyarri
Messages:4
Registered:January 2010
Location: Russia
Kokkolar, look up this issue on AG forums -- legolegs explained how's the test is broken.

Report message to a moderator

Civilian
Re: IMP test attitude and traits[message #260281] Sun, 22 August 2010 16:06 Go to previous messageGo to next message
Kokkolar is currently offline Kokkolar

 
Messages:18
Registered:July 2010
Location: Russia
Dnyarri
Kokkolar, look up this issue on AG forums -- legolegs explained how's the test is broken.


Thx, i found that post. IMP test bugged as i said.

Report message to a moderator

Private
Re: IMP test attitude and traits[message #261001] Sun, 29 August 2010 23:27 Go to previous message
mgl is currently offline mgl

 
Messages:255
Registered:December 2007
Location: France
Kokkolar
In IMP test i try to get special attitude like optimist, loner etc and trait like nervous, claustrophobic etc, but all the time my IMP charecter gets "normal" - attitude and "normal/psycho" - trait. I have never received "loner-nervous" or something like that


The personality can only be "normal" or "psycho" for an IMP. The code says that the voices are not recorded for other personality traits.

For the attitude, only a few of them are really used in the code. I quickly looked at the function to give an IMP an attitude in the file "Build/Laptop/IMP_Compile_Character.cc", function "CreatePlayerAttitude()". The full text of the function is at the end of my post.

I noticed two problems:

	INT32 iDiceValue = Random(iNumAttitudesWithHighestHits + 1); // XXX TODO0008

The TODO0008 comment means that Tron noticed it too.
"iNumAttitudes..." is the number of competing attitudes to be yours. For example, if you have 3 votes for "aggressive", 3 for "loner" and 2 for "asshole", "aggressive" and "loner" will compete to be your attitude because they are equals on the best score. The "Random()" function simply elects one of them to be your attitude.

"Random(n)" returns something in the range [0, n[ (excluding n) like a dice.
In my example, "Random(2)" ("aggressive" and "loner" attitudes competing to be yours) would roll 0 or 1, which is good because you have two competing attitudes and two faces on the dice. Unfortunately, the code calls "Random(2 + 1)" instead, which gives you two competing attitudes and three possible rolls.

I would remove the "+ 1" from the code.




			if (iCounter2 == iDiceValue)
			{
				// this is it!
				iAttitude = iCounter2;
				break;
			}

Here, your final attitude "iAttitude" is set. The code forgets about the competing attitudes and takes the value on the face of the dice as your attitude. In my example, if the dice rolled a 1, it means that your attitude should be the second one: "loner". But the code would give you the code value "1" (the number on the face of the dice) as an attitude, which is "friendly" and not "loner". If the dice had rolled a 0, you would have got the attitude code 0, which is "normal".

I would write "iAttitude = i;" instead.




I won't go farther on this subject because I don't use the original IMP creation screen at all but an alternate one that I wrote. I released its code on this forum two years ago. Personality and attitude come straight from check boxes in my interface and I don't use the function I quoted. It's a rather big patch and I don't want to roll it back to do the tests for this bug.

Maybe bbun can fix it ?




This is the whole code of the function I quoted.
"Build/Laptop/IMP_Compile_Character.cc":
static void CreatePlayerAttitude(void)
{
  // this function will 'roll a die' and decide if any attitude does exists
	INT32	iAttitudeHits[NUM_ATTITUDES] = { 0 };

	iAttitude = ATT_NORMAL;

	if (iLastElementInAttitudeList == 0)
	{
		return;
	}

	// count # of hits for each attitude
	for (INT32 i = 0; i < iLastElementInAttitudeList; i++)
	{
		iAttitudeHits[AttitudeList[i]]++;
	}

	// find highest # of hits for any attitude
	INT32	iHighestHits = 0;
	INT32	iNumAttitudesWithHighestHits = 0;
	for (INT32 i = 0; i < NUM_ATTITUDES; i++)
	{
		if (iAttitudeHits[i])
		{
			if (iAttitudeHits[i] > iHighestHits)
			{
				iHighestHits = iAttitudeHits[i];
				iNumAttitudesWithHighestHits = 1;
			}
			else if (iAttitudeHits[i] == iHighestHits)
			{
				iNumAttitudesWithHighestHits++;
			}
		}
	}

	INT32 iDiceValue = Random(iNumAttitudesWithHighestHits + 1); // XXX TODO0008
	
	// find attitude
	INT32 iCounter2 = 0;
	for (INT32 i = 0; i < NUM_ATTITUDES; i++)
	{
		if (iAttitudeHits[i] == iHighestHits)
		{
			if (iCounter2 == iDiceValue)
			{
				// this is it!
				iAttitude = iCounter2;
				break;
			}
			else
			{
				// one of the next attitudes...
				iCounter2++;
			}
		}
	}
}

Report message to a moderator

Master Sergeant
Previous Topic: Ja2 crash bug
Next Topic: sgp/Random.cc
Goto Forum:
  


Current Time: Wed May 15 05:43:21 GMT+3 2024

Total time taken to generate the page: 0.01283 seconds