PDA

View Full Version : [SHARE] NPC AI Checker


vex
30.10.2006, 11:57
Reads ai.obj, does simple check of syntax and loads parameters of classes. Then reads npcdata.txt and takes from a npc_ai field ai-parameters Checks each one, on presence at a corresponding class in ai.obj
More functioanality will be added in future version.

Of course you need to save ai.obj and npcdata.txt in the same forder in ansi format!

Start chk_ai.bat, wait a time and results of checking see in result.txt

Tips:
ERROR(123456) 123456 - line number in ai.obj contain error
WARN(123456) - the same

------------
v2: Checks if npc_ai class exists. Print only errors (specially for HF)

pass: for_pp

Вложения из исходного сообщения (сами файлы в копии отсутствуют):
npcaichk.rar — 78057 байт
npcaichk_v2.rar — 77993 байт

HF
30.10.2006, 12:01
Can tell me more about work this tool? What checking? Have Class for Npc in Ai.obj?

And... what can i do for take password to archive? Pray?

vex
30.10.2006, 12:07
sorri )
see first post

vex
30.10.2006, 12:11
Can tell me more about work this tool? What checking? Have Class for Npc in Ai.obj?


Not so, just if class not exist in ai.obj all paramets in this class will be threat as ERR. I thinks it is not hard to add this check - 30 sec needed.

HF
30.10.2006, 12:13
sorri )
see first post
Tell me, please, for examples - what do This Tool?

How understund this?

Checking NPC: [range_golem_ep_30], AI class: range_golem_ep_30 ...
DDMagic ERR
Checking NPC: [dark_panther_ep_01], AI class: dark_panther_ep_01 ...

DDMagic ERR
what is it? Not exist? Not exist in parent class or in main class?

Checking NPC: [dark_panther_ep_01], AI class: dark_panther_ep_01 ...
what is it? it good or not?

vex
30.10.2006, 12:18
DDMagic ERR
what is it? Not exist? Not exist in parent class or in main class?


It is checks all hierarchy, so if ERR then it is not found in any class in hierarchy


Checking NPC: [dark_panther_ep_01], AI class: dark_panther_ep_01 ...
what is it? it good or not?


This mean thats NPC not have any parametes in npc_ai just:
npc_ai={[dark_panther_ep_01 ]}

vex
30.10.2006, 12:24
Additional info: tool have commented code for handlers body checks on push_parameter XXXXX. It check if this parameter present in class of this handler or any of parents

If you have lot of CPU resources - uncomment this in chk_ai.awk:
# val=get_param_value(class_name, $2)
# if (val=="") val="ERR"
# if (/^[:space:]*push_parameter /) print class_name, $2, val

HF
30.10.2006, 12:36
It is checks all hierarchy, so if ERR then it is not found in any class in hierarchy
...

class 1 range_golem_ep_30 : summon_siege_tank

class 1 summon_siege_tank : default_npc
parameter_define_begin
int DDMagic 1082881

What next? Your tool show 3Mb result for my good AI.obj.
It's only last npc what i checked.
:)

vex
30.10.2006, 12:46
have no errors while loading ai.obj ?
another problem may be if parameter_define_begin not start from begining of line... may be spaces before. Regexp sounds like: /^parameter_define_begin/ try change to /^[:space:]*parameter_define_begin/

vex
30.10.2006, 12:49
also problem with loading classes may cause if no spaces before and/or after ":" in class header

HF
30.10.2006, 12:58
I found problem. AI must be in ANSI too. Baaddd.... :puke:

Next...

Checking NPC: [range_golem_ep_30], AI class: range_golem_ep_30 ...
DDMagic OK
Checking NPC: [dark_panther_ep_01], AI class: dark_panther_ep_01 ...

[dark_panther_ep_01] again whitout OK or ERR. Are you have limit to longer of line? :)

Next...

Make report only to BAD class, because i cant find errors in my big file. Or make guide for all reports (I mean documentation - "How find error in log file?" :) )

vex
30.10.2006, 13:08
hehe
of course all files in ansi

to found errors just Ctrl-F -> ERR or WARN and check Match case!

vex
30.10.2006, 13:26
let it be )
v2: checks if npc_ai class exist, print only errors

palace
30.10.2006, 22:31
Thank for share

Sauron
30.10.2006, 23:28
thx for sharing

vopros
31.10.2006, 00:21
Loading ai.obj...
Finished loading ai.obj
Loading npcdata...
Checking NPC: [ g r e m l i n ] , AI class: ...
Checking NPC: [ r a b b i t ] , AI class: ...
Checking NPC: [ g o b l i n ] , AI class: ...

Error?

thx and thx for sharing

Sauron
31.10.2006, 02:24
NPC: [r14_roomboss_teleport], AI class: r14_roomboss_teleport parameter: TeleportEffect ERR

that skill is only for visual effect but that npc doesn't teleports itself neither players at least not in our ai, any idea?

vex
31.10.2006, 15:11
Loading ai.obj...
Finished loading ai.obj
Loading npcdata...
Checking NPC: [ g r e m l i n ] , AI class: ...
Checking NPC: [ r a b b i t ] , AI class: ...
Checking NPC: [ g o b l i n ] , AI class: ...

Error?

thx and thx for sharing

May be npcdata not in ANSI format???

vex
31.10.2006, 15:21
NPC: [r14_roomboss_teleport], AI class: r14_roomboss_teleport parameter: TeleportEffect ERR

that skill is only for visual effect but that npc doesn't teleports itself neither players at least not in our ai, any idea?

May be need to remove TeleportEffect from this npc in npcdata, if it is not needed. I dont know what does it mean at all. It is just cheker - it see exist or not. Then you have to decise what to do by self ))