detecting system map use query

Freeform discussion about anything related to modding Transcendence.
Post Reply
Militia Captain
Militia Captain
Posts: 586
Joined: Tue Nov 05, 2013 9:56 am

Thu Oct 11, 2018 3:30 am

Is there a way of detecting when a system map ROM has been used or is being used in a system?
It would be good if the Commander' s Log mod could show the player if a map ROM, either civilian or military, has been used in a system. This would save the player either guessing or making a note somewhere so they didn't use two in the same system.

The only possibility I can see is using <OnInvokedByPlayer>. But it looks like that event has to be inside another type.
Or overriding the map ROM types, but It would be better if there was another way.
Something that recognizes the attribute 'systemMap'?
Or checks if one of the four Text ids used by map ROMs has been displayed?
Is there an event which runs whenever the player 'u'ses an item? TIA.

Militia Commander
Militia Commander
Posts: 462
Joined: Tue Mar 05, 2013 8:26 am

Thu Oct 11, 2018 6:30 am

I don't think there's currently a way to do this without modifying the code of the items. There's no event like OnGlobalPlayerUsedItem, although it could be useful. And OnInvokedByPlayer only works for powers. Technically, a mod could use XML functions to add code to their Invoke events without changing what's there, by enclosing it in a new block, so it would be compatible with other mods.

But maybe there's enough interest in this information that we should just add it to core. I'd have to do some research to figure out how to add information to the galactic map panel for a system. But it would be easy to add something like (sysSetData 'mapROMUsed true) to the map ROM code (and something similar for military) so that mods could access this information.

Link to your related Ministry ticket

Post Reply