Ravenfield

Ravenfield

Score Streaks (Mutator)
 This topic has been pinned, so it's probably important
Gaheris96  [developer] 6 Jul, 2020 @ 2:49pm
IF YOU ARE A MODDER
With your own mod you can use some features of this mod and implement new one


Add Score Points
You first need to get the ScoreStreaks obj in a coroutine, to be sure it is created (you have 1s to register streaks) :
function YourScript:Start() self.script.StartCoroutine("init"); end function YourScript:init() coroutine.yield(WaitForSeconds(0.2)); self.ss = ScriptedBehaviour.GetScript(GameObject.Find("ScoreStreak")); end

and then you just have to call :
self.ss:addPoints(NumberOfPoints, "Message");
For example :

self.ss:addPoints(200, "ENEMY KILLED");

Add Score Streaks
You will also need the ScoreStreaks obj, and you have to call the registerStreak function :

function YourScript:Start() self.script.StartCoroutine("init"); end function YourScript:init() coroutine.yield(WaitForSeconds(0.2)); self.ss = ScriptedBehaviour.GetScript(GameObject.Find("ScoreStreak")); self.ss:registerStreak(points, name, table, nameOfTheFunctionToCall, mode, nameOfTheTestFunction); end
where :
  • points is how much your streak cost,
  • name is the name shown in the wheel,
  • table is the script containing the functions,
  • nameOfTheFunctionToCall is the name of the function which will be called when the streaks is selected, and return if the streak worked
  • mode is an integer, 0, 1 or 2, controlling what will be the argument of the function : 0 for player position, 1 for a simple down raycasting and 2 for binoculars
  • nameOfTheTestFunction is optional, the name of a function that will be called to check if the reinforcement can be called

example :

local maxDistance = 100; function YourScript:Start() self.script.StartCoroutine("init"); end function YourScript:init() coroutine.yield(WaitForSeconds(0.2)); self.ss = ScriptedBehaviour.GetScript(GameObject.Find("ScoreStreak")); self.ss:registerStreak(2250, "Teleport", self, "teleportFunc", 2); end function YourScript:teleportFunc(binocularsPos) if((binocularsPos-Player.actor.position).sqrMagnitude > maxDistance * maxDistance ) then return false; end Player.actor.TeleportTo(binocularsPos, Player.actor.rotation); return true; end
Last edited by Gaheris96; 6 Jul, 2020 @ 3:14pm
< >
Showing 1-7 of 7 comments
rice and noodles 6 Jul, 2020 @ 5:11pm 
Ok
Ninjagrape 6 Jul, 2020 @ 8:27pm 
very nice
Louis8257 7 Jul, 2020 @ 5:23am 
Great work ! :steamhappy:
Ninjagrape 7 Jul, 2020 @ 5:27am 
Good to see you're still around
Louis8257 7 Jul, 2020 @ 5:35am 
Thanks Ninjagrape !
Swoke 8 Jul, 2020 @ 6:05am 
:| epicc
EaglePancake 8 Jul, 2020 @ 8:01am 
Epic
< >
Showing 1-7 of 7 comments
Per page: 1530 50