ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
LTX Checker

1 2 3 4
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  14:44:02  23 May 2008
profilee-mailreply Message URLTo the Top
Don Reba
Bishop and Councilor of War
(Moderator)

 

 
On forum: 12/04/2002
 

Message edited by:
Don Reba
06/10/2008 4:10:26
Messages: 11607
In researching better ways of merging scripts, I have developed a utility for verification of LTX scripts. It is somewhat like a spellchecker. Currently, it detects the following kinds of errors:

• preprocessor errors
        ∙ circular inclusion
        ∙ incorrect file names
• syntactic errors, such as as russian letters in variable names
• grammatic erros, such as mismatched brackets
• semantic errors
        ∙ duplicate sections
        ∙ duplicate declarations
        ∙ duplicate assignments
        ∙ incorrect trader files format

This is an early version, and I am not an expert modder myself. The checker does not cover every possible case yet. Please, give examples of scripts:

• in which there are errors the checker does not detect
• that are correct, but are marked as errors

This could be a way of using some expertise within the community to create a tool for everyone.

Download:

[link]http://www.smart-mod-manager.org/other/LtxChecker_0.6.7z[/link] (51 KB)

Requires .NET 2.0.

All errors from US Steam version 1.0005:

[link]http://www.smart-mod-manager.org/other/error_compilation_0.6.7z[/link]

Miscellaneous:

Parsing is based on the following ANTLR grammar:

[link]http://www.smart-mod-manager.org/other/ltx_0.6.html[/link]

The following command line switches are recognized:

LtxChecker.exe [ /i:<input path> ] [ /o:<output path> ] [ /e:<errors path> ]

If an input path and an errors path are set, the program will not display a GUI, but will instead record the errors into the given file.
  14:59:32  23 May 2008
profilee-mailreply Message URLTo the Top
Atrocious
Senior Resident
 

 
On forum: 04/01/2008
 

Message edited by:
Atrocious
05/23/2008 15:04:54
Messages: 285
Nice idea!

I just downloaded it and tested it and unfortunately it throws an unhandled exception. I'll copy the log below (contains some German words).

Apart from that I wanted to ask you, if you can include drag-and-drop functionality or at least a file selection dialog ( "browse" ) . Me = mouse-whore.


---QUOTATION---

System.IO.FileNotFoundException: ....

---END QUOTATION---



Edit: Problem solved; log deleted.
  15:01:39  23 May 2008
profilee-mailreply Message URLTo the Top
Don Reba
Bishop and Councilor of War
(Moderator)

 

 
On forum: 12/04/2002
 

Message edited by:
Don Reba
05/23/2008 15:05:45
Messages: 11607
Oops. Forgot to include the ANTLR DLLs.

Reuploaded.


Drag and drop — easy. Will add it in the next version. Thanks for the idea!
  15:18:29  23 May 2008
profilee-mailreply Message URLTo the Top
Atrocious
Senior Resident
 

 
On forum: 04/01/2008
 

Message edited by:
Atrocious
05/23/2008 15:21:51
Messages: 285
Okay here is the result for trade_ecolog.ltx from OL2.0

---QUOTATION---

"trade_ecolog.ltx" (3, 17): no viable alternative at character '{'
"trade_ecolog.ltx" (3, 18): no viable alternative at character '+'
"trade_ecolog.ltx" (3, 38): no viable alternative at character '}'
"trade_ecolog.ltx" (4, 15): no viable alternative at character '{'
"trade_ecolog.ltx" (4, 16): no viable alternative at character '+'
"trade_ecolog.ltx" (4, 36): no viable alternative at character '}'
"trade_ecolog.ltx" (3, 63): required (...) loop did not match anything at input ','

---END QUOTATION---


Does it report these as errors or just warnings? Maybe you could include "error:" and "warning:" in front of the outputs.

Also I've found another unhandled exception. When you click "check" while the Input line is empty, it throws it.

And here is some tough error for you:
I put a "V" behind a line in the trade_ecolog.ltx and it didn't find the error. I tried both:

---QUOTATION---

bandage = V
-----------------
bandage V

---END QUOTATION---


I tested this, because I actually found such an error in an ltx once, where someone obviously hit SHIFT V instead of CTRL V and he forgot the letter in the file.
  15:42:24  23 May 2008
profilee-mailreply Message URLTo the Top
Don Reba
Bishop and Councilor of War
(Moderator)

 

 
On forum: 12/04/2002
 

Message edited by:
Don Reba
05/23/2008 15:43:42
Messages: 11607

---QUOTATION---
"trade_ecolog.ltx" (3, 17): no viable alternative at character '{'
---END QUOTATION---


Oh. This line:

sell_condition = {+yan_kill_brain_done} ecolog_after_brain_sell, ecolog_start_sell

I will have to add a grammar rule for these figure brackets. What do they mean, by the way?

---QUOTATION---
Does it report these as errors or just warnings? Maybe you could include "error:" and "warning:" in front of the outputs.
---END QUOTATION---


It does not separate warnings from errors. In any case, it tries to recover and continue checking the rest of the file.

---QUOTATION---
Also I've found another unhandled exception. When you click "check" while the Input line is empty, it throws it.
---END QUOTATION---


Thanks, I will make version 0.2 today after work.

---QUOTATION---
bandage = V
---END QUOTATION---


This is just assignment of value "V" to variable "bandage". For instance, as in misc\quest_items.ltx (437):

inv_name = "Scientist" Flash card

---QUOTATION---
bandage V
---END QUOTATION---


This looks like it should be an error.
  16:40:33  23 May 2008
profilee-mailreply Message URLTo the Top
Atrocious
Senior Resident
 

 
On forum: 04/01/2008
Messages: 285

---QUOTATION---
What do they mean, by the way?
---END QUOTATION---


Please read the explanation here (First post, first part):
http://forums.filefront.com/s-t-l-k-e-r-soc-modding-editing/362105-tutorial-how-edit-trader-files.html#post4342355

---QUOTATION---

bandage = V
This is just assignment of value "V" to variable "bandage".
---END QUOTATION---


Yes, but it's an error. Variables in the trader files shouldn't contain such values. Something like that would be correct:

---QUOTATION---

bandage = 3, 0.6
---END QUOTATION---


But I don't know if the bandage examples will cause the ltx stop working or if they just affect the bandages.
  17:05:04  23 May 2008
profilee-mailreply Message URLTo the Top
Ceano
Senior Resident
 

 
On forum: 03/02/2006
Messages: 4820
Nice Don
Will try it later on!
  18:07:02  23 May 2008
profilee-mailreply Message URLTo the Top
Don Reba
Bishop and Councilor of War
(Moderator)

 

 
On forum: 12/04/2002
Messages: 11607
The semantic checker needs type information to know if the trader files make total sense. This would be a little bit involved, so I will do it later. First, I will add rules for the special synthax to remove false alarms.

http://img396.imageshack.us/img396/1784/barmandiagramiu4.png
  22:12:42  23 May 2008
profilee-mailreply Message URLTo the Top
Don Reba
Bishop and Councilor of War
(Moderator)

 

 
On forum: 12/04/2002
 

Message edited by:
Don Reba
05/23/2008 22:22:32
Messages: 11607
I need to ask a couple of noob questions.

What do percentage signs mean?

{=killed_by_actor} nil %+rostok_actor_kill_killer%

What about the vertical bars?

50|{=best_pistol}psy_armed,psy_pain@wounded_psy|20| {=best_pistol}psy_shoot,psy_pain@{=best_pistol}wounded_psy_shoot,wounded_psy

What are "@" signs for?

What about colons?

{+esc_kill_bandits_quest_kill} %=hit_npc(esc_killers_kamp_wait:bip01_spine1:1000:0)%
  23:37:37  23 May 2008
profilee-mailreply Message URLTo the Top
Atrocious
Senior Resident
 

 
On forum: 04/01/2008
Messages: 285

---QUOTATION---
I need to ask a couple of noob questions.
---END QUOTATION---


Would it be enough when I tell you, it's all needed?


---QUOTATION---

What do percentage signs mean?

{=killed_by_actor} nil % rostok_actor_kill_killer%

---END QUOTATION---


The thing between % is the info_portion that is given (or taken with -). There can be more than on info_portion in it, so it's just another way of putting brackets around something.


---QUOTATION---

What about the vertical bars?

50|{=best_pistol}psy_armed,psy_pain@wounded_psy|20| {=best_pistol}psy_shoot,psy_pain@{=best_pistol}wounded_psy_shoot,wounded_psy

---END QUOTATION---


I honestly don't know.


---QUOTATION---

What are "@" signs for?

---END QUOTATION---


Maybe this is different for different ltx? In gulag files they seperate the type of action from the name, like: logic@agr_nii_north_gate_walker2
logic is how the NPC acts and the latter part is the name of the action. So it's just a way of making identifiers. Dunno if that's the same for your example.


---QUOTATION---

What about colons?

{ esc_kill_bandits_quest_kill} %=hit_npc(esc_killers_kamp_wait:bip01_spine1:1000:0)%
---END QUOTATION---


Also I don't know, sorry. So hopefully someone else can complete it.
  00:01:56  24 May 2008
profilee-mailreply Message URLTo the Top
NatVac
Senior Resident
 

 
On forum: 06/15/2007
 

Message edited by:
NatVac
05/25/2008 18:38:41
Messages: 4263

---QUOTATION---
I need to ask a couple of noob questions.

What do percentage signs mean?

{=killed_by_actor} nil %+rostok_actor_kill_killer%

What about the vertical bars?

50|{=best_pistol}psy_armed,psy_pain@wounded_psy|20| {=best_pistol}psy_shoot,psy_pain@{=best_pistol}wounded_psy_shoot,wounded_psy

What are "@" signs for?

What about colons?

{+esc_kill_bandits_quest_kill} %=hit_npc(esc_killers_kamp_wait:bip01_spine1:1000:0)%
---END QUOTATION---


To extend what atrocious said:

The braces usually enclose conditions that must be met. A plus sign requires the info_portion be present, while a minus sign means it must be absent. An equals sign means execute the function* and test for a return value of true. An exclamation mark means execute the function and test for a return value of false.

The nil in your example is a placeholder for what normally would be the next section to go to when the condition is met. A nil means stop here if the condition is met. Often this has a reference to another scheme for the NPC (e.g., remark@esc_stalker_fox) found in the same area enclosed in square brackets: [remark@esc_stalker_fox].

The percent character pair encloses the action(s) to take when the condition is met. Here, a plus sign means add the info_portion to the game. Again, an equals sign means execute the function,* but any return value is ignored.

In other words: if {this_condition} is met, then branch to this_scheme@identifier, also %+add_this_info_portion =execute_this_function%.

The at sign is simply a convenience for qualifying a label; an underscore could also be used, or no symbol at all. The left part is a scheme (e.g., [sr_idle]) or a state.

The colon separates parameters passed in a single array, which simplifies argument passing in %=function()% statements.

The vertical bars separate statements that will be put into an array; see parse_params() in utils.script. I haven't looked at this in detail yet. Look at the cfg_get_string_and_condlist() function in xr_logic.script, and how it is used in that script.

Edit: Clarifications.

*Conditional test functions are normally found in xr_conditions.script, while action functions are found in xr_effects.script. Edited per TSL16b's kind correction. Edited again because edits remove special characters.
  11:59:45  24 May 2008
profilee-mailreply Message URLTo the Top
TSL16b
(Senior)
 
On forum: 06/22/2007
 

Message edited by:
TSL16b
05/24/2008 12:02:44
Messages: 92
As I remember conditions calling a function (like {=killed_by_actor} ) are searched in xr_conditions.script while function calls in actions are searched in xr_effects.script as NatVac said.
  16:38:02  25 May 2008
profilee-mailreply Message URLTo the Top
Don Reba
Bishop and Councilor of War
(Moderator)

 

 
On forum: 12/04/2002
 

Message edited by:
Don Reba
05/25/2008 18:16:39
Messages: 11607
Thanks a lot for your advice.

I have just uploaded version 0.2 and updated the first post. The new version has a few UI improvements, including Drag and Drop. More importantly, the new version recognizes conditional statements, meaning that it does not generate the false errors in trader files that it used to. It also understands array notation.

I looked through every use of conditions, all 1502 of them. They turned out more complicated than I anticipated. Here are a few more things I do not understand.

Ambiguity

There is ambiguity due to conditional statements with omitted else expressions.

• {+a} {+b} 1, 2

Here we could put parentheses in either of the following two ways:

• {+a} ({+b} 1), 2
• {+a} ({+b} 1, 2)

If a is false, is the result 2 or nil? I am not sure how to resolve this.

Event IDs

There is another thing that puzzles me:

• {~60 =actor_in_zone(second_door_marker)} ph_door@horror_wait
• {~25} mob_trader@new_idle1_to_idle3
• {=heli_health_le(25) ~25} heli_move@die1

I see numbers used in the same places events are. Are these some sort of event identifiers?
  21:28:14  25 May 2008
profilee-mailreply Message URLTo the Top
NatVac
Senior Resident
 

 
On forum: 06/15/2007
Messages: 4263
I don't know about the ambiguous conditional statements. It might be an error; could you post the specific example or examples, Don Reba?

The numbers preceded by a tilde (~) are probabilities, assigned in xr_logic.script's parse_infop?() functions. They are compared against a random number from 1 to 100 in pick_section_from_condlist() -- if less than the random number, the following conditions are not checked.

So a 25 would imply a one-in-four chance.
  05:22:19  26 May 2008
profilee-mailreply Message URLTo the Top
Don Reba
Bishop and Councilor of War
(Moderator)

 

 
On forum: 12/04/2002
Messages: 11607

---QUOTATION---
I don't know about the ambiguous conditional statements. It might be an error; could you post the specific example or examples, Don Reba?
---END QUOTATION---


Interesting. I tried to find clearly ambiguous examples, such as my made-up scenario, but failed. At the same time, there does not seem to be a rule against it. You have incomplete conditionals in then branches, incomplete conditionals in else branches. This is just asking for trouble. Here are some examples:

• {-gar_free_pass}backoff@{-gar_free_pass}gar_dolg_blokpost
• {=rostok_dist_to_actor_le(15)} remark@agr_factory_defence_waiting_stalker1, {+agr_help_krot_start} remark@agr_factory_defence_waiting_stalker1

Yet, something prevents them from writing:

• {+a} {+b} 1, 2

This is all highly confusing. It is like they write what they feel like, then fix whatever causes errors. I pray this is not actually the case.

---QUOTATION---
The numbers preceded by a tilde (~) are probabilities, assigned in xr_logic.script's parse_infop?() functions. They are compared against a random number from 1 to 100 in pick_section_from_condlist() -- if less than the random number, the following conditions are not checked.

So a 25 would imply a one-in-four chance.
---END QUOTATION---


At least this makes total sense now. Thanks!
  14:25:23  27 May 2008
profilee-mailreply Message URLTo the Top
Don Reba
Bishop and Councilor of War
(Moderator)

 

 
On forum: 12/04/2002
 

Message edited by:
Don Reba
05/27/2008 17:41:58
Messages: 11607
I have just uploaded the third release and updated the first post. Version 0.3 fully understands conditional expressions. Try checking config\misc\gulag_tasks.ltx.

The amiguity in conditional expressions was trivially solved using single-token backtracking. My apologies to GSC for doubting the Ltx grammar, which now looks pretty succinct.

One more question. What do double "@" signs mean? Here is an exert from config\misc\gulag_bar.ltx:

[logic@bar_visitors_arena_1]
active = walker@@bar_visitors_arena_1

[walker@@bar_visitors_arena_1]
path_walk = arena_walk_1
path_look = arena_look_1
soundgroup = bar_visitors_arena_1
danger = danger@bar_inside
sound_idle = state
  17:36:34  27 May 2008
profilee-mailreply Message URLTo the Top
Cpt. Borovich
Senior Resident
 

 
On forum: 09/02/2007
 

Message edited by:
Cpt. Borovich
05/27/2008 17:37:04
Messages: 460
Protection?..

Just a guess for that @@
Like escaping with \ if the char is special..

Ok.. Haven't said anything.. No slapping..
--
Cpt. Borovich
  23:27:44  27 May 2008
profilee-mailreply Message URLTo the Top
NatVac
Senior Resident
 

 
On forum: 06/15/2007
Messages: 4263
I was in the middle of posting this several hours ago, but storms in the area took down my Internet connection for a few hours.

I don't think the double "@" signs mean anything significant, other than a cut-n-paste programming technique or a typo that reproduced after its own kind (here, two wrongs do make a right).

I think of the first "@" sign as a delimiter to separate the scheme from the identifier text which is used to make the scheme label unique.

Re:
• {-gar_free_pass}backoff@{-gar_free_pass}gar_dolg_blokpost
• {=rostok_dist_to_actor_le(15)} remark@agr_factory_defence_waiting_stalker1, {+agr_help_krot_start} remark@agr_factory_defence_waiting_stalker1

I have no idea about the first. It sounds redundant, unless they are using the conditional statement (as is or evaluated) as part of a label. (I've often found that clever programming tricks are their own punishment. It doesn't stop me, though. )

The second is two separate conditional checks. If the actor is within 15 meters of the NPC or zone, switch (branch) to the [remark@agr_factory_defence_waiting_stalker1] scheme instance. If the first condition is not met, the second is checked: If you have the info_portion agr_help_krot_start, switch to the same scheme instance.
  02:05:15  28 May 2008
profilee-mailreply Message URLTo the Top
Don Reba
Bishop and Councilor of War
(Moderator)

 

 
On forum: 12/04/2002
Messages: 11607
Alright. Thanks. It remains to be decided what to do with these double ats. Right now they are treated as errors. Should they be considered equivalent to single ones, or should they be kept doubled? It depends on what effect they have on other scripts, if any.
  15:29:42  1 June 2008
profilee-mailreply Message URLTo the Top
Don Reba
Bishop and Councilor of War
(Moderator)

 

 
On forum: 12/04/2002
 

Message edited by:
Don Reba
06/01/2008 18:11:49
Messages: 11607
Version 0.4 was uploaded, and the first post was updated with it. The new version prints better error messages, generates fewer false alarms, contains a few improvements to the GUI, and recognizes command line switches. The syntax is:
 
LtxChecker.exe [ /i:<input path> ] [ /o:<output path> ] [ /e:<errors path> ]
 
If an input path and an errors path are set, the program will not display a GUI, but instead record the errors into the given file.
 
 
Again, it would be useful to have more examples of incorrectly checked scripts here. Even if I don't implement something right away, still, keep 'em coming. The result could be useful for many people.
Incorrectly checked scripts can be of two kinds:
 
• in which there are errors the checker does not detect
• that are correct, but are marked as errors
 
 
I ran the checker on all top level ltx scrips. There seems to be heaps of real errors. To name just a few:
 
• Missed comma.
config\task_manager.ltx (1463)
reward_relation = dolg, -100, freedom +150
 
• Double "+".
config\task_manager.ltx (1487)
init_condition = {+mil_leader_quest2_complete =actor_on_level(l07_military) =gulag_state(mil_bandit:1)}, {++mil_leader_quest2_failed =actor_on_level(l07_military) =gulag_state(mil_bandit:1)}
 
• Missing section name in first condition. If I understood the script correctly, this could cause a crash.
config\task_manager.ltx (1504)
init_condition = {+mil_fblockpost_quest_complete =actor_on_level(l07_military) =gulag_state(mil_monster:1)}, {+mil_fblockpost_quest_fail =actor_on_level(l07_military) =gulag_state(mil_monster:1)}
 
• Missing symbol before npc_rank.
config\treasure_manager.ltx (318)
condlist = {npc_rank(novice)} 3
 
• Double "=".
config\treasure_manager.ltx (1907)
items = = af_fuzz_kolobok, ammo_m209, 5
  23:37:06  1 June 2008
profilee-mailreply Message URLTo the Top
NatVac
Senior Resident
 

 
On forum: 06/15/2007
Messages: 4263

---QUOTATION---
Version 0.4 was uploaded, and the first post was updated with it. The new version prints better error messages, generates fewer false alarms, contains a few improvements to the GUI, and recognizes command line switches.

<snip>

Again, it would be useful to have more examples of incorrectly checked scripts here. Even if I don't implement something right away, still, keep 'em coming. The result could be useful for many people.
Incorrectly checked scripts can be of two kinds:

• in which there are errors the checker does not detect
• that are correct, but are marked as errors


I ran the checker on all top level ltx scrips. There seems to be heaps of real errors. To name just a few:

• Missed comma.
configtask_manager.ltx (1463)
reward_relation = dolg, -100, freedom 150

• Double "+".
configtask_manager.ltx (1487)
init_condition = {+mil_leader_quest2_complete =actor_on_level(l07_military) =gulag_state(mil_bandit:1)}, {++mil_leader_quest2_failed =actor_on_level(l07_military) =gulag_state(mil_bandit:1)}

• Missing section name in first condition. If I understood the script correctly, this could cause a crash.
configtask_manager.ltx (1504)
init_condition = { mil_fblockpost_quest_complete =actor_on_level(l07_military) =gulag_state(mil_monster:1)}, { mil_fblockpost_quest_fail =actor_on_level(l07_military) =gulag_state(mil_monster:1)}

• Missing symbol before npc_rank.
configtreasure_manager.ltx (318)
condlist = {npc_rank(novice)} 3

• Double "=".
configtreasure_manager.ltx (1907)
items = = af_fuzz_kolobok, ammo_m209, 5
---END QUOTATION---


That's a nice proof of the program's value. With one run of the program, you've found more than we've seen reported over the last year.

Re: The task_manager.ltx errors: • Missing section name in first condition -- I'm not sure what you mean here. There are no section references in any of the task manager conditions that I know about.

The init_condition indicates that this is an autoquest, given when the condition is met. Here, there are two conditions, both requiring the actor to be in Army Warehouses with at least one mutant threatening the Barrier. One condition also requires that the actor has already successfully defended the border against the Monolith, while the other requires the failed attempt at same.*

There can be a condlist for both tasks and secrets, but the secret condlist expects a number to indicate the quantity of lottery balls with that secret to be put into the secret lottery bowl -- if the condition is met. Non-autoquest tasks depend on the prior value and availability of the target, so there is no value after the condition.

The interesting thing about the errors in treasure_manager.ltx is that they do not keep those secrets from being given.

There are also errors that will still pass syntax checking, like [esc_secret_thief] -- valid syntax, but it is probably a cut-n-paste typo: condlist = {=actor_on_level(l01_escape) =npc_rank(experienced)} 1, {=actor_on_level(l01_escape) =npc_rank(experienced)} 2

_________
*I would have preferred a single test here, like mil_fblockpost_quest_done, without respect to success or failure.
  03:58:28  2 June 2008
profilee-mailreply Message URLTo the Top
Don Reba
Bishop and Councilor of War
(Moderator)

 

 
On forum: 12/04/2002
 

Message edited by:
Don Reba
06/03/2008 0:21:19
Messages: 11607

---QUOTATION---
Re: The task_manager.ltx errors: • Missing section name in first condition -- I'm not sure what you mean here. There are no section references in any of the task manager conditions that I know about.
---END QUOTATION---


Below is the code for the function from xr_logic.script that parses the condition list. As you can see, it simply separates it into comma-delimited parts, removes the condition lists to check and to set, then treats the remains as a section name. If the result is empty, it calls abort_syntax_error_in_cond. Following this reasoning, the checker complains about condition lists starting with info-portions in figure brackets immediately followed by a comma.
 
function parse_condlist(npc, section, field, src)
        local lst = {}
 
        local at, to, infop_check_lst, remainings, infop_set_lst, newsect
 
 
        local n = 1
        for fld in string.gfind(src, "%s*([^,]+)%s*") do
                lst[n] = {}
 
                at, to, infop_check_lst = string.find(fld, "{%s*(.*)%s*}")
                if infop_check_lst then
 
                        remainings = string.sub(fld, 1, at - 1) .. string.sub(fld, to + 1)
                else
                        remainings = fld
                end
 
                at, to, infop_set_lst = string.find(remainings, "%%%s*(.*)%s*%%")
                if infop_set_lst then
                        newsect = string.sub(remainings, 1, at - 1) .. string.sub(remainings, to + 1)
                else
                        newsect = remainings
                end
 
                at, to, newsect = string.find(newsect, "%s*(.*)%s*")
                if not newsect then
                        abort_syntax_error_in_cond(npc, section, field)
                end
 
                lst[n].section = newsect
 
                lst[n].infop_check = {}
                parse_infop(lst[n].infop_check, infop_check_lst)
 
                lst[n].infop_set = {}
                parse_infop(lst[n].infop_set, infop_set_lst)
 
                n = n + 1
        end
 
        return lst
end
  08:29:15  2 June 2008
profilee-mailreply Message URLTo the Top
NatVac
Senior Resident
 

 
On forum: 06/15/2007
Messages: 4263
Ah, but newsect at that point is an empty string (returned as the capture of all characters between spaces, if I interpret the regular expression correctly), and in Lua even a numeric zero result is considered a true in logical comparisons. Only a boolean false or nil would cause that abort_syntax_error_in_cond() function to be called.

That may be a bug in the sense that it is not doing what it was intended to do, but a developer at GSC might have said, "Oh, look, a function to make my task management parsing easier!" and it worked without complaining...
  11:14:29  2 June 2008
profilee-mailreply Message URLTo the Top
Don Reba
Bishop and Councilor of War
(Moderator)

 

 
On forum: 12/04/2002
Messages: 11607
Oh, right. I guess, newsect would be nil if the expression was "%s*(.+)%s*". So, it is not actually a problem.
  14:40:50  6 June 2008
profilee-mailreply Message URLTo the Top
Don Reba
Bishop and Councilor of War
(Moderator)

 

 
On forum: 12/04/2002
 

Message edited by:
Don Reba
06/06/2008 16:03:21
Messages: 11607
New in version 0.5:
 
• detection of many more errors
• removal of known false alarms
• improved error messages for unrecognized symbols
• support for drag and drop of .txt files into the GUI for output
 
Also, I gathered all errors found in the script files of my US Steam 1.0005 game version. The first post has been updated with a link to the archive.
 
Question
 
What are the words after the section name below for? If they are interprted by a script, where can I find it?
 
• config\creatures\m_dog.ltx (287):
[m_dog_step_params] fwdleftleg fwdrightleg backrightleg backleftleg
 
Atrocious

---QUOTATION---
Yes, but it's an error. Variables in the trader files shouldn't contain such values. Something like that would be correct:

bandage = 3, 0.6

But I don't know if the bandage examples will cause the ltx stop working or if they just affect the bandages.
---END QUOTATION---


I have been thinking about this. It all depends on whether those lines are parsed by the engine or by a script. In the latter case, the script could be change to accept bandage = V as meaningful input.
  19:37:06  7 June 2008
profilee-mailreply Message URLTo the Top
NatVac
Senior Resident
 

 
On forum: 06/15/2007
Messages: 4263
Wow. Don Reba, please bring this tool to the attention of GSC! It might really be useful for Clear Sky as well.

The duplicate assignment entries are mainly wasting time and space (if not unintentionally changing values), but this error in job assignments is a recipe for trouble. For an example see the duplicate "on_signal" assignments for [walker11@mil_dolg_skull_attack] in gulag_mil_dolg.ltx.

Other errors like "no viable alternative" reveal either dev typos or corrupted database files, with possibly cut-n-paste and/or find/replace duplication of these typos like "ignore_ distance_sound" and "ignore_ distance_corpse".

We have found a few of these over the past year, but your compilation has tripled the number of errors that need correction. There may be some cases where the broken code is what made the NPC behave better (e.g., Cordon mercs are not supposed to respond to sound beyond 10 meters?), but in the main there are quite a few non-working parts to NPC and mutant behavior.

An example of this non-working stuff is the game_relations.ltx find: a missing comma keeps the NPCs from reacting to the tushkano. Now I find that m_flesh.ltx file has a similar missing comma, and I've only started looking through this.

And there's a lot of evidence of attributes not used (like the [trader]'s "supplies" line, or even whole files not used.

As to the stuff following [m_dog_step_params]: I think it might have been meant to be a comment section for the values underneath. It's the same kind of thing for [m_*_step_params] in m_poltergeist.ltx and m_pseudodog.ltx.

Again, thank you for doing this for us, Don Reba. It adds to the work to be done, but this means fewer problems in the future.
  23:57:52  8 June 2008
profilee-mailreply Message URLTo the Top
Don Reba
Bishop and Councilor of War
(Moderator)

 

 
On forum: 12/04/2002
Messages: 11607
Thanks for your help. I will see if Clear Sky can benefit from this. Last time I talked to the lead programmer, I got the impression that they did not change anything in their approach to scripting.

Also, I used the knowledge I gained to build a new tool - "Ltx Diff":

https://www.gsc-game.com/main.php?t=community&s=forums&s_game_type=xr&thm_page=1&thm_id=14836&sec_id=16
  12:18:17  9 June 2008
profilee-mailreply Message URLTo the Top
Atrocious
Senior Resident
 

 
On forum: 04/01/2008
 

Message edited by:
Atrocious
06/09/2008 12:36:02
Messages: 285

---QUOTATION---
In the latter case, the script could be change to accept bandage = V as meaningful input.
---END QUOTATION---



But it shouldn't. It is not meaningful. It is an error I've found, which someone left in an trader ltx.

I just made some tests:
bandage = V
Is not a critical error. It just f**** up the trader pricing for the item or makes the item disappear from the trader (depending on the section where it's put).

bandage V
Can be a critical error, because it can lock up the trader. For example when I put it into [supplies_start] Sidorovich didn't talk to me anymore.
  04:14:37  10 June 2008
profilee-mailreply Message URLTo the Top
Don Reba
Bishop and Councilor of War
(Moderator)

 

 
On forum: 12/04/2002
 

Message edited by:
Don Reba
06/10/2008 5:06:34
Messages: 11607
New in version 0.6

• trader file format check
• exact line numbers in all error messages
• removal of error messages caused by irrelevant words after section titles
• removal of error messages coming from within duplicate sections

The error compilation has also been updated.

Question

Are section names case-sensitive?

Atrocious

Alright, you convinced me. I added type analysis to the tool. It now checks trader files. Here is the rule it uses. Let me know if you think it can be improved.

if file name starts with "trade_"
and section name is not "trader"
        declarations look like "value"
        assignments look like "value = number, number"

However, I cannot detect "bandage V" as an error, because the Ltx format allows spaces in variable names. In effect, it is equivalent to "bandage V ;NO TRADE". I think it locks up the trader, not because the format is incorrect, but because the item "bandage V" does not exist.
  11:54:38  10 June 2008
profilee-mailreply Message URLTo the Top
Atrocious
Senior Resident
 

 
On forum: 04/01/2008
Messages: 285

---QUOTATION---

Alright, you convinced me. I added type analysis to the tool. It now checks trader files. Here is the rule it uses. Let me know if you think it can be improved.

if file name starts with "trade_"
and section name is not "trader"
declarations look like "value"
assignments look like "value = number, number"
---END QUOTATION---


Looking good to me.

Can't you prevent parsing a variable name with space(es) and additionally make something like this:
If "value" then next char after space(es) has to be = or ;
?

Because I don't know a single variable in the trader files (or whole stalker) that uses spaces.

Or you could search all other ltx for section names that are used by the trader items, to prevent usage of non existing items. Okay that would be probably too much.

It isn't a big issue to me. I used to check trader files by myself and usually found all errors.


---QUOTATION---

However, I cannot detect "bandage V" as an error, because the Ltx format allows spaces in variable names. In effect, it is equivalent to "bandage V ;NO TRADE". I think it locks up the trader, not because the format is incorrect, but because the item "bandage V" does not exist.
---END QUOTATION---


Something like that.

Thanx for your work!
  11:58:22  10 June 2008
profilee-mailreply Message URLTo the Top
Don Reba
Bishop and Councilor of War
(Moderator)

 

 
On forum: 12/04/2002
 

Message edited by:
Don Reba
06/10/2008 12:05:10
Messages: 11607
Hey, just got an idea. I could simply check if the variable name contains spaces. Seems obvious, in retrospect.
 
Each word should be at least 3 characters long.
Search:    
Search conditions:    - spaces as AND    - spaces as OR   
 
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
 

All short dates are in Month-Day-Year format.


 

Copyright © 1995-2019 GSC Game World. All rights reserved.
This site is best viewed in Internet Explorer 4.xx and up and Javascript enabled. Webmaster.
Opera Software products are not supported.
If any problem concerning the site functioning under Opera Software appears apply
to Opera Software technical support service.