Jump to content

Correctly merging two different mods if statements at the same code location - question?


Recommended Posts

Hello Nexus,

 

Correctly merging two different mods if statements at the same code location - question?

Which formatting is correct to merge the two if statements marked between my "start" and "end" comments?


Shields by ScoutBr0 - http://www.nexusmods.com/witcher3/mods/2356/?
modshield\content\scripts\game\projectile

arrowProjectile.ws

 


if ( ( victim == thePlayer && bones.Contains(boneName) ) || ( ((CNewNPC)victim).IsHorse() && !shouldPierceVictim ) )

        {

            SmartDestroy();

        }

        else if( !shouldPierceVictim )

        {

            arrowHitPos = pos;

            

            

            meshComponent = (CMeshComponent)GetComponentByClassName('CMeshComponent');

            if( meshComponent )

            {

                boundingBox = meshComponent.GetBoundingBox();

                arrowSize = boundingBox.Max - boundingBox.Min;

                

                rotMat = MatrixBuiltRotation( this.GetWorldRotation() );

                rotMat = MatrixGetInverted( rotMat );

                arrowSize = VecTransformDir( rotMat, arrowSize );

                

                

                //This is the section of code I need other eyes on - start

                if( arrowSize.Y > 0 ) //This is the section of code I need other eyes on - end

                    arrowHitPos += RotForward(  this.GetWorldRotation() ) * arrowSize.Y * 0.1f;

                else    

                    arrowHitPos -= RotForward(  this.GetWorldRotation() ) * arrowSize.Y * 0.9f;

            }

 



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

Powerful Reflected Arrows by Percival Dickenbutts - http://www.nexusmods.com/witcher3/mods/1694/?
modReflectedArrows\content\scripts\game\projectile

arrowProjectile.ws

 


if ( ( victim == thePlayer && bones.Contains(boneName) ) || ( ((CNewNPC)victim).IsHorse() && !shouldPierceVictim ) )

        {

            SmartDestroy();

        }

        else if( !shouldPierceVictim )

        {

            arrowHitPos = pos;

            

            

            meshComponent = (CMeshComponent)GetComponentByClassName('CMeshComponent');

            if( meshComponent )

            {

                boundingBox = meshComponent.GetBoundingBox();

                arrowSize = boundingBox.Max - boundingBox.Min;

                

                //This is the section of code I need other eyes on - start

                if( StrFindFirst( this.GetName(), "arrow" ) != -1 ) //This is the section of code I need other eyes on - end

                    arrowHitPos += RotForward(  this.GetWorldRotation() ) * arrowSize.X * 0.1f;

                else

                    arrowHitPos -= RotForward(  this.GetWorldRotation() ) * arrowSize.X * 0.7f;

            }

 




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


What's the correct formatting to "merge" these two if statements to work within the code block that otherwise matches both files.


if( arrowSize.Y > 0 )





if( StrFindFirst( this.GetName(), "arrow" ) != -1 )


Are any of these examples correctly formatted for the merge or will the code need to be formatted another way to work?


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


example 1:


                               if( arrowSize.Y > 0 )    

                               { //added a {

                               if( StrFindFirst( this.GetName(), "arrow" ) != -1 )

                               { //added a {

example 2:


                               if( arrowSize.Y > 0 ){ //added a {

                               if( StrFindFirst( this.GetName(), "arrow" ) != -1 ){ //added a {

example 3:


                             if( arrowSize.Y > 0) && (StrFindFirst( this.GetName(), "arrow" ) != -1 )){ //added && and added a {



example 4:


                             if( arrowSize.Y > 0 ) { \\ added a {

                             } else if( StrFindFirst( this.GetName(), "arrow" ) != -1 ) { //added an } else and a {

 



---------

Thanks

 

Link to comment
Share on other sites

Hello again,

 

Disregard my questions - I'm just going to use the two mods (un-merged) - they were to be (manually merged) - (Not with script merger) to add to my new manually merged mod folder pack to beat the pathetic mod folder limit. :(

 

On to other things...

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...