The reason I am asking is because many projects include armor systems(s44, gundam, 0k) which should definitely effect target priority/selection. However, as it stands we cannot take these sort of things into account and have this weird power tag which cannot take take into account the armor class systems employed by the games.
So is it possible to break this out into lua instead of hard-coded in the engine? Would it hurt performance?
*INB4LUAIT* I don't want to do a targeting override gadget as I would be fighting the spring targeting system
Engine:SlowUpdate() for every unit u for every weapon w of u if Lua:AllowWeaponTargetCheck(u, w, ...) for each potential target unit t in range of w allowed, priority = Lua:AllowWeaponTarget(u, t, w, ...) if allowed insert t into target list of w with returned priority else -- this is subject to change (I may have it skip t -- entirely if the callin exists but returns false, -- as opposed to when it doesn't exist at all) calculate priority value via hardcoded logic insert t into target list of w with that value
sort target list by priority (increasing order) for each target t in list if t can be hit by w select t as target for w; break
Joined: 22 Feb 2006, 01:02 Location: cheap kitchen
"nobody knows" as in "i would like to know more." BlockShot is quite obvious (though I do not understand in what details it is different from return true/false in AimWeapon) and seems to work but on how TargetWeight and UnitScript.SetUnitValue(COB.CHANGE_TARGET, 1) work I understood practically nothing. ie what is up with that:
Rafal on Q&A page wrote:
I am working on it and have a half ready solution that works if userTarget == false. The problem is that Spring ingores COB.CHANGE_TARGET if userTarget == true, and it is true in most cases. It is true if you tell the unit to attack, but is also true if the unit is idle and something gets into range and it starts firing. It is only false if the unit has some non-combat order in its queue
If we knew how it works then I think what smoth wants is already possible.
But of course more functions and info on all that is always greatly appreciated.
Maybe related request: scripts chosing what weapon the unit uses for manouering/getting in range, maybe also with weighting between multiple weapons. Right now it seems to be done using a fake weapon1 which seems to have some problems (?)
Cool. Can BA and ZK and all the other games with anti-air-specific weapon and aircraft-that-lands amend their SAM code to target *all* airborne units and ignore landed units? And make anti-ground weapons target (and harm) landed aircraft? Because the current behavior of landed aircraft being magically different from other units on the ground seems silly.
Is there going to be a way to get hold of the list of targets the unit is considering cause 'AllowWeaponTarget' doesn't seem to allow you to implement BadTargetCategory if you don't know what else the unit would target if you declined the check... (See: viewtopic.php?f=21&t=23417)
I would like a list of possible targets as well. I would like to implement dynamic bad targets for status effect weapons that gain nothing from attacking a unit once the unit is fully effected. It is much like the current hardcoded retarget behaviour for EMP.
So do these callings allow to replace OnlyTargetCategory with custom code or not yet? I would like to be able to change unit's targetCategory in real time. Possible uses are submarines surfacing/submerging and aircraft landing/taking off.
An Anti-Air cannon that cannot shoot ground units but somehow can shoot landed aircraft doesn't make much sense.
I would like a list of possible targets as well. I would like to implement dynamic bad targets for status effect weapons that gain nothing from attacking a unit once the unit is fully effected. It is much like the current hardcoded retarget behaviour for EMP.
That was what i wanted for capture - prevent allies froma ttacking unit being captured and focus capture power on same unit.
Users browsing this forum: No registered users and 1 guest
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