16
Help / create item / delete item
« on: November 17, 2023, 03:55:49 am »
i want to delete elerium and alien alloys on map enter,then create them with the amounts i choose,that possible?
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.
you need scripthook "damageSpecialUnit"
in which you should modify variable "transform_chance".
Unit scripts
recolorUnitSprite: Runs for every pixel of a units graphic. Change to any color.
selectUnitSprite: Runs for every part of a units graphic. E.g. Change the graphic used for legs.
selectMoveSoundUnit: Runs for each unit step.
reactionUnitAction: Runs when an unit performs an action that triggers reaction fire.
reactionUnitReaction: Runs when a unit sees another unit perform an action that triggers reaction fire.
hitUnit: When a unit is hit it allows adjusting damage and the part of the body it affects. Runs before damageUnit
damageUnit: Used to alter the final change to stats of a unit when its hit by a weapon. If unit receives a hit with 0 power this script doesnt run.
healUnit: Used to alter effect of medikit on unit. Can alter exp from usage of it.
createUnit: Runs when new unit is created
newTurnUnit: Runs for every unit every turn (this includes alien, civilian and xcom turns)
returnFromMissionUnit: Runs for every unit at the end of a mission.
awardExperience: Runs whenever a unit performs an action that can earn it experience.
visibilityUnit: Runs to check if two units of opposing factions can see each other.
Item scripts
recolorItemSprite: Runs for every pixel of sprite. Change color.
selectItemSprite: Run to change the graphic of an item when its on the floor or in the hands of a soldier
reactionWeaponAction: Runs for the weapon that triggered reaction shots by firing.
createItem: Runs when a new item is created.
newTurnItem: Runs for each item each turn. (this includes alien, civilian and xcom turns)
Stat bonus scripts
For armors: psiDefence, meleeDodge, recovery (time, energy, morale, health, stun, mana)
For items: damageBonus, meleeBonus, accuracyMultiplier, meleeMultiplier, throwMultiplier, closeQuartersMultiplier
For units: applySoldierBonuses: Runs once for each bonus of each soldier on mission start.
Yes, it should workthought it would be fine,wanted to double check,thnx for help and reply
`to_health` is not health, same with stun. this is change of given stat or be precise "damage to X".
And what Meridian said still hold, unit is stunned when stun excess health. You have current health, stun and change to both.
You need calculate future version to know it.
Some thing like this:Code: [Select]var int status 0;
not tested, could be some typos here.
var int temp 0;
unit.getHealth temp;
add status temp;
unit.getStun temp;
sub status temp;
sub status to_health;
sub status to_stun;
if gt status 0;
#code
end;
unit.getHealth Health; # get current health
sub Health to_health; # sub projected hp loss from current hp
#debug_log "Unit Health:" Health;
unit.getStun stunLevel; # set var to unit stun level
add stunLevel to_stun; # add projected stun level to current stun level
#debug_log "Unit Stun:" stunLevel;
if gt stunLevel Health;
[14-11-2023_14-06-22] [DEBUG] Script debug log: Unit Health: 27
[14-11-2023_14-06-22] [DEBUG] Script debug log: Unit Stun Level: 13
debug_log "Unit Health:" to_health;
debug_log "Unit Stun Level:" to_stun;
if gt to_stun to_health;
edit : related subject,what file says wheather or not a research is repeatable?mod im playing repeats interrogate research
getOneFree:
- STR_INFILTRATOR
- STR_FIGHTER
- STR_EXCAVATOR
- STR_SMALL_SCOUT
- STR_MEDIUM_SCOUT
- STR_LARGE_SCOUT
- STR_HARVESTER
- STR_ABDUCTOR
- STR_TERROR_SHIP
- STR_BATTLESHIP
- STR_SUPPLY_SHIP
You have them allready. You can modify them, though.