Forums » Community Projects

(TCS) Makefriends no longer makes friends! :)

Dec 30, 2015 yodaofborg link
So, I have had a go at fixing it myself, but I have no idea what has changed to break it so I am just grasping at straws. If there was some kind of error thrown up, I may have a better chance of fixing it - but alas - I dunno whats wrong, so that makes it kind of hard.

So anyway. Can anyone either point me in the right direction so I can fix it, or have a look? Pwetty pwease?
Dec 30, 2015 meridian link
I did some experimenting. What I found is that MakeFriends modifies the GetFriendlyStatus(charid) function in order to manipulate the color of targets on radar. According to the racecar wiki, GetFriendlyStatus() returns 3 if the character is friendly, otherwise unfriendly. A hostile hive bot returned 0 in my testing.

What I'm finding is that it seems that the radar used to set the color of targets based on the value returned from GetFriendlyStatus(), but now the radar uses something else to set the colors. That may mean that it is no longer possible to alter the color of radar targets with a plugin. However, since I never tried changing the colors of radar targets back when MakeFriends was working, I can't be totally sure that what I just said is correct.

I did an experiment where I removed all plugins then created a plugin with the single line of code:
GetFriendlyStatus = function() return 3 end

That should have made all targets on my radar green since GetFriendlyStatus always returns 3, but a bunch of hive bots were still red. It seems that GetFriendlyStatus() no longer influences radar colors.

I think you'll probably need some dev input in order to get MakeFriends working again.
Dec 31, 2015 meridian link
Update:
I restored version 1.8.366 from a backup and ran it with the line of code from the previous post, and in that case, hive bots did appear as green on the radar. This seems to confirm my speculation above that version 1.8.366.1 changed the behavior of the radar so that it no longer uses the GetFriendlyStatus() function to assign colors to the blips.
Jan 01, 2016 abortretryfail link
It might be sing IsEnemy() now. I suppose Ray could give us some clues as to what was changed.

I need to rewrite MakeFriends with a rule-based approach like CondHail...
Jan 01, 2016 abortretryfail link
GetFriendlyStatus() still gets called for players, but its output seems to be unused now.
Jan 03, 2016 yodaofborg link
IsEnemy() is not conditional? Sure, you can use it to make a single target red or green, or even white. But that is not the issue. Quick Targeting is the issue.

(Example is, using IsEnemy() does not stop me from targetting a player with ClosestHostile)

Meh. MakeFriends is really needed for the way I play, I guess I am going to have to open a support ticket on this one..
Jan 03, 2016 raybondo link
The GetFriendlyStatus function was changed to only get called when a player enters the sector, or on a couple other events due to optimizations.
It was an oversight on my part to not add the ability to allow plugins to update the friendly status of a player at times other than the few events that we chose.
We work on adding the ability for plugins to update the radar's friendly status of a player in the next update.
Jan 03, 2016 mr_spuck link
Something like this makes a char red here:

radar.sfs = radar.SetFriendlyStatus

radar.baddies = {}
radar.baddies[1001408600] = true

function radar.SetFriendlyStatus(node, group, friendly, duel, bot)
if radar.baddies[GetCharacterID(node)] then friendly = 0 end
return radar.sfs(node, group, friendly, duel, bot)
end

They won't be targeted with the nearest enemy bind though. I don't know if makefriends worked the same way.
Jan 04, 2016 yodaofborg link
Yeah, MakeFriends changed the way targeting worked too, which is why it was cool. You could set all NPC's friendly, and all PC's Red, regardless of faction or standing, so that TargetNearestHostile always selected the closest player. If it was just about changing the colour of radar blobs, that can be done still.

Anyway, thanks for looking into this ray!
Jan 12, 2016 abortretryfail link
A general purpose way to hook and override the radar color, $thing for /radarnextnearest$thing, and AutoFire would be superb. Even for NPCs, the game's built-in functions don't handle this well at all.
Jan 18, 2016 abortretryfail link
TCS with patched MakeFriends is available here: https://github.com/AbortRetryFail/tcs-plugins

Let me know if this works/doesnt work.
Jan 18, 2016 meridian link
Is the timer necessary? In my (limited) testing, it seems that the only thing needed is the addition of UpdateAllRadarFriendlyStatus() at the beginning of the mf.SaveSettings(preset) function.
Jan 20, 2016 abortretryfail link
I can't say it's necessary, but it's what worked for me when trying to address the problem of new targets entering the sector showing up with the wrong (non MF-ified) status.