4DFAF Uploaded

@jip I'm down with that... I only need the shields:GetMaxHealth() to be passed to be able to update the UI. Otherwise, the drone custom p-shield, would never be able to display without hijacking the SIM in some game breaking way.

Edit: Just rubbed two neurons together and made coherent thought.

Some smart guy, could during the game startup, use blueprint.lua to go through the units that would be drone shield capable. Then assign, what the max shield value would be as a hard value. This is effect would allow me to pass the MaxShieldHealth into the blueprint to be later used by the UI !

Half way there! Here is the Blueprint.lua script to merge the data that i needed...

##########################################################################################
## --Add drone shield max health into unit bp so UI can use it
##########################################################################################

function Custom_Drone_MaxHealth_Blueprint(bp)
	if not bp then return end
	local id = bp.BlueprintId
	local bpDefense = original_blueprints.defense[id]
	
	-- Check to see if the gUnit has a Cloak, BuildRate or Economy, if so return false
	if bp.Intel.Cloak or bp.Defense.Shield.ShieldMaxHealth > 0 or bp.Enhancements.Shield or bp.Economy.MaintenanceConsumptionPerSecondEnergy then
		return false				
	end
	
	-- Unit Categories to exclude
	local excludedCats = {
		-- Primary unit retrictions, basicly anything that build, upgrades or makes ammo
		'COMMAND','SUBCOMMANDER','ENGINEER','OMNI','FACTORY','ECONOMIC','SILO',
		-- Custom unit restrictions
		'DRONE','MINE','PHASING','TRANSFORMABLE',
		-- Misc unit restrictions
		'POD','SATELLITE','UNTARGETABLE','SHIELD','WALL','PROJECTILE','OPERATION','CIVILIAN','INSIGNIFICANTUNIT','UNSELECTABLE','BENIGN','PROP',
	}
	local cats = bp.Categories
	for k, v in excludedCats do
		if table.find(cats, v) then
			return false
		end
	end

	-- Calc the drone shield max health based on the unit cat
	local droneShieldHealth = bp.Defense.MaxHealth
	if table.find(bp.Categories ,'EXPERIMENTAL') then
		droneShieldHealth = 10000
	elseif table.find(bp.Categories ,'TECH3') then
		droneShieldHealth = droneShieldHealth * 0.3
	elseif table.find(bp.Categories ,'TECH2') then
		droneShieldHealth = droneShieldHealth * 0.5
	else
		droneShieldHealth = droneShieldHealth * 0.75
	end
	
	WARN('Custom_Drone_MaxHealth_Blueprint for unit ID: ', bp.General.UnitName or 'no unit name found')
	
	local unitBp = table.deepcopy(bp.Defense)
	if unitBp then
		unitBp.Merge = true
		unitBp.DroneShieldMaxHealth = droneShieldHealth
		bp.Defense = unitBp		
	end		
end

Repr of a units "self"... Look for the "Defense" and then "DroneShieldMaxHealth"...

WARNING:  - Defense: table: 11FB39D8
WARNING:  -    AirThreatLevel: 0
WARNING:  -    ArmorType: Normal
WARNING:  -    DroneShieldMaxHealth: 235.5
WARNING:  -    EconomyThreatLevel: 0
WARNING:  -    Health: 314
WARNING:  -    MaxHealth: 314
WARNING:  -    Merge: true
WARNING:  -    PersonalShieldThreat: 0
WARNING:  -    RegenRate: 0
WARNING:  -    Shield: table: 11FB36B8
WARNING:  -       RegenAssistMult: 1
WARNING:  -       ShieldSize: 0
WARNING:  -    SubThreatLevel: 0
WARNING:  -    SurfaceThreatLevel: 13
WARNING:  -    UnknownWeaponThreat: 0
WARNING:  - Description: Heavy Tank
WARNING:  - DesiredShooterCap: 3

Got the shield info to display, but dam it displays for everything, when it should only display when the drone-shield is active. the problem is becoming a circular one.... I need info from the sim to activate or deactivate an ability but i can't. Not without using a sim.sync.

Notice that the unit is showing a shield stat, without it having a shield on it...
34cf31d4-ac81-430a-8eba-9f148407ac42-image.png

Sure I can pass the data to the units blueprint, but there isn't any way that i can figure to tell the UI that the shield is active or not.

Question: Isn't the shield data already in Sync somewhere ?

How's the progress going? Its been a while since you were quite prolific on the forums. Looking forward to your next iteration.