Thank you
Meridian!!!
That got it.
All research entries are now loading without crashing.
Now all that remains is the mystery of why an Aquanaut equipped with a loaded
Hydrogen Rifle appears to be holding nothing.
When unloaded it uses the rifle's own
HandOb sprite set without a problem. However once the weapon is loaded the rifle isn't switching from
HandOb 136 to
128 for some reason.
I thought it could be that I'd failed to correctly define
HandOb: 128, but that does not appear to be the case as if I change
STR_HR_HYDROGEN_RIFLE's
handSprite: 136 directly to
128 the loaded rifle's sprite set does display.
(But only when the weapon is unloaded)The
tags: NEW_HANDOB_FOR_WEAPON: 128 appears to be having a problem. Is there anything about
TFTD that would have changed how the
HandObs are being rendered vs
X-COM: UFO Defense that could effect
Ohartenstein23's script?
extended:
tags: # Remember to add these tags to the same file as items ruleset
RuleItem:
ALLOW_AMMO_TO_RESPRITE: int
NEW_BIGOB_FOR_WEAPON: int
NEW_FLOOROB_FOR_WEAPON: int
NEW_HANDOB_FOR_WEAPON: int
CURRENT_MOD_OFFSET: RuleList
scripts:
selectItemSprite:
# Select weapon bigSprite based on ammo item
- offset: 1
code: |
var ptr BattleItem ammoItem;
var ptr RuleItem weaponRuleset;
var ptr RuleItem ammoRuleset;
var int doResprite;
var int newSprite;
var int modOffset;
if eq blit_part blit_item_big;
item.getRuleItem weaponRuleset;
weaponRuleset.getTag doResprite Tag.ALLOW_AMMO_TO_RESPRITE;
if eq doResprite 1;
item.getAmmoItem ammoItem;
ammoItem.getRuleItem ammoRuleset;
ammoRuleset.getTag newSprite Tag.NEW_BIGOB_FOR_WEAPON;
if neq newSprite 0;
ammoRuleset.getTag sprite_index Tag.NEW_BIGOB_FOR_WEAPON;
ammoRuleset.getTag modOffset Tag.CURRENT_MOD_OFFSET;
rules.getSpriteOffsetBigobs sprite_index modOffset;
return sprite_index;
end;
end;
end;
return sprite_index;
# Select weapon floorSprite based on ammo item
- offset: 2
code: |
var ptr BattleItem ammoItem;
var ptr RuleItem weaponRuleset;
var ptr RuleItem ammoRuleset;
var int doResprite;
var int newSprite;
var int modOffset;
if eq blit_part blit_item_floor;
item.getRuleItem weaponRuleset;
weaponRuleset.getTag doResprite Tag.ALLOW_AMMO_TO_RESPRITE;
if eq doResprite 1;
item.getAmmoItem ammoItem;
ammoItem.getRuleItem ammoRuleset;
ammoRuleset.getTag newSprite Tag.NEW_FLOOROB_FOR_WEAPON;
if neq newSprite 0;
ammoRuleset.getTag sprite_index Tag.NEW_FLOOROB_FOR_WEAPON;
ammoRuleset.getTag modOffset Tag.CURRENT_MOD_OFFSET;
rules.getSpriteOffsetFloorob sprite_index modOffset;
return sprite_index;
end;
end;
end;
return sprite_index;
# Select weapon handSprite based on ammo item
- offset: 3
code: |
var ptr BattleItem ammoItem;
var ptr RuleItem weaponRuleset;
var ptr RuleItem ammoRuleset;
var int doResprite;
var int newSprite;
var int modOffset;
if or eq blit_part blit_item_lefthand eq blit_part blit_item_righthand;
item.getRuleItem weaponRuleset;
weaponRuleset.getTag doResprite Tag.ALLOW_AMMO_TO_RESPRITE;
if eq doResprite 1;
item.getAmmoItem ammoItem;
ammoItem.getRuleItem ammoRuleset;
ammoRuleset.getTag newSprite Tag.NEW_HANDOB_FOR_WEAPON;
if neq newSprite 0;
add newSprite sprite_offset;
set sprite_index newSprite;
ammoRuleset.getTag modOffset Tag.CURRENT_MOD_OFFSET;
rules.getSpriteOffsetBigobs sprite_index modOffset;
return sprite_index;
end;
end;
end;
return sprite_index;
I've used this script with several items before in
X-COM: UFO Defense and there hasn't been a problem.