OpenXcom Forum
OpenXcom Forks => OXCE Support => OpenXcom Extended (OXCE) => OXCE Support Y-scripts => Topic started by: Saedriss on November 17, 2022, 03:13:22 pm
-
Hello.
I would like to create a mod that allows the display of attack notification during gameplay, especially during Alien Turns.
The idea would be to have it displayed in a corner as follow :
ATTACKER -> TARGET (RESULT)
examples :
SECTOID -> JOHN DOE (HIT)
SECTOID -> JOHN DOE (MISS)
JOHN DOE -> SECTOID (REACT HIT)
UNKNOWN -> JOHN DOE (HIT) // Enemy out of sight here.
And I think it might be doable in a Ruleset using scripts hook such as "damageUnit", "hitUnit", etc. But I was not able to find documentation on how to use these.
-
First of all `(MISS)` is for now impossible to implement, as any script is called only when bullet hit its target.
For methods data that are available in scripts you can ask your OXCE exe adding verbose loggin in config.
For overall info about scripts read: https://www.ufopaedia.org/index.php/ModScript_(OpenXcom) (https://www.ufopaedia.org/index.php/ModScript_(OpenXcom))
-
Thanks, I might cut back on the initial ambition, indeed.
I got the script to log things as intended (mostly) now the only issue is to find a way to display it as text in game.
-
To display to player you have function `BattleGame.flashMessage` that show temporal text under buttons.
-
That it does.
But only one message at a time and for a very brief moment.
I guess my dream of a "battle log" on the side of the game's window are beyond my reach.
-
There is variant of thins function that show text around 4 time longer, it have similar name to one I post prevously