31
Help / Re: on screen message
« on: November 12, 2023, 08:45:20 pm »yes
what is the code tho?lol u didnt post it
edit : nvm found flashLongMessage
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
yes
here is alternative version of this function that that work similar but couple times longer show given text
because your unit is collapsED not collapsING. This function is used to detecting state where unit get stunned or killed and now falling down on ground.
Meridian said correct solution because this is definition when unit enter stunned state.
Overall, I check functions exposed to script and I see that I simply not added one used for killed units and stunned ones.
Probaby in some next version there will be new two functions `unit.isStunned temp;` and `unit.isKilled temp;`.
Is this what u after?
Yes any new identifier like `temp` in this case, need be defined before use, and `var` is used to define this variable that use that identifier.
scripts:
damageUnit:
- offset: 99
code: |
var int temp;
var int stunLevel;
var ptr GeoscapeSoldier soldier;
unit.isCollapsing temp;
if gt temp 0;
battle_game.flashMessage "STR_UNCONSCIOUS_STRING"; # NumericVariable; #Display text string and numeric variable
unit.getHealthMax temp;
unit.setHealth temp;
mul temp 4;
unit.setStun temp;
set to_health 0;
set to_stun 0;
set to_wound -50;
unit.disableIndicators;
unit.setTag Tag.LRF_IS_DEAD 1;
return;
end;
You can not create pop up window, but you can make a flash message, just as when no time units left.
It can be done via scripting:Code: [Select]battle_game.flashMessage "STR_TEXT_STRING" NumericVariable; #Display text string and numeric variable
Code: [Select]...
unit.isCollapsing temp;
if gt temp 0;
...