theavonlady 2 Posted October 18, 2004 In testing I found that when I changed the player's rating at the start of a mission from zero to -6000, the player was automatically targetted and killed by units on the player's side. Anyone else familiar with this? Is there a workaround? Or do I simply have to be safe and wait for mission end to calculate in the accumulated negative score? Share this post Link to post Share on other sites
sanctuary 19 Posted October 18, 2004 Giving a negative addrating is making the unit to be seen as the worst traitor of the whole history (the same when you begin to teamkill several of your squad or side members). Deathmatch 'missions' are made like this actually If you add this in the init line of each units, as an example <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addrating (-(rating this)-10000) Everyone will hate so much everyone that they want to have them dead , same side of not. Share this post Link to post Share on other sites
theavonlady 2 Posted October 18, 2004 No. OFP has a separate method of killing you for team kills. You could have a very high positive score and if you start killing your own side's units, OFP's AI will still go after you even if you've still got a remaining high score. Here you haven't killing anyone, just got a negative rating. Of course, there is the natural law fo survival of the species............................. Share this post Link to post Share on other sites
-=BT=- Matty R 0 Posted October 18, 2004 it would be good for a traitor mission lol.. Share this post Link to post Share on other sites
MEDICUS 0 Posted October 18, 2004 No. OFP has a separate method of killing you for team kills. You could have a very high positive score and if you start killing your own side's units, OFP's AI will still go after you even if you've still got a remaining high score.Here you haven't killing anyone, just got a negative rating. Of course, there is the natural law fo survival of the species............................. There is actually no difference for the AI. TKs give you a negative score (even if u have still a positive one on the scoreboard) and the AI will see you as an enemy. And if you give the Player a negative score at the beginning of a mission, it will have the same effect: the AI will act like if you are an enemy. Why do you want to give the player a negative score at the beginning of the mission, Avon? MfG MEDICUS Â Share this post Link to post Share on other sites
RED 0 Posted October 18, 2004 You may aswell just add -6000 at the end of the mission, why bother doing it at the start if it is going to cause problems? RED Share this post Link to post Share on other sites
Chris Death 0 Posted October 18, 2004 Quote[/b] ]Why do you want to give the player a negative score at the beginning of the mission, Avon? As Sanctuary already mentioned above: This method is being used in Deathmatch missions, and i'm sure it may fit into some other situations too. e.g: you're a desserteur, or you start in prison of your own forces - must escape and find some documents, which will show that you're not guilty - etc. ~S~ CD Share this post Link to post Share on other sites
theavonlady 2 Posted October 18, 2004 You may aswell just add -6000 at the end of the mission, why bother doing it at the start if it is going to cause problems? RED I have a condition met somewhere at the beginning of the mission that sets the negative rating. The mission has about 5 different endings, so now I would have to adjust all of the 5 ending triggers to tabulate any accumulated negative ratings. Much more of a pain, don't you think? Share this post Link to post Share on other sites
void_false 1 Posted October 18, 2004 this setcaptive true Share this post Link to post Share on other sites
RED 0 Posted October 18, 2004 this setcaptive true Then you won't be shot by anyone, unless that isn't a problem Avon? Quote[/b] ]The mission has about 5 different endings, so now I would have to adjust all of the 5 ending triggers to tabulate any accumulated negative ratings.Much more of a pain, don't you think? Depending on the complexity of your mission it doesn't sound like much pain at all. RED Share this post Link to post Share on other sites
benu 1 Posted October 18, 2004 Actually, if i understand you correctly this has been known for a long time, it was even adressed in an old cwc patch, where the limit was lowered so the ai does not kill you for every accidental tk. From the official Comref: Quote[/b] ]unit addRating numberOperand types: unit: Object number: Number Type of returned value: Nothing Description: Add number to unit rating. This is usually used to reward for completed mission objectives. Rating for killed enemis and killed friendlies is adjusted automatically. When rating is lower than zero, unit is consider "renegade" and is enemy to everyone. Example: player addRating 1000 This has nothing to do with the score from the scoreboard, you can change that too: Quote[/b] ]unit addScore scoreOperand types: unit: Object score: Number Type of returned value: Nothing Description: MP only: add unit score. This is shown in the "I" MP screen as total. Example: player addScore 10 Share this post Link to post Share on other sites
T J 0 Posted October 18, 2004 I cant recall just now how the score part of the description.ext works, but if your mission has that failed objective as a proper objective, ie, defined in the breifing.html, and instead of giving the player addrating -6000 you simply give him a FAIL, that should do the trick of knocking his score down (does anybody actually READ the scores??) i dont think addscore has any effect for a SP mission Share this post Link to post Share on other sites
void_false 1 Posted October 18, 2004 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> When rating is lower than zero, unit is consider "renegade" and is enemy to everyone. Disagree. I have finished some CWC missions with ~-100 points. It should be ~-500 if u want friendly units to fire on u. Share this post Link to post Share on other sites
theavonlady 2 Posted October 18, 2004 I cant recall just now how the score part of the description.ext works, but if your mission has that failed objective as a proper objective, ie, defined in the breifing.html, and instead of giving the player addrating -6000 you simply give him a FAIL, that should do the trick of knocking his score down (does anybody actually READ the scores??) These negative ratings in my mission aren't for failed objective but for poor performance events while attempting to achieve an objective. Anyway, I'll accumulate the addRating values in a global counter variable and adjust the final mission score in the various end triggers. Thanks all for your help. Share this post Link to post Share on other sites
bn880 5 Posted October 19, 2004 No way around it. Do some math. Share this post Link to post Share on other sites
theavonlady 2 Posted October 19, 2004 No way around it. Â Do some math. I've combined math with reading comprehension. 0 - 6000 = Run, Sally, run! Share this post Link to post Share on other sites
theavonlady 2 Posted October 19, 2004 OK. Quick visual syntax check assistance, please. Reminder: this is an SP mission. In init.sqs, I added a global variable: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">scoreadjust  = 0 One of my calls to a new script to tabulate score adjustments is this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_vehicle addEventHandler ["killed",{[_this select 0,4000] exec "\Amore\Avon\Scripts\updrating.sqs"}] Script "updrating.sqs" contains the following: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_unit = _this select 0 _points = _this select 1 ? (_unit != "aP") : exit hint "player's score adjusted" scoreadjust = scoreadjust + _points exit And, finally, immediately before every mission end trigger, a script is run which includes the following line: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">aP addRating scoreadjust Will it work? Anything blatantly wrong here with syntax or logic? TIA. Share this post Link to post Share on other sites
benu 1 Posted October 19, 2004 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> When rating is lower than zero, unit is consider "renegade" and is enemy to everyone. Disagree. I have finished some CWC missions with ~-100 points. It should be ~-500 if u want friendly units to fire on u. That's what i thought was "fixed" in that patch a long time ago. I just quoted the comref, although i thought you could have a few points below zero without going renegade. Well, lets check the readmes to the patches to see if this is mentioned somewhere... Share this post Link to post Share on other sites
theavonlady 2 Posted October 19, 2004 Script "updrating.sqs" contains the following:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_unit  = _this select 0 _points = _this select 1 ? (_unit != "aP") : exit hint "player's score adjusted" scoreadjust = scoreadjust + _points exit HELP! Why am I getting the following error message? <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">'? (_unit != "aP") |#|': Error Generic error in expression Share this post Link to post Share on other sites
T J 0 Posted October 19, 2004 ?! _unit == player or, ?!_unit == ap no need of "" as they make the player name variable into a string tj Share this post Link to post Share on other sites
theavonlady 2 Posted October 19, 2004 ?! _unit == playeror, ?!_unit == ap Both: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?!_unit==aP: exit and: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?!_unit=="aP": exit Give the same error message: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">'?!_unit==|#|aP': Error!: Type Object, expected Bool Quote[/b] ]no need of "" as they make the player name variable  into a string Doesn't it make logical sense here that I want to compare the value of variable _unit with string "aP"? Share this post Link to post Share on other sites
RED 0 Posted October 19, 2004 ? !(_unit == player): exit Why even have this check running? It seems completely pointless. RED Share this post Link to post Share on other sites
theavonlady 2 Posted October 19, 2004 ? !(_unit == player): exitWhy even have this check running? It seems completely pointless. As I mentioned much earlier, this script is also called by and addEventHandler, ["killed"] call. I only want to subtotal score changes if the killer of that unit was the player and not an AI unit on the player's side. Now, I'm a bit confused here between "player" and "aP". The former is a reserved word for the player but the latter is the name assigned to the player's unit. I would assume that "_this select 1" returned from the above addEventHandler command returns the string value of the unit that made the kill. If so, that would be "aP" - not player and I would assume it's returned as a string. What have I got wrong here? Share this post Link to post Share on other sites
raedor 8 Posted October 19, 2004 no, it does not give you "aP" as a string. it gives you the content of player/aP whatever. something like "WEST ALPHA BLACK 1" Share this post Link to post Share on other sites
theavonlady 2 Posted October 19, 2004 no, it does not give you "aP" as a string. it gives you the content of player/aP whatever. something like "WEST ALPHA BLACK 1" Yuck! That's absurd! Nevertheless, what's causing the syntax errors? Share this post Link to post Share on other sites