Opened 5 years ago

Last modified 4 years ago

#1127 new defect

Explosion GFX (LUPS?) for commanders happening when the unit is reclaimed

Reported by: gajop Owned by:
Priority: minor Milestone:
Component: BAR Version:
Keywords: Cc:


I use reclaim to cut/delete units and in those cases units should just be removed, with no effect. Currently the explosion GFX gets triggered, but the commander doesn't do any damage (which is the correct behavior). See

Change History (9)

comment:1 by Bluestone, 5 years ago

I don't think its possible to fix this, also not entirely sure what happens internally because commanders are set as non-reclaimable -

The commander death explosion is spawned in gadget:UnitDestroyed and is context dependent (on the players TS). UnitDestroyed is (afaik) the only reliable way to tell when a unit dies, and it doesn't get told if the unit was reclaimed or not.

Last edited 5 years ago by Bluestone (previous) (diff)

comment:2 by gajop, 5 years ago

Can you try moving it to a script file instead? I think that script.Killed is only invoked if it's really killed, as is the case of the cluster mushroom in Flove:

comment:3 by Bluestone, 5 years ago

I can't because I know nothing about writing unit scripts and it's not my part of the project to fiddle with - you'll need either behe or nix for that.

Imo the better solution is that the engine provides gadget:UnitDestroyed with information on what did it. Generally, we don't put game mechanics & related stuff into unit scripts.

Last edited 5 years ago by Bluestone (previous) (diff)

comment:4 by gajop, 5 years ago

I definitely agree that it should be a part of the UnitDestroyed callin, and I'm surprised it isn't. I'll try to add it to the engine. Btw, it might already be possible to do it by relying on callins and UnitDamaged/other callins of UnitDestroyed, but it would be a bit hacky.

comment:5 by Bluestone, 5 years ago

Another option is that addon:Explosion also passes a unitID parameter (which is nil if no unit is associated).

Last edited 5 years ago by Bluestone (previous) (diff)

comment:6 by gajop, 5 years ago

Indeed, but I think that callin is a strong TAism (didn't even know it existed) so I wouldn't recommend it. Best wait for engine changes to the UnitDestroyed callin. The only usecase for this is Scened and other mission editors.

comment:7 by Bluestone, 5 years ago

I have no idea how long that callin existed, but I think its potentially a very useful callin (procedural CEGs, potentially based on context, are easy and natural - and there are many use cases there). I don't think TA had an API to anything, so I doubt its related that way.

As it stands the callin is completely useless, because no CEGDefs table exists, CEGs do not have custom params, and the callin has very little idea what explosion is happening anyway. This is more likely the reason why its doomed to obscurity.

Last edited 5 years ago by Bluestone (previous) (diff)

comment:9 by Bluestone, 4 years ago

Component: BA trunkBAR
Note: See TracTickets for help on using tickets.