View Full Version : push_const converter
As good u know in c5 mobs id was changed, i made little tool to change that id in ai.obj, tool will make for u knew ai with changed push_const 10xxxxx (where 10xxxxx is npcid). I found 1 bad thing, in ai.obj is one more thing which uses push_const 10xxxxx format - fstrings, so u will need to marge your new ai with old and change ids of fstring manually or add new fstring ids to fstring.txt (i made tool for that too -fstring.pl). Tool is writed in perl so u'll need perl to use that.
p.s Before u use a tool make sure that (ai.obj/fstring.txt is in ANSI encoding and in same folder with tool).
I made quick test if new ai works, and server started with new ai, mobs were spawned, baium works (when takled with baium statue->wake up baium-> baium spawned) etc need more testing but have no time xD.
Update:
Ver 1.1 will change only npc's id so no need to worry about fstrings :P.
ver 1.2 will make a log file with some info about what was changed (line in ai.obj/npcname/c5id/c4id etc).
Вложения из исходного сообщения (сами файлы в копии отсутствуют):
AiIdConverter.rar — 11553 байт
AiIdConverter1.1.rar — 53346 байт
AiIdConverter1.2.rar — 50502 байт
McBigMac
09.08.2007, 19:47
it works on strings, not id's?
what's the point of this? i have changed baium id's, works with standard c4 ai.
hm... maybe, if in your ai was something what was checking id of mob and comparing it to something else this tool would be usefull for u :P (for example quest-or smth- which spawns mobs if that quest uses id from c4 data in c5 id of that mob is different so it should be changed in ai too).
p.s does quests for changing proffesion with standard c4 ai works for u too?
(in c5 server).
McBigMac
10.08.2007, 18:25
Yes, however, in interlude, the place of 3rd Quest Tablet's have moved due to fortresses.
which will require you to change the npcpos of the tablet's and the spawn loc in createprivate func's loc.
It's all strings, not id's.
Nothing has changed, in that way.
pretty much only direct script data movement, (also for other things).
Example:
push_event
push_const 704 // myself
add
fetch_i
push_const 1012544 <-------HERE
S3100. "pirates_zombie_captain_b"
push_string S3100
do i need to change that id? (it's npc id pirates_zombie_captain_b)
anyawy i'm not going to interlude but thx for info :). Players told me that they couldnt finish quest to change proffesion becouse npc (which they need to kill) was not spawning, same was with the quest for subclass (fate of whisper) when rb died the chest didnt spawn (chest of cabrio/kernon/golkonda etc), so i thought that there was something wrong in ai, and i was propably right becouse now chests spawn after kiling rb etc (maybe i did something else what fixed that but i dont know what ;D ).
ya all ids are changed in c5 which effects quests and fishing and stuff that uses ai to summon mobs
McBigMac
10.08.2007, 19:19
I have yet to see any of your claimed issues.
I see it pushed the pch, before the string, but in the end, it's the string it pushes before the call.
And if theres' an issue, go test just change the pch to something random and test on c4 :)
As i writed before, it solved my problems.
ai uses npcpch ids to summon the mobs which is why ai pch ids need to be changed
if u try running c5 with c5 ids and not changing anything but the npcdata you will have lots of problems
mcrabben7
11.08.2007, 10:11
I did it all by hand :P
McBigMac
11.08.2007, 10:20
kinda off topic, but now that were on the whole non c4 thing.
anyone know what map some of the tombs went to that disappeared from normal positions in c4/c5? :D
I did it all by hand :P
i'm to lazy to do things like that by hand :P.
McBigMac
11.08.2007, 20:00
i'm to lazy to do things like that by hand :P.
A good programmer is a lazy one.
or so wise people once said :-p
mcrabben7
11.08.2007, 23:53
The problem is, I didn't want to ruin fstrings, so I did an UltraEdit regular expressions search, and started replacing.
i writed about fstrings in first topic :P (made a tool to add changed fstring's id to fstring.txt but i'm not 100% sure if they will work well), now i need to fix 2 skills(backstab&glad/tyrant) and will be happy :D
php does the trick to :p
Perl does too, i fixed my tool now it change only npc's id.
I did it all by hand :P
Wow... that had to have taken a while.... You could regexp search for long enough numbers to where you might have to replace them, but still!
P.S.
Kation,
I'm more of a PHP person that perl (in fact I hardly know perl at all), but it seems that:
#setting ids for normal push_const (not npc)
for ($n = 1; $n <= 1019000; $n++) {
$ids[$n]=$n;
}
Could be more effeciently done by just doing this:
if(isset($ids[$tab[1]])) $tab[1]=$ids[$tab[1]];
Where that area is later on.... Then you wouldn't have to waste the memory and slight performance hit behind setting a million value array even if it is only integral values....
(P.S. I'm not sure if there's a function in Perl called isset, but that's what it's called in PHP, and surely there's something similar.)
i give a source everyone can make with that what he want to :P
updated to v1.2 ^^.