OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: The-Architect on 01 Oct 2005, 00:27:11

Title: Addrating
Post by: The-Architect on 01 Oct 2005, 00:27:11
I can't get to the editor right now as I'm on another computer. I just wanted to know if,

Me1 addrating -1

will work. I have a player that I want to become a renegade. The Ed depot says that you can add a rating but I just wonder if making it lower than 0 will work.
Cheers.
Title: Re:Addrating
Post by: macguba on 01 Oct 2005, 00:30:40
Yes adding negative numbers to make the rating negative does work IIRC.   I think you need lower than -1 to make everybody shoot at you though.   Not sure.   -100 should work and -1000 will definitely work, though of course if the player is already +1001 ....
Title: Re:Addrating
Post by: Kyle Sarnik on 01 Oct 2005, 01:41:44
Yes adding negative numbers to make the rating negative does work IIRC.   I think you need lower than -1 to make everybody shoot at you though.   Not sure.   -100 should work and -1000 will definitely work, though of course if the player is already +1001 ....

Thats why you should use this trick:

Code: [Select]
this addrating (-1000 - rating this)
That should work, right?  ::)
Title: Re:Addrating
Post by: THobson on 01 Oct 2005, 10:59:19
As a build on the comments above.  This is some initialisation code I use to ensure the player becomes a renegade if he kills some particular individuals:

Code: [Select]
{_x AddEventHandler [{killed}, {if ((_this select 1) == Alexi) then {Alexi addRating (-100000 - abs(rating Alexi))}}]} forEach ((units group Yuri) + (units group Pavel) + [Dourdan_Woman] - [Yuri,Pavel,Marek])

It works like a dream.  Survival time is measured in seconds if there is anyone around with a gun.
Title: Re:Addrating
Post by: h- on 01 Oct 2005, 14:40:12
Just to point out, -2000 is the magic number for becoming a renegade..

From the OFP 1.96 config:
Code: [Select]
renegadeLimit=-2000;
Title: Re:Addrating
Post by: THobson on 01 Oct 2005, 14:58:40
That's useful to know.  I just wanted to make absolutley sure!
Title: Re:Addrating
Post by: The-Architect on 01 Oct 2005, 18:09:56
What about during the mission? Does killing bad guys raise your rating?

If so, Maybe I should bump it down to like 10000 just to be sure the player becomes a renagade.
Also at the end of the mission, will the renegade score affect the final score or should I bump it back up by 10000 when the player hits the end trigger?
Title: Re:Addrating
Post by: macguba on 01 Oct 2005, 18:22:02
Yes and yes.
Title: Re:Addrating
Post by: The-Architect on 01 Oct 2005, 18:58:12
Excellant. Thanks guys.
Title: Re:Addrating
Post by: Triggerhappy on 01 Oct 2005, 21:03:18
or you could do what was suggested earlier:

unit addrating (-10000 - (rating unit))

and that will always set the rating to  -10000
Title: Re:Addrating
Post by: Kyle Sarnik on 01 Oct 2005, 21:43:29
or you could do what was suggested earlier:

unit addrating (-10000 - (rating unit))

and that will always set the rating to  -10000

unit addrating (-10000 - abs (rating unit))

Should have thought of that, incase the unit allready had a negative rating.
Title: Re:Addrating
Post by: The-Architect on 02 Oct 2005, 01:26:18
What's the abs bit mean?
Title: Re:Addrating
Post by: Kyle Sarnik on 02 Oct 2005, 03:04:45
Absolute value.
Title: Re:Addrating
Post by: Triggerhappy on 02 Oct 2005, 04:55:43
why would you want the abs of it?

lets say they have a rating of -1000

if you
addrating (-10000 - abs (rating unit))

you end up with:
addrating (-10000 - 1000)
which gives you an even more negative number

whereas
addrating (-10000 - (rating unit))
gives you
addrating (-10000 - (-1000))

which ends you up at -10000, which is what you were going for

i see no reason why you would want to use the abs rating
Title: Re:Addrating
Post by: The-Architect on 02 Oct 2005, 07:14:26
Why not just,

player addrating -10000

Title: Re:Addrating
Post by: Triggerhappy on 02 Oct 2005, 07:20:50
what if the player has a very high rating to start?

obviously eventually you hit a point where it would be completely impossible for someone to have high enough rating to negate the addrating but still, taking away the current rating is more foolproof