jekart021 Posted June 11, 2021 Share Posted June 11, 2021 (edited) Hello everybody ! I have a question about modding Can you tell me how to make Bernie fight in pvp? Edited June 11, 2021 by jekart021 Link to comment Share on other sites More sharing options...
Monti18 Posted June 11, 2021 Share Posted June 11, 2021 local RETARGET_MUST_TAGS = { "_combat" } local RETARGET_CANT_TAGS = { "INLIMBO", "player", "companion" } local RETARGET_ONEOF_TAGS = { "locomotor", "epic" } local function RetargetFn(inst) if inst.components.combat:HasTarget() then return end local x, y, z = inst.Transform:GetWorldPosition() for i, v in ipairs(TheSim:FindEntities(x, y, z, TARGET_DIST, RETARGET_MUST_TAGS, RETARGET_CANT_TAGS, RETARGET_ONEOF_TAGS)) do if IsTargetable(inst, v) then return v end end end In the file bernie_big.lua, you can see that the retargetfn excludes players. You will need to overwrite inst.components.combat:SetRetargetFunction(1, RetargetFn) to make him attack players in PvP. with the function changed so that he can retarget players. I would make a check to see if PvP is enabled so that he doesn't start attacking people if PvP is off. 1 Link to comment Share on other sites More sharing options...
jekart021 Posted June 12, 2021 Author Share Posted June 12, 2021 I managed to get him to attack the players, but I stumbled upon the fact that if I hit the player, then Bernie hits me instead of hitting the one I hit Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now