View Full Version : [Support] Generating an entitylist file for all ingame models
Kutuzof
04-20-2011, 02:41 PM
Hello,
I have written a script that finds all *.mdf files in HoN and generates an entitylist entry. Such as :
<entity angles="0.0000 0.0000 0.0000" index="0" model="/buildings\hellbourne\attack_tower\effects\death\mo del.mdf" name="" position="200 200 50.0000" scale="2.0000" seed="0" skin="default" team="0" type="Critter_Chiprel"></entity>
It incrementaly adjusts the x and y coordinates so that each is evenly spaced out. The idea is that I want to be able to generate a map with all possible models displayed.
My problem is that I don't know what I should enter in the type variable. If I use a specific value, such as Critter_Chiprel, then all entries disappear and a single entry with the correct Critter_Chiprel mdf entered.
What could I use a default value in type so that any old mdf will be accepted?
Thanks,
EDIT: It's working (http://imgur.com/Pe8aO) the entitylist file is here (http://pastebin.com/Mjjgy4rt). But it's killing my PC trying to hold all these in memory (http://imgur.com/3Vc6H). Either a couple of them are memory hogs or my PC is old again.
EDIT2: Here's (http://pastebin.com/Tdd7zUDn) the java code to generate the entitylist
Tafelpoot
04-21-2011, 04:51 AM
Hey, i'm really curious about your script.
When I edit my entitylist file, I only use the most important attributes. In most cases that is only the type and the position. They will always get the standard model defined in their entity file. This doesn't work for trees and scenery though.
For units and buildings, this is enough (index, position and type cannot be dropped):
<entity index="0" position="200 200 0" type="Critter_Chiprel"/>
But I didn't manage to apply alternate avatars by modifiers yet.
Now to your question, for Prop_Scenery it works. But you cannot select your stuff -.-
<entity index="0" position="200 200 0" model="/map/yourModel.mdf" type="Prop_Scenery"/>
I think you can make a dummy gadget entity, with
isselectable="true"
invisible="false"
It may not work when it takes model="" over your model defined in entitylist.
Kutuzof
04-21-2011, 11:15 AM
Now to your question, for Prop_Scenery it works. But you cannot select your stuff -.-
<entity index="0" position="200 200 0" model="/map/yourModel.mdf" type="Prop_Scenery"/>
Awesome, thanks I'll give that a try. I've found a couple of other errors I had but now I'll try this as well.
TBH it's not so much a script as it is an excel file. There is one spot where you need to dump all possible files names from the resource directory (with full path). Right now I do that by hand from the console. Then on another page the entitylist file is generated.
So far I haven't gotten it working the way I hoped but if I do I'll send it to you if you want it.
Tafelpoot
04-21-2011, 12:30 PM
you mean you copy 100s of file names by hand ? sounds painful ... :) .. I think you could extract the resources0.s2z to a normal folder, and use java or python to get a list with all files + path ( like "dir" in windows cmd or "ls" in linux). From that list it's easy to filter files with mdf extension.
edit : using WinRAR, with F3 you can search files "*.mdf". Furthermore you could use this (http://help.lockergnome.com/windows2/save-results-Explorer-search-txt--ftopict484514.html) to save the list with results
Oloko
04-21-2011, 12:47 PM
If you want I already have done some java code to search every .entity file in the resources0.s2z file to generate a xml file. I could use this code to generate the entitylist file for you if you want, or I can simply give you the code I have so that you can do it yourself.
I think a little map like this could be useful to people that create custom units/hero. The only thing that kind of suck is that you will only have the model without the .effects that sometime comes with it. So some models might not really look exactly like what you see in-game (especially for projectiles).
Kutuzof
04-21-2011, 02:29 PM
I'm not sure what's wrong. Here is an example entitylist entry that I'm using:
<entity angles="0.0000 0.0000 0.0000" index="0" model="/buildings/hellbourne/attack_tower/effects/death/model.mdf" name="" position="200 200 50.0000" scale="2.0000" seed="0" skin="default" team="0" type="Prop_Scenery"></entity>
or
<entity angles="0.0000 0.0000 0.0000" index="0" model="/world/river/model.mdf" name="" position="14025 6520 50.0000" scale="2.0000" seed="0" skin="default" team="0" type="Prop_Scenery"></entity>
I've got about 500 of those. After I open it in the editor and Save as... Then this is all that is left:
<?xml version="1.0" encoding="UTF-8"?>
<entitylist>
<entity angles="0.0000 0.0000 0.0000" index="0" model="/npcs/chiprel/character.mdf" name="" position="14025.0000 6520.0000 50.0000" scale="1.9800" seed="0" skin="default" team="0" type="Critter_Chiprel"></entity>
</entitylist>
I've attached my entity entries if any one else wants to try it.
Kutuzof
04-21-2011, 02:46 PM
I can simply give you the code I have so that you can do it yourself.
Yeah please. Where could you host it?
I think a little map like this could be useful to people that create custom units/hero. The only thing that kind of suck is that you will only have the model without the .effects that sometime comes with it. So some models might not really look exactly like what you see in-game (especially for projectiles).
The first map I made I just manually placed every single entity in that stupid drop down. I created duplicates so that I could set the alt-models and for some of the summoning powers.
All the model changes disappeared after I saved and reloaded.
There has got to be a base Show-Whatever-Model entity type or?
Oloko
04-21-2011, 05:37 PM
I only took a quick look at your file but I saw that all your entities have the same index (index="0"). You need a unique index for each entity instance. That's one other reason why doing it by hand is really a pain. :p
I can upload the code when I get home on pastebin (if you only want the code).
The first map I made I just manually placed every single entity in that stupid drop down. I created duplicates so that I could set the alt-models and for some of the summoning powers.
All the model changes disappeared after I saved and reloaded.
There has got to be a base Show-Whatever-Model entity type or?
If you added the actual entity and not a prop or something like that, it will not change the model. This is because every entity has a defined model in its entity file. So it will use the model in it's entity file rather than the one you set in the editor/entitylist.
Oloko
04-21-2011, 08:41 PM
I uploaded the java code on pastebin here (http://pastebin.com/UiPm4Ekd). There is pretty much only one thing to do and that is to change
outText += zipEntryName + "\n";
to the actual way you want it to be in the entitylist file.
If you need help on this or I can actually complete it for you if you want (since it would take less than 1 min to do) since I don't know if you have any java knowledge. Well I hope this will help you out.
Tafelpoot
04-22-2011, 04:21 AM
I think a little map like this could be useful to people that create custom units/hero. The only thing that kind of suck is that you will only have the model without the .effects that sometime comes with it. So some models might not really look exactly like what you see in-game (especially for projectiles).
Yeah this is true, stuff like behemoth's fissure is an invisible blocking gadget, with a crater and steam effect on top of it. Noticed this in SokoHoN.
Kutuzof
04-22-2011, 05:01 AM
If you need help on this or I can actually complete it for you if you want (since it would take less than 1 min to do) since I don't know if you have any java knowledge. Well I hope this will help you out.
No I should be able to finish this. Thanks a lot. I really could have done this as a java app from the beginning but getting a lot of this file I/O stuff done is always a pain in the ass. I haven't needed to work with java (outside of heavy frameworks) for a while, but this is perfect.
Thanks also for the tip about the index value. I noticed now that in my test file the index is incremental. Somehow I failed to notice that before.
Kutuzof
04-22-2011, 05:02 AM
Yeah this is true, stuff like behemoth's fissure is an invisible blocking gadget, with a crater and steam effect on top of it. Noticed this in SokoHoN.
If I just try to paint the model of behemoths fissure. Does that mean I'll get the crater or will I see an invisible marker which has the potential to create a crater?
Kutuzof
04-22-2011, 05:05 AM
This is because every entity has a defined model in its entity file. So it will use the model in it's entity file rather than the one you set in the editor/entitylist.
This is what I was afraid of. That I would need to know all the types and somehow get a type list instead of a *.mdf list. What about spell effects like Tundras minions? Do they also have types? Is there somewhere where all the types are defined? So far I haven't found a nice list anywhere by digging around in the resources.s2z file.
tojooko
04-22-2011, 05:44 AM
Well, I'm wondering that doesn't model="XXX" is used only in Map Editor? I mean I saw it only when I changed model for invisible objects like Neutral_Spawner etc. So imo type of object can be anything, becouse Map Editor will use model="XXX" to display?
Kutuzof
04-22-2011, 06:19 AM
Not if you just change it in the editor. Or at least not if the type is Critter_Chiprel.
Kutuzof
04-22-2011, 06:23 AM
There is pretty much only one thing to do and that is to change
outText += zipEntryName + "\n";
Here (http://pastebin.com/9Grs0tbp) is my updated version in Pastebin.
But I have no idea what I should pass to getModels(). I've tried pointing it at the extracted resources and I've extracted the resources locally and tried to find it that way. But I keep getting a FileNotFoundException.
Oloko
04-22-2011, 06:45 AM
Here (http://pastebin.com/9Grs0tbp) is my updated version in Pastebin.
But I have no idea what I should pass to getModels(). I've tried pointing it at the extracted resources and I've extracted the resources locally and tried to find it that way. But I keep getting a FileNotFoundException.
My bad, I totally forgot to mention about the path parameter. It's the path to your resources0.s2z file. you don't have to extract the file since the java code will open it and scan it.
For me it's: "D:\\Games\\Heroes of Newerth\\game\\resources0.s2z"