This would be for target acquisition control that does not require extensive unit target checks. (I assume power is a unit attribute used in target acquisition...)
Something like "Spring.SetUnitPower(unitID, newPower)". If this was added a getter would be useful as well.
I know you can currently modify xp for limited control of power but that is a really really bad workaround.
Joined: 22 Feb 2006, 01:02 Location: cheap kitchen
i think this is already possible using TargetWeight and BlockShot in unit scripts? I never got that to work though In this file: https://github.com/spring/spring/blob/master/rts/Lua/LuaRules.h the callins AllowWeaponTargetCheck & AllowWeaponTarget also look promising. (for 0.83)
Quote:
I know you can currently modify xp for limited control of power but that is a really really bad workaround.
Assuming the game uses experienceMult=0 and xp is used for nothing else, what side effects does it have?
The request stems from this thread. In this example I would like to make every single unit treat this unit as a less important target when closed, this would be trivial to do in the unit script if lua could modify power.
The new callins look promising but they seem like overkill for this application. Any solution with these callins looks like it would be slower than a power modification as every unit would need to use the callin to modify the weight of a single target.
Quote:
Assuming the game uses experienceMult=0 and xp is used for nothing else, what side effects does it have?
From a comment in modrules.lua
Code:
power = default power * (1 + (powerScale * xp/(1 + xp) ) )
This gives a limit range; power range = default power*[1, 1+powerScale)
To be able to 'lose power' a unit must be created with xp. Anyway ZK uses XP to some extent so this isn't a solution. It demonstrates to me that power modification during the game is technically possible (well the parameter could be broken....)
Users browsing this forum: No registered users and 0 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum