Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / String searching and replacing.

Author
Message
Ashy
19
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 14th Apr 2007 09:59
Hi guys, I need some help/advice on a program i'm making. I have this game see, and I downloaded a heap of third party mods for it but unfortuantly people like to make "over-the-top-kill-anything-one-shot" type mods. So what i usually do is just change the text files that come with them so they are more balanced with the original game, thus making it more fun. All i really need is the models so I have something different to shoot at.

So what i'm thinking is make a program, drop it in with all the mod files and it will just run through each file, change the appropriate fields (health, ammo, guns .etc) to what I want so the game is more balanced. Problem is, i'm not too sure how to locate the fields in the text files... I need to be able to search for an individual word on several lines, or something between brackets for example.

I've had a look through the forums and the code base. Found afew dbp examples that look like they might be what I want. I've tried converting them over to the GDK but the one i'm trying at the moment doesn't seem to return the results i'd expect. I'll keep at it, but any suggestions/examples would be appreaciated! Thanks.
James Bondo
18
Years of Service
User Offline
Joined: 12th Nov 2006
Location: Denmark
Posted: 14th Apr 2007 21:06
I know what you want, but its hard to explain.
Its even hard for me to understand after using it.
What you need is called "Regular Expressions", search for that for some documentation and examples.

Make an application that looks in all the files for strings that match some regular expressions you make and replacing the found values with whatever you want.

In C# you will need the Regex class from the System.Text.RegularExpressions namespace.

Using Dark GDK.NET
Miguel Melo
19
Years of Service
User Offline
Joined: 8th Aug 2005
Location:
Posted: 14th Apr 2007 21:38
I think the freely available C++ Boost library has regexps. I use regexps a lot but only on C# and VB.

I have vague plans for World Domination

Login to post a reply

Server time is: 2024-11-19 13:15:31
Your offset time is: 2024-11-19 13:15:31