196
Help / Re: Limiting the weapon a soldier can carry
« on: February 18, 2022, 10:43:44 pm »
Not sure if I can understand how to get `GeoscapeSoldier`'s tag from the unit then...
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.
To use it you need define new tag similar to other tags but it not used like other ones:Code: [Select]extended:
tags:
RuleItem:
ITEM_NV_GOGGLES: int
BattleUnitVisibility:
VISIBILITY_NV_GOGGLES: int
scripts:
visibilityUnit:
- offset: 3
code: |
var int itemA;
var int itemB;
var int targetShade;
var ptr BattleItem item;
var ptr RuleItem type;
#get info about left hand item
observer_unit.getLeftHandWeapon item;
item.getRuleItem type;
type.getTag itemA Tag.ITEM_NV_GOGGLES;
#get info about left hand item
observer_unit.getRightHandWeapon item;
item.getRuleItem type;
type.getTag itemB Tag.ITEM_NV_GOGGLES;
if eq visibility_mode null; #default visibility
#if left or rigth item have NV bonus
if or eq itemA 1 eq itemB 1;
target_unit.getTileShade targetShade;
if gt targetShade 9;
add current_visibility 48; #16*3 = 3 tiles better visibility in dark
set visibility_mode Tag.VISIBILITY_NV_GOGGLES; #toggle to NV mode
end;
end;
else eq visibility_mode Tag.VISIBILITY_NV_GOGGLES; #assume that other script already set "NV" mode, we only add small bonus in that case
if or eq itemA 1 eq itemB 1;
add current_visibility 16;
end;
end;
return current_visibility visibility_mode;
Currently you can't check changes in tiles, even if I would expose all required data you still could not see as you can't have value to compare to detect change.
For Finnik fork, I do not know if it have more script (as y-script not other things named "scripts") options than OXCE.
This do nothing if you do not add new tags for this, idea was you can define different and each script can interact with each other based on this value, like you have normal visibility bonus script but it should not work for infrared visibility. This value allow to check if you should apply bonuses or not.
Name: visibility_mode var BattleUnitVisibility.Tag
- type: RESISTANCE_SCIENTIST #FIXME add more nodes
missionZones:
-
- [12.36, 16.56, -62.81, -61.09, -6]
- [39.21, 45.82, -53.18, -51.39, -6]
- [54.49, 58.75, -59.27, -57.66, -6]
- [97.42, 105.42, -55.86, -53.78, -6]
- [283.84, 286.55, -49.06, -46.41, -6]
- [295.38, 295.38, -45.2, -45.2, -6]
- [233.73, 241.01, -54.72, -50.6, -6]
- [272.3038, 282.3038, -40.27409, -38.12594, -6]
Do I need to make it like this? - type: RESISTANCE_SCIENTIST #FIXME add more nodes
missionZones:
-
- [12.36, 16.56, -62.81, -61.09, -6]
- [39.21, 45.82, -53.18, -51.39, -6]
- [54.49, 58.75, -59.27, -57.66, -6]
- [97.42, 105.42, -55.86, -53.78, -6]
- [283.84, 286.55, -49.06, -46.41, -6]
- [233.73, 241.01, -54.72, -50.6, -6]
- [272.3038, 282.3038, -40.27409, -38.12594, -6]
-
- [295.38, 295.38, -45.2, -45.2, -6]
[12-02-2022_16-00-17] [WARN] Mixed area types (point vs non-point), region: RESISTANCE_FARM_START_ZONE, zone: 0, area: 2
[12-02-2022_16-00-17] [WARN] Mixed area types (point vs non-point), region: RESISTANCE_FARM_START_ZONE, zone: 0, area: 5
[12-02-2022_16-00-17] [WARN] Mixed area types (point vs non-point), region: RESISTANCE_SCIENTIST, zone: 0, area: 5
the `bleedImmune` default for summoned player units is true;
you can manually set it to false on their armor;
then it will workCode: [Select]bool BattleUnit::isWoundable() const
{
return !_armor->getBleedImmune(!(_type=="SOLDIER" || (Options::alienBleeding && _originalFaction != FACTION_PLAYER)));
}