OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started 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.
-
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 ....
-
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:
this addrating (-1000 - rating this)
That should work, right? ::)
-
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:
{_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.
-
Just to point out, -2000 is the magic number for becoming a renegade..
From the OFP 1.96 config:
renegadeLimit=-2000;
-
That's useful to know. I just wanted to make absolutley sure!
-
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?
-
Yes and yes.
-
Excellant. Thanks guys.
-
or you could do what was suggested earlier:
unit addrating (-10000 - (rating unit))
and that will always set the rating to -10000
-
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.
-
What's the abs bit mean?
-
Absolute value.
-
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
-
Why not just,
player addrating -10000
-
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