Hi guys, just wanted to add a really basic AI script that can be use with any of the new AI system (Build: 2017.3.10) which will register your kills. I have made the script to only work with the ai_soldier.lua script for this example. You can easily altered this for all the new AI scripts.
The kill score works in two ways.
Normal kills = 1
Headshots = 5
As this uses an exit script to register a kill; I have only added 4 points to the headshot in the script but the total on exit will make 5 kill points.
You can change this to what ever you want but just remember the 1 exit point or whatever your exit point (kill point) will be.
There are two scripts for this example one to display kills (BASIC TEXT ONLY), located bottom left just above the gun info. The other to be added to the AI Soldier in the entity properties instead of the normal ai_soldier.lua script (This will call the AI script anyway). Add both these scripts to your scriptbank folder.
Anyway, time for the script and maybe a YouTube if I get the time
First script to add to a barrel as always active. Filename ai_stats.lua
g_KillCount = 0
function ai_stats_init(e)
end
function ai_stats_main(e)
TextCenterOnXColor(5,89,1,"Kills: "..g_KillCount,255,255,255)
end
Second script to add to your AI Soldier entity. Filename ai_soldier_kill_count.lua
-- AI : Soldier Behavior
ai_soldier_combatshoot = require "scriptbank\\ai\\module_combatshoot"
g_KillCount = 0
function ai_soldier_kill_count_init(e)
ai_soldier_combatshoot.init(e,ai_combattype_regular)
end
function ai_soldier_kill_count_main(e)
ai_soldier_combatshoot.main(e,ai_combattype_regular,ai_movetype_usespeed,ai_attacktype_canfire)
end
function module_combatcore.headshot(e)
if string.find(string.lower(g_Entity[e]['limbhit']), "head") ~= nil then
SetEntityHealth(e,0)
ResetLimbHit(e)
g_KillCount = g_KillCount + 4 -- Headshot kill - Change to your specs
end
end
function ai_soldier_kill_count_exit(e)
g_KillCount = g_KillCount + 1 -- Normal kill - Change to your specs
end
That's about it...
gd - Ed.
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 SLI mode, Water cooled with an old Victorian cast iron radiator and a industrial leather belt driven fan - That's what you call Steampunked.
Laptop - M17xR3
A new competition running for GG