|
Post by finlander on Jun 10, 2010 17:14:53 GMT 1
Hello fellow spaceboys i am converting a huge chapter of the ww2 for kursk and i want every unit to be in the right year and so on.. my problem is that the core units in one map are out of place(year),i tried to change them normally but it didnt help..so they seem to be scripted. is there any way i can change them from the editor???
|
|
|
Post by Major Pain on Jun 10, 2010 18:13:56 GMT 1
It is scripted. You have to add the desired units into the Script.lua in the chapter.
It looks like this: (This is from RT Huskey)
function EnterChapter( strChapterName ) EnableMission("scenarios\\scenariomissions\\allies\\gela\\1"); checks the mission
end;
function MissionFinished( strMissionName ) local bScenario = GetIGlobalVar("Mission.scenarios\\scenariomissions\\allies\\palermo\\1.Finished", 0);
if ( strMissionName == "scenarios\scenariomissions\allies\gela\1") then
AddBaseUpgrade( "M7_Priest_USA" ); this unit is added to the base upgrades for the mission
AddBaseUpgrade( "M13_GMC_USA" ); this unit is added to the base upgrades for the mission
EnableMission("scenarios\\scenariomissions\\allies\\palermo\\1"); next mission end;
if ( strMissionName == "scenarios\scenariomissions\allies\palermo\1") then EnableMission("scenarios\\scenariomissions\\allies\\messina\\1"); AddNewSlot ("76mm_M1A1_USA"); this unit is added to the core units for the mission
--------------------------spieler hat jetzt 6 ari einh und 4 pz einh--------------------- end;
if ( strMissionName == "scenarios\scenariomissions\allies\messina\1") then EnableChapter("scenarios\\chapters\\allies\\theinvasion\\1");
----medal AddMedal ("Medals\\Allies\\BronzeStar\\1", 1); ----- after messina Bronzestar
end; end;
-------------This is not the entire script-------------
|
|
|
Post by finlander on Jun 10, 2010 20:28:54 GMT 1
thanks major, ill give it a try..
|
|
|
Post by finlander on Jun 10, 2010 21:35:58 GMT 1
funny thing.. in the script it says pz iv ausf D, but in the game its ausf F1
|
|
|
Post by finlander on Jun 11, 2010 14:38:27 GMT 1
ok, so i tried to change the unit but it crashes when reaching the upgrade point i even spelled the units name the same as in the map editor.. any clues?
|
|
|
Post by Jagged Steel on Jun 11, 2010 14:45:45 GMT 1
Is it possible that the script needs the file name, rather than the "unit name" which is what appears in the editor?
|
|
|
Post by finlander on Jun 11, 2010 14:58:06 GMT 1
sorry ,dont know what you mean by file name?? in the chapter script lua it says pz_kpfw_iv_ausf_D but in the chapter upgrades(in the game), it has changed to ausf f1(kursk unit) this is a conversion from vanilla, so would that ghange anything?? dont think so..
|
|
|
Post by finlander on Jun 11, 2010 15:13:38 GMT 1
i just succesfully changed the unit to G and its a original vanilla unit. is it so that i cant use any IF2.2 units as a core units
|
|
|
Post by Jagged Steel on Jun 11, 2010 16:33:44 GMT 1
In BK the unit name that appears in the editor and the game is different (in most cases) than the file(folder)name. The file name is the label on the actual folder that contains the unit, and the "game name" is defined in the 1.xml for the unit. My knowledge of scripting is rather limited, but I am pretty sure that the script would require the name that appears on the folder of the unit, otherwise the game engine would not know where to look . Here is a btter explanation: This is a screen of the 1.xml from a special pz IV from the Panzerwaffen Mod. The File or Folder name ("A") is "pz_iv_ausf_d_pgrau" and is unique to this unit, and the "game name" is specified as the "Keyname" ("B") and does not have to be unique. In this case, the special pz IV is simply painted gray, and the name in the game and editor will appear the same as the original pz IV. If the Mod your using is in .PAK form you may have to extract it to get the actual folder name, but I think there is a way to trace the folder structure in the editor as well.
|
|
|
Post by Jagged Steel on Jun 11, 2010 17:09:26 GMT 1
Update: You can get the Folder Name by hovering your mouse over the desired unit in the Objects menu in the Editor and Right clicking on it to bring up the "properties" box. You can see in this screen from the editor I have selected the original PZIV D , and it shows the Game Name on the Top("A") and the "Folder Name"("B") on the bottom. Try doing this for your desired core units, and use the "Folder Name" instead of the Game Name in the script. Be sure to just use the folder name(after the last slash), and not the entire path in the script.
|
|
|
Post by finlander on Jun 11, 2010 17:31:48 GMT 1
No sorry, didnt seem to do it still crashes...
|
|
|
Post by Jagged Steel on Jun 11, 2010 17:42:27 GMT 1
There may be another problem then. I looked at a couple of chapter scripts and the names used for core units are definitely the Folder name, not the Game name. Somebody better versed in .lua scripting and chapter creation might know more about this (where is BB?).
Edit to add: Are you certain that the script itself runs correctly? Try using the "GO" function in the "Tools" menu in your Scite editor to see if there is a problem with the script itself. I stumbled with scripts for years before this tool was recently pointed out to me.
|
|
bb
General
Blitzkrieg junkie (tried to quit several times).
Posts: 1,361
|
Post by bb on Jun 11, 2010 18:44:12 GMT 1
Dont need panic guys. I'm still here, LOL.
Well, here is the solution, as Pajeu told me a long time ago: "You must use the name that appear in the Objects.xml file or Mobjects.xml if there is "_" or "-" or still space-bar you must copy like that. The unit name in the Objects.xml file is not always the same in the unit folder".
This mean you need open the modobjects.xml of The Iron Frost mod or MK and look for the correct name of the units. Remember there is a lot of IronFrost versions and meaby this is causing your crashes.
To check the problem with PzIVD open your map editor and see if this type of tank is there. Meaby this unit was replaced for PZIV F in one of the Iron Frost versions.
|
|
|
Post by Jagged Steel on Jun 11, 2010 19:06:15 GMT 1
Ahhh I see. You need the name specified in the ModObjects.xml, which may or may not be the same as the folder of the unit and may or may not be the same as the "game name"(Keyname). I have a fair amount of Mod compiling experience, I should have known this would be the best way to find the proper name that the game engine uses. In the chapter scripts I had looked at the unit names specified in the scripts - (the "unit name" specified in the Modobjects.xml) were the same as the file name.
|
|
|
Post by Major Pain on Jun 11, 2010 19:56:05 GMT 1
bb is correct... you must use the name in the objects.xml or the modobjects.xml. These do not always have the same as the folder name.
The game engine stores the unit name in a database in memory. It only uses the path to locate the unit for loading into the database.
The database has a lookup reference for each unit. They are catagorized by the lookup name and that units number within the file. All of the units parameters are stored in its own data file in binary form.
You cannot manipulate this file inside the editor or game. You can only get to it after you have loaded the editor or game and exit. Then you have to use DOS or C++ to get to it; not that there is any point or reason to do so. You can manipulate the code by front loading. I only reference the database to see what is going on or to determine how it handles the data.
But again... the unit name assigned in the objects.xml is the key.
NOTES:
The game only uses the name.txt inside the game engine and this is not the unit file name... unless someone did it on purpose.
The file name in the units 1.xml is only the file folder that the original unit was built into (exported) when it was finalized in the Resource Editor.
You can eliminate all of the HISTORY in the unit 1.xml file and it will not affect the unit in the game.
You can also remove the unit name in the parameters without any ill effect.
The only thing that the game cares about in the 1.xml is the data below the History beginning at RPG.
Hope this helps...
|
|