Hi guys, I was looking over some of my archived HUD's and just thought I would share this with you all.
This will allow you to use one sprite to change the colours of the AI's in the radar which is based on their AI soldier state. It is really simple to update and to achieve this result... so here's how.
Step. 1
Download the below attached sprite image radar-white.png from the attached radar-white.zip file.
Step. 2
Navigate to the GG directory radar then copy & paste the downloaded sprite image into the directory.
..\Steam\steamapps\common\Game Guru\Files\scriptbank\radar
Step. 3
While you are in the radar folder of GG, back-up and edit the file radar.lua like below.
Between lines 23-24 copy & paste this line of code.
radarImageWhite = LoadImage ( "scriptbank\\radar\\radar-white.png")
Step. 4
Change both lines 48 then 64 to match the code below.
radarEnemySprites[enemyCount] = CreateSprite( radarImageWhite )
Step. 5
Between lines 83-84 copy & paste this code block.
if ai_soldier_state[e] == "patrol" or ai_soldier_state[e] == "idle" then
SetSpriteColor ( radarEnemySprites[c] , 0,255,33,255) -- Sprite colour green - patrol and idle mode
elseif ai_soldier_state[e] == "hiding" or ai_soldier_state[e] == "roar" then
SetSpriteColor ( radarEnemySprites[c] , 255,216,0,255) -- Sprite colour yellow - hiding mode
elseif ai_soldier_state[e] == "alerted" or ai_soldier_state[e] == "detected" or ai_soldier_state[e] == "roam" or ai_soldier_state[e] == "charge" or ai_soldier_state[e] == "run" then
SetSpriteColor ( radarEnemySprites[c] , 255,106,0,255) -- Sprite colour orange - alerted, detected, roam, charge and run mode
elseif ai_soldier_state[e] == "combat" or ai_soldier_state[e] == "attack" or ai_soldier_state[e] == "attackagain" then
SetSpriteColor ( radarEnemySprites[c] , 255,0,0,255) -- Sprite colour red - combat, attack and attackagain mode
else
SetSpriteColor ( radarEnemySprites[c] , 0,0,0,255) -- Sprite colour black - death mode (deathanim) and all others
end
Step. 6
Now save the file radar.lua
Step. 7
Add the radar to you level in the same way as always, enemies and waypoints. Try spreading them out a bit so you can test your level well.
====================================================================================
That's about it guys.
You will find a youtube video below using this example. It may look a little different but works the same way. Yes my gun skills are not great but I blame the AI's...
I have included as many AI soldier state as possible but if I have missed any please let me know.
Screenshot
Update
I have now added the lua code to the attached zip.
Happy gaming.
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