PDA

View Full Version : XML file code: Anyone proficient with it?



FiLTHY_SNiPER
02-23-2008, 03:33 PM
I'm trying to modify some XML code for the game Colin Mcrae: DiRT, but I must be making some kind of mistake somewhere and it's driving me absolutely nuts. I've been trying to get something working for the past 4 hours as well as 3 hours yesterday but to no avail.

Anyways, if any of you guys know coding pretty well and are interested in helping me, please post here and I will add all the necessary info/coding in order for you to get a grasp on the issue.

[W33T] Joker
02-24-2008, 01:37 PM
i have done XML using C#..i usually go to this website for any problem i have with XML..i need to refresh my mind on it..what seems to be problem?

helpful website
http://www.w3schools.com/xml/default.asp

FiLTHY_SNiPER
02-24-2008, 07:18 PM
Here Agent, I'll direct you to this thread, so I don't have to type it all out again (my name there is "Brits"):

http://community.codemasters.com/forum/showthread.php?p=3718775#post3718775

Do you happen to own DiRT, or have access to a copy of it?

[W33T] Joker
02-25-2008, 03:01 PM
I don't have DiRT..never got interested in it but any way ok i read it and looks like you are trying to get some camera to follow car right? you update one of the camera.xml file whatever its called..by looking at that file...you are changing parameters and paths and its value..so what happens when you upload that file..? could you give me like error message or what is exactly happens

FiLTHY_SNiPER
02-25-2008, 03:51 PM
K gimme a sec, I'm whippin something up for ya

FiLTHY_SNiPER
02-25-2008, 08:01 PM
K let me break it down to you:

I've included 3 XML files in a RAR and uploaded it for you. Please download this file:

http://www.speedyshare.com/907415581.html

This includes a) replay_camera_config.xml, b) Copy of Copy of replay_camera_config.xml and c) cameras.xml.

a) is my modified version of the replay camera file. A replay camera file is located in every single directory for every single track.. but the important thing to know is that it's structure of coding is different from the "cameras.xml" structure. The types are different and one does not work in the other (ie. Camera vs. View)

b) backup of the replay camera config so that I don't lose the original. Contains a lot of info on how the cameras work but I'm still very lost when modifying it.

c) a camera views file that is located in every car folder. It tells the game which views to use while driving in a race (!! has nothing to do with replay cameras, except for when the replay sparingly uses the same cameras as in the cameras.xml file !!)


So, what I was trying to do was modify the replay_camera_config.xml files so that it only used ONE camera and that camera was one that always followed the car. I want to make it so the camera follows the car from a bird's eye perspective by modifying for exampled the chase_far camera so that it's further back, higher up, and to the side (ie. change x,y,z values).
Thing is, adding the code that's supposedly for the chase camera (from either b) or c) does not work. I'm not sure why. I'm not sure how the camera settings for chase_far in replay_camera_config.xml relate to the settings for it as a view in the cameras.xml file. It's driving me ****ING CRAZY.

SO, if you could at least take a look and see if you discover any way to get even the chase camera working that would be awesome.

NOTE: While in replay mode, there are a bunch of different camera views. They include ALL the views that are seen in the cameras.xml file as well as a single option for "Television camera" which switches from camera to camera in tons of different views. The "Television Camera" values are the ones located in the replay_camera_config files (or in the case of the rar, the backup file). So, I want to take that replay config, delete all the cameras and see if I can simply add one that is a chase view and is modifiable in terms of position around the car.

NOTE: I've also included a bunch of notes in the a) XML file to make things a bit clearer (maybe).

FINAL NOTE: Oh yah, I know making the replay camera a mounted or chase camera is possible because a guy on the Codemasters forum already did it (check his post in that thread above, although it doesnt contain too much info). I PMed him, but he's been inactive for months on that board.

Again, any help would be greatly appreciated.


PS. I'll check out that link you posted about the XML help site.

FiLTHY_SNiPER
02-26-2008, 11:43 AM
UPDATE

I got the bird's eye chase camera view working for one view. I went into the cameras.xml file (of the Celica GT4, they all have their own cameras.xml file) and changed a view to look like this:

<View type="Chase" ident="chase_top_down_far_90" hidden="false">
<Parameter name="position" type="vector3" x="50.0000" y="50.0" z="0.0" />
</View>


It was hidden before, so I made it visible (ie. usable in-game). Thing is, it works, although if while watching, any tree gets in the line of sight of the car, the camera jolts in front of it so that you can see the car, rather than staying at one spot the whole time (just like Fallout_04 says in the Codemasters forum thread). I'm sure it has something to do with collision, occlusion, etc and I've been trying to find any hint of that in tons of different XML files but I can't. I deleted all the other parameters of the view (code above) as well, to see if that would fix it, but it doesn't.

Anyways, this revelation IS a step forward but it looks like shit when you're trying to watch because the camera keeps jumping forward to see the car.

BTW I've given up on the replay cameras config.. now that I've enabled this one view while playing, it's also enabled to view in replay so I can test it via there. It's actually better this way..

[W33T] Joker
02-26-2008, 05:17 PM
ok cool thats good news.

FiLTHY_SNiPER
02-26-2008, 09:18 PM
Well, apart from the fact that it zooms in like crazy cause there's trees everywhere... it still sucks :P I'm sure though, even if you took a look, it would be very hard for you to understand what's going wrong.