Jump to content
Official BF Editor Forums
Sign in to follow this  
phresh

Mod with Custom Game Modes: Current Status

Recommended Posts

So we know it can be done and people have it working on dedicated servers (including myself). The how-to, etc. for this can be found in the following threads:

- Python: Code new gamemode?!? @

http://bfeditor.org/forums/index.php?showtopic=173

- Python: Custom gamemode in a user mod @

http://bfeditor.org/forums/index.php?showtopic=3490

- Python: Mod Gamemode @

http://bfeditor.org/forums/index.php?showtopic=1524

- Bug Reports: Custom mod + custom gametype = crash @

http://bfeditor.org/forum/viewtopic.php?p=23955#23955

- Discussion Main: Custom Gametype in Standalone Server @

http://bfeditor.org/forums/index.php?showt...t=dedicated+mod

- Tuorial requests: 'full' guide creation new gamemode @

http://bfeditor.org/forums/index.php?showt...t=dedicated+mod

Well I know I had a ton of fun going through all of these threads (and more of course) and eventually getting this working. But, I think at this point we can come up with a "'full' guide creation new gamemode" as originally requested by H4wk. I can certainly put one together. However I am still unclear on one thing that I'd like to understand, this is the difference between creating your mod via the editor and creating your mod from a copy of the bf2 mod folder. When I tried it out, some things seemed to work properly for our purpose (as compared to the attempts with an editor-created mod). These are:

quote: I've noticed that when you create your mod by copying the bf2 mod folder, it fixes at least one other thing i've noticed. This is switching a listen (local) server between modes. If I switched in the child-of-bf2 mod, the game would CTD. When I tried this same thing in one based off the bf2 mod (no parent mod), it worked without incident.

And also, when creating the mod this way, you do not need a gpm_whatever.py in your modsbf2pythongamegamemodes folder to run a local server within bf2.exe.

These things make me wonder if it's not best to start your mod as a copy of the bf2 one? Feedback please.

Once we have this topic nailed down (until the patch and boom at least), we can move on to documenting actual methods for modifying gameplay such as the CTF and the ways to notify people of whatnot (like those flags attached to the players spine - nice work SuperB). I know about the wiki and that people have some things working in this regard but I feel it needs to be summarized just as this does.

Happy Holidays,

-phresh

Share this post


Link to post
Share on other sites

I went threw all these topics today too and am already writing a german tutorial for www.bf2-mods.de how to create an own gamemode . If I find enough time during the holidays I'll probably translate it to english if nobody has already made one till then.

Share this post


Link to post
Share on other sites

Basically the reason why the game ctds when trying to use a custom game mode as bf2 as parent is that the game currently does not look for custom game modes in the mod folder if it has a parent, it instead only looks in the parent which is the problem. The only solution is for dice to patch the game to make that part dymanic.

Share this post


Link to post
Share on other sites

I have not experienced problems adding custom gamemodes to mod that don't exist in bf2. All methods of hosting work for me except trying to load directly with a commandline non-dedicated like this (gives the crash):

start bf2.exe +modPath mods/CE_LEGENDS +loadLevel ce_nml +gameMode gpm_ctf +menu 1

Share this post


Link to post
Share on other sites
I have not experienced problems adding custom gamemodes to mod that don't exist in bf2. All methods of hosting work for me except trying to load directly with a commandline non-dedicated like this (gives the crash):

start bf2.exe +modPath mods/CE_LEGENDS +loadLevel ce_nml +gameMode gpm_ctf +menu 1

Have you tried making a local server with the game mode in bf2?

Share this post


Link to post
Share on other sites

Phresh I have a feeling that this is a bug in the bf2 engine more than anything else.

I think for now the best option we have is to place our gamemode files in /mods/bf2/python/ with the most unique name as possible (in order to stop conflicts with other mods).

Something like: gpm_mymod_xxx.py. This isn't an ideal solution but it will work for the moment. This problem only effects non-dedicated servers so it isn't really too much of a big deal.

Share this post


Link to post
Share on other sites

lesee, posibly gonna end up with a list of red herrings here, but just cooked up a new mod for comparrison and bitwise compared em...

In addition to the whole capitolising the filenames wich breaks linux but works fine for windows (note, just lowercase everything next rev guys. uppercase benefits nothing here)

ingame.mep is truncated (text readable, technicly, but looks more like the old meme setup)

init.con camera bug (it's supposed to go in gamelogic.con, and _will_ crash the game the second the next map comes up)

no settings directory

a localisation file changed from '|C1101!|C1101' to '§C1101!§C1101'

and of course the python directories left totally blank...

Don't know if that helps or confuses, but from that, it looks like it might be the ingame.mep... mebbey try checking that in the next week or so...

Share this post


Link to post
Share on other sites

Thanks for the feedback guys. Looking for some clarification now.

Basically the reason why the game ctds when trying to use a custom game mode as bf2 as parent is that the game currently does not look for custom game modes in the mod folder if it has a parent, it instead only looks in the parent which is the problem. The only solution is for dice to patch the game to make that part dymanic.

I agree with this so long as we're talking about a local/listen/normal server (is there a proper term for this type of server in regard to BF2? I'm used to 'listen server' from playing with HL2. So, you're talking about launching your bf2.exe +modpath yadda yadda and then going Muliplayer -> 'Create Local', then choosing the mode and launching it, right CheetahShrk?

I have not experienced problems adding custom gamemodes to mod that don't exist in bf2. All methods of hosting work for me except trying to load directly with a commandline non-dedicated like this (gives the crash):

start bf2.exe +modPath mods/CE_LEGENDS +loadLevel ce_nml +gameMode gpm_ctf +menu 1

Is this shortcut the same as going to bf2.exe +modpath yadda yadda and then doing a 'Create Local' under multiplayer and choosing the custom type? If so, then this is consistent. Won't work this way unless you have your gpm_ctf.py in the game's modsbf2pythongamegamemode folder. Dedicated server should be no problem. Also Rexman, you mention "All methods of hosting", as far as I know, there is a dedicated server and there is a local/listen/normal (non-dedicated) server. Am I missing something or are you just referring to the two server types along with the different means of launching them?

I think for now the best option we have is to place our gamemode files in /mods/bf2/python/ with the most unique name as possible (in order to stop conflicts with other mods)

Sure, but you don't really have to release your custom modes' python code to the clients at all. Check the one DCon put out. Obviously people would need the .py files to run their own local servers but i see that as optional for a mod feature. And yeah you need it there to test on a non-dedicated server of course.

[RC]Azaezel[WWX], thank you (EDIT: and hopefully it is a red herring) I didn't follow you at first but this is the stuff I was looking for. I'm out of town for the weekend but will definitely have to look more into these descrepancies and test with correcting them once I get home.

Do we know what ingame.mep does? Looks to define some menu resources I guess but I don't recognise the formatting.

Azaezel[WWX]]init.con camera bug (it's supposed to go in gamelogic.con, and _will_ crash the game the second the next map comes up)

Can you clarify this a bit?

Azaezel[WWX]]a localisation file changed from '|C1101!|C1101' to '§C1101!§C1101'

Which file? Please post the line. Does anyone know what this would change? I don't know much about the syntax in the localization files yet.

EDIT: I see:

Alright, let's keep this rolling, thanks again for the feedback all.

-phresh

Share this post


Link to post
Share on other sites

Well, creating a local server (bf2.exe -> creat local) in CE Legends, with no custom .py files in the modsbf2 folder works fine. And, it doesn't appear to be generated as a copy of the modsbf2 folder. So I guess they must have included or imported their custom .py files somehow. Rexman? SuperB? Rex I think you were saying you guys haven't had such a problem. What's up with this?

-phresh

Share this post


Link to post
Share on other sites
I used NoB33r4u's method.

I guess you mean this stuff:

## I just copied this from one of my other posts - this works for the script mentioned and should work for all other scripts if you use the method described and your scripts are written correctly! ##

Copy the default python folder from the bf2 mod.

This works for the ThreatAndWorth script

( http://bf2.fun-o-matic.org/index.php/Scrip...:ThreatAndWorth )

Make your script called "myscript.py" and save it to the "game" folder in your mods python directory.

(here -- "..modsmymodpythongame")

In the "__init__.py" in the game folder (same place as the script) include the following lines:

import myscript

myscript.init()

As I say this works for the ThreatAndWorth script. Should work for other scripts (if they're written correctly ;) )

Okay, but I don't see anything in your __init__.py files (in CE Legends), where did you put this code?

Thanks,

-phresh

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×