Bug ? +NEW [Bug 1.0.22] + Low Level Hero Skill Bug ?

There is no peace among the stars: the Imperium of Man is beset on all sides by all kinds of threats. Among them is the Orks, a barbaric and warlike xeno race. One of their fiercest leaders, Grukk Face-Rippa, leads his Red Waaagh! in the Sanctus Reach system...
Post Reply
Exaercase
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 37
Joined: Tue May 16, 2017 2:13 pm

Bug ? +NEW [Bug 1.0.22] + Low Level Hero Skill Bug ?

Post by Exaercase »

Hello,

First sorry for my english i m not and native english speaker
Second i hope not do mistake in my analyse. If it's the case sorry for the disturbing.
---------
With the help of PIP i've be able to understand more about sript and modify it to do for my usage (i like understand what happen in combat) a Battle Log Interface.

So i've be able to see some strange thing happen in the CombatTools.BSF. Some Aera Weapon/Melee/Ability would have damage that (sorry im french and it s a matematic expression so i try to say in english) go forward zero. The reason is realtively simple and it's correct for exemple for Frag grenade.
When you do "for ()" loop (or multi imbricated "for ()" loop for multi-tiles impact) you don't reinitialize the variable damage and APDamge. So for the next men in unit or men in unit in the blast area we use the previous result. and this previous result could be less that initial and so on so time after time the total damge go forward zero.

Here an exemple of correct code : FUNCTION FragGrenade

Code: Select all

	for(r=tilex-radius; r<=tilex+radius; r++)
	{
		for(t=tiley-radius; t<=tiley+radius; t++)
		{
			men = 1;
			target = GetUnitOnTile(r,t);
			if (IsUnitValid(target) == 1 && target != me)
			{
				for (i=0; i<GetUnitMen(target); i++)
				{
					if (GetUnitManDead(target, i) == 0)
					{
						man = men;
						
//ExA note : It' here we reinit for the next men damage and APDamge variable
						damage = 20;
						APDamage = 0;
						
						WeaponPowerRoll = Rand(1, 100);
						WeaponApRoll = Rand(1, 100);
						BallisticProtectionRoll = Rand(1, 100);
						HeavyArmourRoll = Rand(1, 100);
.
.
.
                                       }
				}
			}
		}
	}
So now an exemple of function with problem : FUNCTION DoFire

Code: Select all

FUNCTION DoFire(me, x, y, weapon, KFF)
{
[i]var declaration[/i]

	UseVizQueue(1);
	miss = 1;
	if (weapon == 1)
	{
		damage = GetAttrib(me, "1ST_Damage");
		APDamage = GetAttrib(me, "1ST_Damage");
	}
	if (weapon == 2)
	{
		damage = GetAttrib(me, "2ND_Damage");
		APDamage = GetAttrib(me, "2ND_Damage");
	}
	if (weapon == 3)
	{
		damage = GetAttrib(me, "3RD_Damage");
		APDamage = GetAttrib(me, "3RD_Damage");
	}
	
	if (HasDabestAmmo(me) == 1)
	{
		damage += 15;
		APDamage += 15;
	}
	
	if (HasBlessingofMork(unit) == 1 && GetAttribArray(unit, "AbilityCooldown2", 6) == 5)
	{
		damage = 0;
		APDamage = 0;		
	}
	

//ExA note : First Part of the function it it for blast damge so problem
//ExA note : Second part for unique man damage so no problem

	if (IsBlastWeapon(me, weapon) > 0)
	{

		PlayImpactSound(me, -1, weapon, x, y, 0);
		AddVizSpotAnim(x, y, GetHitEffect(me, weapon), GetHitEffectIndex(me, weapon), 25, -1, 0, GetProjCoverHeight(me, x/100, y/100));	
		// do area damage
		r = 0;
		
		if (IsBlastWeapon(me, weapon) > 1)
		{
			r = 1;
		}
		for (j = (x/100) - r; j <= (x/100) + r; j++)
		{		
			for (k = (y/100) - r; k <= (y/100) + r; k++)
			{
				unit = GetUnitOnTile(j, k);
				
//ExA note : I cut the tile damge
				
				if (IsUnitValid(unit) == 1)
				{
					miss = 0;

					for (i=0; i<GetUnitMen(unit); i++)
					{
						if (GetUnitManDead(unit, i) == 0)
						{

//ExA note : NO Reinit of damage and APDamage 

							miss = 0;
							// do attack roll
							WeaponPowerRoll = Rand(1, 100);
							WeaponApRoll = Rand(1, 100);
							BallisticProtectionRoll = Rand(1, 100);
							HeavyArmourRoll = Rand(1, 100);
							
//ExA note : begin of final damage calculation and armor reduction and effect
//ExA note : So the next man inherit of the final damge and APDamge of the previous
//ExA note : and so time after time the damge and APDamge go forward zero
.
.
.
                                                }
                                        }
                              }
                     }
             }
        }
        else
        {
//ExA note : non blast weapon = no pb i think with the if (GetPositionDistance(x,y,GetManX(unit, i),GetManY(unit, i)) < 5) that select one man
        }
}
An exemple of correction that i use
i put the initial damage and APDamge in a variable and use it for the reinit.

For the other case is more simple to correct it

Other Function with the same pb (i think) :
FUNCTION TriggerAreaMelee
FUNCTION TriggerPowerBurst (i m not totaly sure)
FUNCTION DoBonusRokkit (Seem's work like Function DoFire one part on blastweapon with the problem and one part non blast that is ok (use of "if (GetPositionDistance(x,y,GetManX(unit, i),GetManY(unit, i)) < 2)" ))

No pb in (i think)
FUNCTION DoKillbolt is ok i thnk is as the dofire non blast part the "if (GetPositionDistance(x,y,GetManX(unit, i),GetManY(unit, i)) < 2)" select only one man



---------------------------------------------------
Totaly another thing i think in (Here i do an error yesterday is not frag but krak function but code it s ok) FUNCTION KarkGreande you have forget to put in commentary a line (in all other damage function this line is in commentary moreover if no you could do more damage if you loss your damage roll that if you do a roll > as 50% of power (Init Damage = 60 : Roll < 50% Power Damage = 120, Roll >50% Power Damage = 20 !!!!!, Roll MISS Damage = 30 !!!!)

Code: Select all

//ExA Note : Part of Krak (damge calculation part) (NB : Power = 70)

			damage = 60;
			APDamage = 0;
			
			WeaponPowerRoll = Rand(1, 100);
			WeaponApRoll = Rand(1, 100);
			BallisticProtectionRoll = Rand(1, 100);
			HeavyArmourRoll = Rand(1, 100);

			if (WeaponPowerRoll < (35))
			{
//  ExA Note : Damage = 120
				damage += damage;
			}
			else if (WeaponPowerRoll < 70)
			{
//  ExA Note : Here i think miss the "//"
//  ExA Note : Damage = 20 < of the miss roll below = 30
			        damage = 20;
			}
			else
			{
//  ExA Note : Damage = 30
				damage = damage/2;
			}
--------------------------------------------------------
NB : Corrected with the steam update for Legacy of Weirdboy DLC

A Last thnig but i think no pb about that else we take a compilation error :

Code: Select all

FUNCTION GetAttribFromWeapon(me, weapon, char attrib[32])
{
	StartWorkString(11) ;
	if (weapon == 1)
	{
		PrintWorkStringLiteral("1ST", 11)
	}
	if (weapon == 2)
	{
		PrintWorkStringLiteral("2ND", 11)
	}
	if (weapon == 3)
	{
		PrintWorkStringLiteral("3RD", 11)
	}
	
	StartWorkString(12);
	PrintWorkStringLiteral(GetWorkString(11), 12);
	PrintWorkStringLiteral(attrib, 12);

// ExA Note : miss a  ")" a the end
	return GetAttrib(me, GetWorkString(12) ;
}
---------------------------------------------------------------------------

and some error in debug mode about unit that don t exist "painboy" and "Big_Redd" that it call in one function (AITool) for the first and many for the second.

---------------------------------------------------------------------------

Thx if you would had the courage to read untill here :)
hope no mistake for me
and hope i ve could help you

Bye
Regards ExA
Last edited by Exaercase on Fri Jul 07, 2017 6:07 pm, edited 8 times in total.
Exaercase
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 37
Joined: Tue May 16, 2017 2:13 pm

Re: Bug ? (i hope don't do mistake :)

Post by Exaercase »

Hello again,

Another potential bug in FUNCTION TriggerFlamerAttack :

Flamer do 15 damage and HeavyFlamer 20 in the description of the weapon.
In the code the damage when init/re-init is not a call to a function to fetch back the damage value of the weapon but a integer literal value fixed to 15

Code: Select all

FUNCTION TriggerFlamerAttack(me, tilex, tiley)
{
//Exa : init of the variable

	if ( GetAttrib(me, "AoEType") == 1)
	{
		flamerange = 3; // ExA Noramal Flamer (Info of the weapon give Damage = 15)
	}
	if ( GetAttrib(me, "AoEType") == 2)
	{
		flamerange = 4;  // Heavy Flamer (info of the weapon give Damage = 20 !!! see below why important)
	}

// Exa : some code 
							
	for(j=minY;j<=maxY;j++)
	{
		for(i=minX;i<=maxX;i++)
		{
			if (AdvGetUnitFlamerLOS(me, i, j) == 1)
			{
				directionOfTarget = GetAngleFromTile(tilex, tiley, me, 1) ;
				directionOfTile = GetAngleFromTile(i, j, me, 1) ;
				
				if (directionOfTarget == 180)
				{
					directionOfTile = GetAngleFromTile(i, j, me, 0) ;
				}
				
				if ((directionOfTile > directionOfTarget-30) && (directionOfTile < directionOfTarget+30))
				{
					if (GetDistanceBetweenTiles(i, j, GetUnitX(me), GetUnitY(me)) <= flamerange)
					{					
						unit = GetUnitOnTile(i, j);

						men = 1;
						UseVizQueue(1);
						for (p=0; p<GetUnitMen(unit); p++)
						{
							if (GetUnitManDead(unit, p) == 0)
							{
								man = men;

// ExA : Here is init and reinit for each target underd zone of fire the damage to the litteral int "15" but Heavy Flamer do "20" damage
								
								damage = 15;
								APDamage = 0;

								if (HasBlessingofMork(unit) == 1 && GetAttribArray(unit, "AbilityCooldown2", 6) == 5)
								{
									damage = 0;
									APDamage = 0;		
								}								
								WeaponPowerRoll = Rand(1, 100);
								WeaponApRoll = Rand(1, 100);
								BallisticProtectionRoll = Rand(1, 100);
								HeavyArmourRoll = Rand(1, 100);

// ExA : code for balistic dmg and after we found same pb in code for APDmg, int literal 15 (flamer), so problem for heavyflamer (dmg 20)

								if (WeaponApRoll < FlameWeaponAPDamageChance(me, unit))
								{
									APDamage = 15;
								}
.
.
.
// ExA : the end of the code
Hope no mistake
Hope that help
Regards
ExA
GordonStraylight
Straylight
Straylight
Posts: 148
Joined: Tue Aug 16, 2016 12:47 pm

Re: Bug ? (i hope don't do mistake :)

Post by GordonStraylight »

Ah yes, you are correct the script for blast damage is wrong!

Good catch and thanks for keeping us on our toes :)

Cheers,

Gordon.
Exaercase
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 37
Joined: Tue May 16, 2017 2:13 pm

Re: Bug ? (i hope don't do mistake :)

Post by Exaercase »

Hello,

First Thx for your kindness. I'm always not really sure of me cause I've do C language 25 years ago and a game have many call so it 's difficult to be affirmative (moreover it s C like script).
Else I've post this bug report on general sanctus forum. If I need again would you want i post in another place ?

Else I'm french so it's sometime very difficult to me to explain in English. So sorry for that.

Just a question if I've correctly understand your answer.

You are OK blast part of FUNCTION DoFire have problem.

But in my post I have indicated other same pb FUNCTION (I'll put under). It's OK also for you ?
Other Function with the same pb (i think) :
FUNCTION TriggerAreaMelee
FUNCTION TriggerPowerBurst (i m not totaly sure)
FUNCTION DoBonusRokkit (Seem's work like Function DoFire one part on blastweapon with the problem and one part non blast that is ok (use of "if (GetPositionDistance(x,y,GetManX(unit, i),GetManY(unit, i)) < 2)" ))

No pb in (i think)
FUNCTION DoKillbolt is ok i thnk is as the dofire non blast part the "if (GetPositionDistance(x,y,GetManX(unit, i),GetManY(unit, i)) < 2)" select only one man
Else as I've modify topic for correcting my frag/krak error (but code under was correct and speak about krak grenade) and add a post on flamer pb.
Have you verify I m right ?

Just for reminding :
---------------------------------------------------
Totaly another thing i think in (Here i do an error yesterday is not frag but krak function but code it s ok) FUNCTION KarkGreande you have forget to put in commentary a line (in all other damage function this line is in commentary moreover if no you could do more damage if you loss your damage roll that if you do a roll > as 50% of power (Init Damage = 60 : Roll < 50% Power Damage = 120, Roll >50% Power Damage = 20 !!!!!, Roll MISS Damage = 30 !!!!)
----------------------------------------------------------
Another potential bug in FUNCTION TriggerFlamerAttack :

Flamer do 15 damage and HeavyFlamer 20 in the description of the weapon.
In the code the damage when init/re-init is not a call to a function to fetch back the damage value of the weapon but a integer literal value fixed to 15
----------------------------------------------------------
First Thx for this great game
And realy very thx to let us have access to code let us as it mod it to add functional (as me for my battle log)
Thx to be very reactive on post
Hope I could help again
Regards Olivier Milliot
Exaercase
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 37
Joined: Tue May 16, 2017 2:13 pm

Re: Bug ? (i hope don't do mistake :) +NEW [Bug 1.0.22]

Post by Exaercase »

[Bug 1.0.22] Venerable Dreanougth have a non existing 3Rd Weapon (Heavy Flamer)
Hello,

A Copy/paste error of normal dreadnoguht i think :)

But Venerable Drednought have in Detailed View of Weapons an Heavy Flamer that he don't have realy in the game (you could not use it and moreover i must not have for logic with the represnetation of the unit)

hope help
bye ExA
Exaercase
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 37
Joined: Tue May 16, 2017 2:13 pm

Re: Bug ? (i hope don't do mistake :) +NEW [Bug 1.0.22]

Post by Exaercase »

Hello,

A little grapical bug or a missing skill for : Terminator Wolf Guard - Beoric Winterfang

This skill are in position 5 & 6 not in poistion 6 & 7 so skill 7 is black

I don't know if you have in mind to done 3 skill and forget one to Terminator Wolf Guard - Beoric Winterfang or it's just graphical error.

File : .\core\Sanctus_Wolves_Abilities.txt

Code: Select all

   [Beoric_Winterfang]
   START[b][i]5[/i][/b] 19
   START[b][i]6[/i][/b] 48
   LEVEL2 23 26 29 30 31 46 47 48 
   LEVEL3 23 26 29 30 31 32 46 47 48 
   LEVEL4 23 25 26 29 30 31 32 46 47 48 50
If only 2 skills i think code must be :

Code: Select all

   [Beoric_Winterfang]
   START[b][i]6[/i][/b] 19
   START[b][i]7[/i][/b] 48
   LEVEL2 23 26 29 30 31 46 47 48 
   LEVEL3 23 26 29 30 31 32 46 47 48 
   LEVEL4 23 25 26 29 30 31 32 46 47 48 50
---------------------------------------------------------------------------------------------

Totaly other thing as i read this file i could see that many low level hero have skill for level 2/3/4
But all of this hero of low level start at level 2 but don't have the skill corresponding :)

For exemple Beoric is Level 2 with no skill for this level but have the code in .\core\Sanctus_Wolves_Abilities.txt for it.

Code: Select all

   [Beoric_Winterfang]
   START[b][i]5[/i][/b] 19
   START[b][i]6[/i][/b] 48
[b][i]   LEVEL2 23 26 29 30 31 46 47 48 [/i][/b]
   LEVEL3 23 26 29 30 31 32 46 47 48 
   LEVEL4 23 25 26 29 30 31 32 46 47 48 50
Bug ? Gameplay Choise ?

--------------------------------------------------------------

Hope could help
Best regards Olivier Milliot
Post Reply

Return to “Warhammer 40,000: Sanctus Reach”