Jump to content
Sign in to follow this  
A-SUICIDAL

Another EH question

Recommended Posts

So I have an "EH killed" added to each player that when somebody is teamkilled, it executes the punish script. I have not had the chance to test this with real players. I've only tested with ai. Everything works in the script (SP/MP/Dedi) when I test alone with ai, but after I kill an ai teammate and go to jail and then get released and repeat the process 4 times. After my 4th stay in jail when the jail timer expires and setPos's me back to the respawn_west marker, the friendly ai units suddenly turn against me and kill me, which is usually expected after killing 4 ai teammates. So after they kill me and I respawn, the ai seem like they aren't pissed anymore, as if they are satisfied with having killed me 1 time. But now when I teamkill again (a 5th time), nothing happens, the punish script doesn't seem to want to execute. It's as if the ai no longer have their "EH killed" anymore. I have a radio trigger that I activate that tells me what team I am on and it says that I am still on "west" and I can still see diamonds around the ai members of my group. If I was the leader of a bunch of ai units, after 4 TK's I usually lose my leader status and some ai announces that he is taking command. Traders, lol. I don't know why the EH stops working after 4 teamkills. I wouldn't even know what to search to find out more about this, so that's why I am asking here.

This punish script is meant to be used in missions where the ai are disabled. I hope to use it in my own coop missions. It could possibly be that my script will never work with ai units properly because after 4 teamkills the EH seems to break, or maybe there is a way to fix it to work with ai. My main concern is making sure that the punish script will work with real players, but I have no way of knowing because I haven't had any opportunity to test with real players. Lately my friends seem more interested in playing BF3 or BO2.

Share this post


Link to post
Share on other sites

Sometimes when using the AI and you get killed for some reason when you spawn back into the game you need to go to the menu and pick the done command to allow the AI to be fully under your control. I don't know if that will fix your issue but give it a shot. AVIBIRD

Edited by AVIBIRD 1

Share this post


Link to post
Share on other sites

Are they in your group? "KILLED" EH only runs where the killed unit is local, meaning it will only run if you are the group leader of the AI units or if you are the server host.

Once they kill you, you are no longer the group leader, thus the AI units are local to the dedicated server, and thus their EH runs on the server rather than on your machine.

Since setPos requires the unit to be local to the machine that runs the setPos command, when the server tries to setPos you into jail it fails because you are not local to the server when playing on a dedicated.

You will have to use some more sophisticated system with publicVariable or something to get it to work in multiplayer.

Share this post


Link to post
Share on other sites

- I never used "addRating" before, but after reading what it does exactly, that could be something that might help.

I just tried installing Demonized teamkill punish script to see if the same problem existed. I placed 5 ungrouped playable units and set up a sample mission with "respawn_west" and tested it and after 4 teamkills the enemy killed me, and after I respawned I teamkilled a 5th time and the script did punish me again, where with my script - it fails to punish on my 5th TK. Demonized used a different method to add the EH, but I also noticed that with his script, you do not get punished if you teamkill from a vehicle turret, so I changed his script a little and got it so it would punish you if you are in a vehicle turret. I even got his script to force the player to get out of the vehicle, but as far as setPos'ing the player - it setPos'd the vehicle and then the camera was still on the vehicle, not the player, so I assume that the game sees the "_killer" in his script as the vehicle, not the player. So I tried using some of his method mixed with mine and omg it's turning into a nightmare. I think my best bet would be to take my own completed punish script and hand it over to somebody with greater scripting skills and see if they can help me make it Multiplayer Friendly - before I completely lose my mind .

I did understand everything you said galzohar, and I now know why my script is not working correctly, but I still don't know how to fix it. If I actually were to get things to the point where everything is scripted correctly, I wouldn't even know it, because I have no way of testing it to find out. I would need somebody to test it with me on a dedicated server and I'm kind of short on volunteers :/

But I'm not giving up.

Share this post


Link to post
Share on other sites
- I never used "addRating" before, but after reading what it does exactly, that could be something that might help.

Yeah so your team doesn't kill you when you get out of jail :)

Share this post


Link to post
Share on other sites

Yep you should definitely use addRating to prevent this. It also cause a lot of other issues with scripts and addons since you are no longer on any of the usual sides, e.g. BLUFOR, OPFOR meaning many scripts won't work properly when you become renegade. I always add this to the initialization of the mission:

[] spawn {
waitUntil {sleep 5.0; local player};
player addRating 999999;
};

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×