Jump to content
Sign in to follow this  
ShadowMarth

Turning off Ally friendly fire in SP

Recommended Posts

How do your teammates hurt in each in Single Player? Do they shoot each other? Just explain what you are trying to accomplish a bit more cause I'm a bit lost.

Share this post


Link to post

@@IrocJeff

I assume that he and his team mates are shooting at each other by accident (it can happen, especially when many players are at the same spot), 

and he wants to prevent that nobody of his team gets hurt. That's why he's asking if it's possible to turn off friendly fire.

Share this post


Link to post

My apologies like he said by shooting each other or saber damage. Mostly looking to turn off friendly saber damage. NPC's on my team keep killing each other on accident when they are fighting sith NPC's. and I would like to turn that off.

Asgarath83 and bigphil2695 like this

Share this post


Link to post

Well, that makes it a bit more clear. In the last maps of Jedi Academy the Koriban ones... I quit playing it cause I got bored there.. There were at times 2 jedi fighting 1 bad guy and I don't remember the jedi killing each other. This area was SOOO overdone with those kinda fights but I do not remember Jedi hurting each other.

 

I'd check the scripts for Koriban which should be in the Assets0 or 1 .pk3 file. Open those up with Debehaved and see if you can find out what they did.

Share this post


Link to post

Okay, after countless tries and large amounts of trying to get the Build to complie, I finally found what I was looking for.

In the coding I found this block of code commented out. I uncommented it and tried to build it to see if that would work but it just makes my game crash upon loading a map, but this is when using the base sp.exe.When I use the "openjk_spx86 It says "Failed to load ja game library". This code is located in the G_COMBAT.CPP file. Anyone have any advice????

 

    if ( targ != attacker && !(dflags&DAMAGE_IGNORE_TEAM) && OnSameTeam (targ, attacker)  )
    {//on same team
        if ( !targ->client )
        {//a non-player object should never take damage from an ent on the same team
            return;
        }

        if ( attacker->client && attacker->client->playerTeam == targ->noDamageTeam )
        {//NPC or player shot an object on his own team
            return;
        }

        if ( attacker->s.number != 0 && targ->s.number != 0 &&//player not involved in any way in this exchange
            attacker->client && targ->client &&//two NPCs
            attacker->client->playerTeam == targ->client->playerTeam ) //on the same team
        {//NPCs on same team don't hurt each other
            return;
        }

        if ( targ->s.number == 0 &&//player was hit
            attacker->client && targ->client &&//by an NPC
            attacker->client->playerTeam == TEAM_PLAYER ) //on the same team
        {
            if ( attacker->enemy != targ )//by accident
            {//do no damage, no armor loss, no reaction, run no scripts
                return;
            }
        }
    }

Share this post


Link to post

Got same trouble in my mod, when 3 saberist are in the same door hallway and enemy shooting at him, for deflecting shot they hurt and kill each other, and mission fail. : \ the faster solution should be to SET_UNDYING, True, the NPC in these parts of map with trigger and when all enemies are died deactivate undying with a target_counter and another script. but is like to cheat... : \ should be great if teammates cannot damage each other with sabers. with weapons is more hard that happen because a teammate not shoot if there is another teammate in front of him.

Share this post


Link to post

Ok well I have a better understanding after about 2 weeks of trying to figure this shiz out. When ever I build my projects, I can almost never get the SP client to compile with no errors.

The SP libaray compiles fine. but IT DOESNT WORK. I get "Failed to load Ja game library. Of course im using the prebuilt openjk client from (4-13) date. to try an open the ja libary.

The few times i had gotten the sp client to compile, It would give me the "The application was unable to start correctly (0xc000007b). Click OK to close the application." error...

Anybody have any ideas? What do I need to set the settings to? Which visual studio version do I need?

Share this post


Link to post

Ok well I have a better understanding after about 2 weeks of trying to figure this shiz out. When ever I build my projects, I can almost never get the SP client to compile with no errors.

The SP libaray compiles fine. but IT DOESNT WORK. I get "Failed to load Ja game library. Of course im using the prebuilt openjk client from (4-13) date. to try an open the ja libary.

The few times i had gotten the sp client to compile, It would give me the "The application was unable to start correctly (0xc000007b). Click OK to close the application." error...

Anybody have any ideas? What do I need to set the settings to? Which visual studio version do I need?

I know how is bad the code... after my edit noghri stick crashes a years to me before i understood the origin of the bug >.<

well, i have just 2 suggest:

- is it visual studio setted on C++ as language of programmation?

- build with batch build of visual studio ONLY the release istances of the code.

- you can found the data builded on Openkjkmaster/build/release folder

- make a back up of this original file:

ABOUT MP

uix86.dll - dll about the UI of Multiplayer

jampgamex86.dll - Dll about the global server side of Multiplayer

cgamex86.dll - Dll about All the client server side of Multiplayer

Openjkx86.exe <- exe of MP for the code.

 

you need to build with batch build as Release all this Dll and the exe for MP, after that copy and replace the dll of gamedata with your new builds. ALL this 4 files are necessary for load and Use JKA multiplayer.

 

FOR SINGLE PLAYER:

openjk_spx86.dll and jagamex86.dll are the file necessary! after you build it, go into release folder, select, copy and paste these two files into gamedata and start JKA with these 2 files. You need THE EXE and THE DLL, together. without the correct dll the game will crash to you. every time you edit the code and make a build, you need to use these 2 files for SP.

i wanna warning you about a thing: make a back up of entire solution before any edit. >.<, or back up the file of the code that you edit, in this case is better if you take the original g_combat.cpp and save it. 

That's should fix your crashing loading errors.

rabout the rd and rdsp vanilla dll, they are the Engine of JKA, they control all graphic, engine and sound parameters. be careful with edit of vanilla files.

I suggest you to learn the code building step by step, also with try and error. however a little basic knoledge of C++ is necessary,. because if you need to edit the code, you need to understand what have you editing, and also, you need to write into the correct syntaxis. some time Visual Studio not found any error of compilation, but Code is insidious. there are a large amount of time when i edited some function and it crash into game when i use the force power that i hacked, or the weapons, or the saber... XD. 

and same time that happen for things that are not directly connected with function. 1 year ago, i edited the MOD_CONC code, and i discover that 2 classes are become invincibile to all saber damage as collateral effect. XD

 

So, Be careful man! >.< 

Share this post


Link to post

Funny enough, I solved both the issue of build errors and getting my files to work. What I was doing was changing the settings every time to fix errors i got when i tried using outdated source code. Not knowing that of course. I used github to redownload everything and thats what I really needed to do lol.

All I had to do was click build without changing settings and it worked flawlessly. I successfully got the code i edited to work. Now ally NPC team damage is off like i wanted it! xD

Epic win.

Asgarath83 likes this

Share this post


Link to post

Funny enough, I solved both the issue of build errors and getting my files to work. What I was doing was changing the settings every time to fix errors i got when i tried using outdated source code. Not knowing that of course. I used github to redownload everything and thats what I really needed to do lol.

All I had to do was click build without changing settings and it worked flawlessly. I successfully got the code i edited to work. Now ally NPC team damage is off like i wanted it! xD

Epic win.

Can you share the code of no damage allies? :)  i need it : \

Share this post


Link to post

Yes I can. If you look in the g_combat.cpp coding hit CTRL+F and search "nodamageteam" Hit enter slowly until it takes you to the middle of the file where a whole block of code should be commented out. It should start with "// Check for team damage." all you have to do is uncomment this block for it to work.

Also if you search further you should find a small segment that says:

else if ( targTeam == TEAM_PLAYER )
            {//on the same team, and target is an ally
                qboolean takeDamage = qtrue;
                qboolean yellAtAttacker = qtrue;

Set the "takeDamage" to "qfalse" this makes it so you can't hurt them either. This way you and your team mates can freely swing your sabers without the worry of hurting each other. Works for allys with guns to.

Asgarath83 and eezstreet like this

Share this post


Link to post

Glad I can help lol. Funny how I always end up solving my own issues.

Yes, for coding request is the main way.

did it, it works. thanks! :)

Share this post


Link to post

Nice. I'll probably be looking into some saber physic coding regarding when you hit a wall. I don't exactly like the fact that the blade shrinks when hitting a wall. I think the walls nullify the output damage to. Those moments were a Reborn is in a corner. I'll be swinging at him all kinds of ways with my Dual staff sabers but I cant seem to hurt him. Damn walls be getting it the way.

Share this post


Link to post

Nice. I'll probably be looking into some saber physic coding regarding when you hit a wall. I don't exactly like the fact that the blade shrinks when hitting a wall. I think the walls nullify the output damage to. Those moments were a Reborn is in a corner. I'll be swinging at him all kinds of ways with my Dual staff sabers but I cant seem to hurt him. Damn walls be getting it the way.

Good luck. bounceonwalls 1 can help?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...