aliens

Show Posts

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.


Messages - Yankes

Pages: 1 2 3 [4] 5 6 ... 212
46
OXCE Support Y-scripts / Re: Broken Y-scripts
« on: March 08, 2024, 12:11:54 am »
Code: [Select]
Error in parsing script 'hitUnit' for 'Global Event Script': invalid operation in line: 'if and eq shield_skipper 1 shieldType 0;'

This error is because you have only one `eq`, basic `if` look like `if eq x y;` but you can have multiple conditions by appending `and`
like:
Code: [Select]
if and
   eq x y #first `eq`
   eq z w; #second `eq`

Code: [Select]
Error in parsing script 'hitUnit' for 'Global Event Script': invalid operation in line: 'set attacker is_concealed 0;'
set have only two arguments not three.


Code: [Select]
Error in parsing script 'hitUnit' for 'Global Event Script': invalid operation in line: 'BattleUnit.setTag is_concealed 1;'I have no idea what your intention was with this code, what tag and what object you want update?

47
I do not think that negative numbers should be supported, lot of logic assume positive values, fact that drawing ignore
this items is one example of this where engine logic break down.

48
OXCE Support Y-scripts / Re: Broken Y-scripts
« on: March 05, 2024, 11:08:59 am »
I was hoping that my error messages are precise enough that every one can fix bug himself.
Like
Code: [Select]
[2024-03-04_16-44-02] [ERROR] Unknown variable name 'Unit'
[2024-03-04_16-44-02] [ERROR] Error in parsing script 'createUnit' for 'Global Event Script': invalid operation 'Unit.Stats.getFiring'
[2024-03-04_16-44-02] [ERROR] Error in parsing script 'createUnit' for 'Global Event Script': invalid operation in line: 'Unit.Stats.getFiring inital_acc;'

You read this from bottom. some thing in line `Unit.Stats.getFiring inital_acc;` is wrong. Then engine explain that it do not understand "operation", `Unit.Stats.getFiring` and because text `Unit` is not variable. Did you mean `unit` or some thing else here?

Same with:
Code: [Select]

[2024-03-04_16-44-02] [ERROR] Can't match overload for operator 'BattleItem.getRuleItem' for:
[2024-03-04_16-44-02] [ERROR]   [ptre BattleItem] [var int] [RuleItem.Tag]
[2024-03-04_16-44-02] [ERROR] Expected:
[2024-03-04_16-44-02] [ERROR]   [ptr BattleItem] [var ptr RuleItem]
[2024-03-04_16-44-02] [ERROR] Error in parsing script 'damageUnit' for 'Global Event Script': invalid operation in line: 'damaging_item.getRuleItem can_weapon_power_downgrade Tag.CAN_WEAPON_POWER_DOWNGRADE;'


operation `damaging_item.getRuleItem` expect variable defined like `var ptr RuleItem rule;` but you give it two `can_weapon_power_downgrade` and tag.
Did you want operation that get tags from weapon?

49
OpenXcom Extended / Re: OXCE (OpenXcom Extended) main thread
« on: March 02, 2024, 04:11:22 pm »
If you could reduce this to small test case, as I see GCC 11 is still supported, it possible that they still could fix it on this version.
But there is chance that before anybody get ready to fix it, that version get removed from supported versions (as now is first on chopping block).

50
OpenXcom Extended / Re: OXCE (OpenXcom Extended) main thread
« on: March 02, 2024, 03:41:38 pm »
Code: [Select]
internal compiler error: Segmentation faultOk, you find bug in compiler probably installing different version of GCC should fix it.
I will look on it when I will have more free time to see if I can workaraund this bug.

51
http://108.61.157.159/versions/win/ I added test version of OXCE (for now for windows) where I alter how data folders are handled.
at least I expect that problems show here do not happens in new test version.

52
Only some loose thoughts, some times I consider some thing and when I see it will be mess I abandon it.

53
OXCE Support Y-scripts / Re: [Suggestion/question]Geoscape script hooks?
« on: February 28, 2024, 10:19:17 pm »
You have ufo detection, but you are right geoscape do not have loot of "love" from scripts.
I simply had enough time to sit down and plan how it should work in geoscape.

For globe textures, I was thinking once about option to `selectTexture`, but there is multiple open question what data should be accessible here and how often should be called.

54
OXCE Support Y-scripts / Re: Broken Y-scripts
« on: February 28, 2024, 08:52:28 pm »
No line can start with `ptre` as this is part of type specifier. Variable need start from keyword `var` and after that you put type and finally variable name.
e.g.
instead of
Code: [Select]
ptr GeoscapeSoldier inital_acc;you need use
Code: [Select]
var ptr GeoscapeSoldier inital_acc;but looking on rest of your code it looks like you do not want "solder" here but accuracy stat value.
And most of this values are `int` not "soldiers", this mean
Code: [Select]
var int inital_acc;should be correct definition of used variable.

Another problem I see is that you copy paste part of other scripts, and you cut it in that place you have more `end;` lines that should be there looking on number of `if`.

side note, I recall plugin for Visual Studio Code that have basic validation for my script syntax (and rest of rule files), probably this would be helpful for you as error messages would be more precise.

55
OXCE Support Y-scripts / Re: Broken Y-scripts
« on: February 28, 2024, 11:06:48 am »
I do not see this is related to BAI as most of this errors look like simply missing variables in script and typos.

e.g. script try use local variable `itemRuleset` that was not declared.
Another is missing `;` after `Tag.GOGGLES_STRENGTH`
`var ptre soldier_rule RuleSoldier;` mix order of names of variable to declare with name of type.

overall when you read errors, engine output at first most inner one, and on following lines that add more context.

56
OXCE Support Y-scripts / Re: Broken Y-scripts
« on: February 28, 2024, 12:33:44 am »
how exactly broken? what happens exactly? and what you expected to happens? do script compile at all?

57
Brutal AI / Re: Brutal-OXCE 8.3.0
« on: February 27, 2024, 07:10:01 pm »
This is like self executing anonymous function, right?
Yes, `[&]` introduce lambda function (`{...}` is its body) that can `&` reference all objects in function, and last `()` call it.

58
Open Feedback / Re: Improving MIDI music support (ALSA MIDI) on Linux?
« on: February 27, 2024, 07:06:32 pm »
Code: [Select]
Any plans to add ALSA Midi support into OpenXCOM?Probably no, someone need to contribute it (write change and test it).
Another problem is that OXC will need to move away from SDL1.2, I do not know if MIDI is even possible in SDL2 or SDL3 way you want.

59
Brutal AI / Re: Brutal-OXCE 8.3.0
« on: February 27, 2024, 03:50:35 pm »
btw even if `fac=*(_facilities.end());` do not crash this is incorrect when you use "foreach" loop, even more it could break logic as it override vector data by other.
If you used classic loop this would look like `*it = *(_facilities.end() - 1);` and it would copy data and not break loop.
For nested loops there is another trick (aside of `goto`) to exit them, `return` and lambda functions:

Code: [Select]
(
[&]
{
for (auto* fac : _facilities)
{
for(Craft *fCraft : fac->getCraftsForDrawing()) // Now, we consider a vector of crafts at the hangar facility
        {
if (fCraft == craft)
{
fac->delCraftForDrawing(fCraft); // If craft is at the hangar, it is deleted
return; //quit lambda not whole function
}
}
}
}
)();


60
Brutal AI / Re: Brutal-OXCE 8.3.0
« on: February 27, 2024, 02:10:54 pm »
Debug deliberately crash on code like this, in Release all checks are removed (as cost a lot) and code can access invalid memory.
Why code "work"? as most cases there still vector memory here, and in many cases after removing elements it could have garbage that have valid value.
And this case `*(end() -1)` and `*end()` have same value as `*end()` point to memory that have previous "high mark" of data that vector stored before removing element from it.

Pages: 1 2 3 [4] 5 6 ... 212