1
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.
begin;
var int size;
unit.getInventoryItem.size size;
loop var i size;
var ptre BattleItem item;
unit.getInventoryItem item i;
debug_log "unit" unit "have in inv" item;
end;
end;
begin;
var int size;
unit.getSpecialItem.size size;
loop var i size;
var ptre BattleItem item;
unit.getSpecialItem item i;
debug_log "unit" unit "have in spec" item;
end;
end;
[21-02-2021_17-04-09] [DEBUG] Script debug log: unit BattleUnit(type: "STR_ETHEREAL_SOLDIER" race: "STR_ETHEREAL" id: 1000017 faction: Hostile hp: 1/100) have in inv BattleItem(name: "STR_HEAVY_PLASMA" id: 117)
[21-02-2021_17-04-09] [DEBUG] Script debug log: unit BattleUnit(type: "STR_ETHEREAL_SOLDIER" race: "STR_ETHEREAL" id: 1000017 faction: Hostile hp: 1/100) have in inv BattleItem(name: "STR_ALIEN_GRENADE" id: 119)
[21-02-2021_17-04-09] [DEBUG] Script debug log: unit BattleUnit(type: "STR_ETHEREAL_SOLDIER" race: "STR_ETHEREAL" id: 1000017 faction: Hostile hp: 1/100) have in inv BattleItem(name: "STR_HEAVY_PLASMA_CLIP" id: 120 ammo: 35/35)
[21-02-2021_17-04-09] [DEBUG] Script debug log: unit BattleUnit(type: "STR_ETHEREAL_SOLDIER" race: "STR_ETHEREAL" id: 1000017 faction: Hostile hp: 1/100) have in spec BattleItem(name: "ALIEN_PSI_WEAPON" id: 116)
begin;
var int range 2;
var int l 0;
var int rangeVoxel;
var int sx;
var int sy;
var int sz;
var ptr Tile st;
unit.getPosition.getX sx;
unit.getPosition.getY sy;
unit.getPosition.getZ sz;
battle_game.getTile st sx sy sz;
set l range;
mul l 2;
add l 1;
set rangeVoxel range;
mul rangeVoxel 16;
add rangeVoxel 8; #half tile buffer for max distance
loop var x l;
add x sx;
sub x range;
loop var y l;
add y sy;
sub y range;
loop var z l;
add z sz;
sub z range;
begin;
var ptr Tile t;
var int tileDistance;
var ptr BattleUnit bu;
battle_game.getTile t x y z;
t.getUnit bu;
st.getDistanceVoxel tileDistance t;
if and neq bu null gt tileDistance 0 lt tileDistance rangeVoxel;
#check other close units
debug_log "unit" bu "at" t;
end;
end;
end;
end;
end;
end;
Now another question, probably not a bug but something i can't figure out : in my base when i want to build facilities, only half of them can be selected, the bottom half (trade outpost, training facillity, clear terrain, etc...) are present but clicking on them does nothing, they just can't be selected, why is that ?Facilitates visible but not clickable mean that your base do not have required buildings to built this new one. Alterative some buildings could exclude others.
begin; #stat new scope with new variables
var int i 15; #new variable in the middle of script
loop var zz i; #repeat this code block `i` times, `zz` will have values from `0` to `i-1`
if eq zz 6;
break; #break out of loop block
end;
if eq zz 3;
continue; #skip rest of body of loop and repeat it from start with next `zz` value.
end;
end;
end;
var ptr RuleSoldier rule;
soldier.getRuleSoldier rule;
rule.StatsCap.getTimeUnits temp;
rule.StatsMin.getTimeUnits temp;
rule.StatsMax.getTimeUnits temp;
s.Stats.getStamina temp;
add temp 10; #add some point to current unit stat value
s.Stats.setStamina temp;
I think that was about hit animation. Death animation expanding would be cool, but I suppose it's much harder to implement.Right, that was hit animation, and probably not so much, only problem is that this need be check in multiple places.