1
Help / Re: oxce ruleset docs?
« on: November 24, 2023, 12:54:51 am »
ok thnx
Is There a specific search word to find them in the verboise dump?
Is There a specific search word to find them in the verboise dump?
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.
no, the default value is this:Code: [Select]const RuleItem *specialDamageTransform = attack.damage_item ? attack.damage_item->getRules() : nullptr;
int specialDamageTransformChance = 0;
if (specialDamageTransform
&& !specialDamageTransform->getZombieUnit(this).empty()
&& getArmor()->getZombiImmune() == false)
{
specialDamageTransformChance = getOriginalFaction() != FACTION_HOSTILE ? specialDamageTransform->getZombieUnitChance() : 0;
}
Sorry, but I tried your script and the logs clearly indicate what's wrong.Code: [Select][23-11-2023_07-09-43] [ERROR] Invalid variable name 'transform'
[23-11-2023_07-09-43] [ERROR] Error in matching arguments for operator 'var'
[23-11-2023_07-09-43] [ERROR] Error in parsing script 'damageSpecialUnit' for 'Global Event Script': invalid operation in line: 'var int transform 0;'
It says exactly, which line is wrong ('var int transform 0;').
And it says exactly what's wrong (invalid variable name).
And Nord's answer is also correct.
Once you fix the issue with the variable name, the logs will complain about the missing return too.
Here's a fixed script:Code: [Select]extended:
tags:
BattleUnit:
LRF_IS_DEAD: int
scripts:
damageSpecialUnit:
- offset: 99
code: |
var int temp 0;
var int transformx 0;
set temp transform_chance;
#...magic...
set transform_chance temp;
debug_log "transform " temp;
battle_game.flashLongMessage "STR_TRANSFORM_STRING";
return;
You should know it, you have all available tools to debug this, look in logs and see what was there.
you forgetCode: [Select]return;
in the end.
"...magic..." is not an operator, it is a joke.
Dont write it.
extended:
tags:
BattleUnit:
LRF_IS_DEAD: int
scripts:
damageSpecialUnit:
- offset: 99
code: |
var int temp 0;
var int transform 0;
set temp transform_chance;
#...magic...
set transform_chance temp;
debug_log "transform " temp;
battle_game.flashLongMessage "STR_TRANSFORM_STRING";
first string is wrong, and you forget about @magic@ in a middle.
If you want make chances equal to 0:Code: [Select]set transform_chance 0;
If you want set chances 15% less:Code: [Select]set temp transform_chance;
And dont forget to define variable in a beginning of script:
muldiv temp 85 100;
set transform_chance temp;Code: [Select]damageSpecialUnit:
- offset: 11 # any number for counting
code: |
var int temp;
scripts:
damageSpecialUnit:
- offset: 99
code: |
var int temp 0;
var int transform 0;
set temp transform_chance;
...magic...
set transform_chance temp;
debug_log "transform " temp;
battle_game.flashLongMessage "STR_TRANSFORM_STRING";
Youmust Show it here.
#get transform_chance temp;
#set transform_chance temp;
#set temp transform_chance;
#debug_log "transform " temp;
unit.getHealth Health; # get current health
sub Health to_health; # sub projected hp loss from current hp
debug_log "Unconscious Code 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 "Unconscious Code Stun:" stunLevel;
#get transform_chance temp;
#set transform_chance temp;
#set temp transform_chance;
#debug_log "transform " temp;
if ge stunLevel Health;
#battle_game.flashLongMessage "STR_TRANSFORM_STRING";
battle_game.flashLongMessage "STR_UNCONSCIOUS_STRING";
#set transform_chance temp;
#debug_log "transform " temp";
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 want ufo shot down by interceptors underwater crash sites? or random monthly generated ufo crash sites? (Similar to terror missions)
That's one of the worst feature descriptions I've seen in a long time.
Do you really expect I can do anything based on such vague and incomplete "bunch of words".
These don't even qualify as full sentences.
Please don't insult us like this.
To create full list of script commands, you need to switch "verboseLogging" in options.cfg to "true", then launch oxce, then quit and open file "openxcom.log". It will contain not only log, but script help. Save it somewhere, and remember to update when upgrade to newer OXCE version.
Just as any variable,Code: [Select]set temp transform_chance;
...magic...
set transform_chance temp;
Like 0 is no transform at all, 100 - transform by any circumstances.
1. modify amounts of elerium: useCode: [Select]alienFuel: [STR_ANYTHING_YOU_WANT, 10]
, where 10 is as much fuel will be placed in each alien power source.
2. modify amounts of alloys, cloning, etc: look here
3. modify type of special items on map - you need to modify terrain via special program, like MCDEdit. Look in the "Tools" subforum