CreateNavmesh.bat no doing anything

Making or wanting help making your own asset? Check in here
Post Reply
staylor18
Posts: 15
Joined: 2020-03-04 18:27

CreateNavmesh.bat no doing anything

Post by staylor18 »

Hi

Not sure this is the correct forum to ask, but there does not seem to be any other active Battlefield 2 modding communities out there.

I have been playing around tweaking Battlefield 2 over the last couple of years. I recently tried to have a go at creating a NavMesh.

I followed these tutorials:

Kysterama - http://members.iinet.net.au/~kyron/index.htm
Project Reality - https://www.realitymod.com/forum/showth ... p?t=103902
Youtube - Terminator1993 - https://www.youtube.com/watch?v=7jQfxl3_1SU

I am just using the standard 16 player coop GreatWall map from the base game as a trial run.

Everything in the editor (combat area + use for AI pathfinding, strategic areas + neighbours, Create pathfinding etc.) is there on the map.

The editor creates all the .gts files after clicking the 'Generate Pathfinding' button.

I copy the GTSData .gts files over to ....Battlefield 2\NavMesh\work\GreatWall\GTSData\Meshes

I change GenerateLocalNavmesh.py to the mod where the copy of GreatWall is.


I start CreateNavmesh.bat

I enter the mod and level noting case sensitivity, but it just opens up python and closes straight away.

I know it is opening GenerateNavmeshLocal.py because I wrote:

print 'Got to end of GenerateNavmeshLocal'
import time
time.sleep(3)

at the end of it and 'Got to end of GenerateNavmeshLocal' shows up. None of the other code or print functions seem to do anything. No errors are thrown up either. It is like the code is not even there.

I am using python 2.4.2 and have also tried 2.7.18.


I am guessing it is something really simple I am not doing.

I see another (AFsoccer) had the same problem in the Project Reality forum tutorial post (see above link).

Everything has Read only off and everything I can find has compatitbility for Windows XP - service pack 2 selected. All the security is set to 'Allowed' for everything I can see.

Any ideas would be greatly appreciated as I went ahead and figured out how to use Blender to edit .obj files, so this CreateNavmesh.bat problem is the last (hopefully) obstacle in my way .
LangMaster
PR:BF2 Contributor
Posts: 176
Joined: 2020-10-11 03:15

Re: CreateNavmesh.bat no doing anything

Post by LangMaster »

I've had this problem couple times, there should be a navmesh.exe(its in the same folder with all the .bats) , simple right click and properties, then go to compatibility and set it so it runs as admin, this should fix the problem.
Image
melonmuncher
PR:BF2 Developer
Posts: 266
Joined: 2012-01-13 05:14

Re: CreateNavmesh.bat no doing anything

Post by melonmuncher »

There's a few reasons this can happen, and all of them can cause your brain to explode trying to work it out.

First, keep using python 2.4.2 for this, newer versions won't work.

Second, are your .py files set to open with python 2.4 through windows?

And as langmaster said, are your compatibility setting okay? First thing the generator should do is open the bf2editor (which can be closed anyway)
staylor18
Posts: 15
Joined: 2020-03-04 18:27

Re: CreateNavmesh.bat no doing anything

Post by staylor18 »

Thanks for the tips guys. I tried the administrator changes etc but it still will not work.

I also did a new battlefield 2 install and it still will not work.

The original Great Wall map has the *.obj files in the level folder.

I grabbed the obj files and put them in the Navmesh foldler. I also deleted the quadtree (qtr and clb) files from the Great Wall level folder.
This mimics the situation if createNavemsh.bat had worked.

I ran FixNavmesh.bat entered the mod + level into the command prompt and it set off Navmesh.exe, opened the editor and created the quadtree files.

With the newly made quadtree files back in the Great Wall level the map AI bots worked in game.

So I am a little stumped. It seems to be something wrong with just createNavmesh.bat which opens GenerateNavmeshLocal.py. FixNavmesh.bat does not run python, so it has got to be a python issue. Maybe the mod_name and level_name entered in CreateNavmesh.bat are not getting passed on to CreateNavmesh.py correctly. (??)

I am going to get a couple of IT gurus, who know python, at my work to take a look. I will also try install the game on another computer and see if I get a different result.
LangMaster
PR:BF2 Contributor
Posts: 176
Joined: 2020-10-11 03:15

Re: CreateNavmesh.bat no doing anything

Post by LangMaster »

This navmeshing is gonna be the end of me, the worst thing is that you make it work, and after couple months you are about to make another map and it just stops working again.

I've had this issue many times where you open the .bat and after you type everything in it just closes automatically. Since you made the navmesh.exe set so it runs in admin, i would recommend checking on the python versions, i've had this million times.

I think i am actually running 2.7.18 exactly for this to work. Check what is your windows settings as you may have windows using a different version of installed python. Their new launcher gives you the ability to switch between versions. Usually the the openned cmd gives couple lines or errors, but when it closes right after typing in the mod and map it's gotta be something else. For me last time it was the navmesh.exe not having it's admin rights.
Image
melonmuncher
PR:BF2 Developer
Posts: 266
Joined: 2012-01-13 05:14

Re: CreateNavmesh.bat no doing anything

Post by melonmuncher »

You can hit me up on discord and I can walk you through easier if you need.

But just to be clear your .py files show with this old-school snake and not the new looking one?

https://ibb.co/GQZSNr6
Image
staylor18
Posts: 15
Joined: 2020-03-04 18:27

Re: CreateNavmesh.bat no doing anything

Post by staylor18 »

I'm using 2.4.2 so it shows a little frog icon. What version is the snake? I have also tried version 2.7.18, which I think was the most recent python 2 version.
staylor18
Posts: 15
Joined: 2020-03-04 18:27

Re: CreateNavmesh.bat no doing anything

Post by staylor18 »

SOLVED

I finally got it to work. I took it into work and the IT guy there could not figure out why the script would not run and it was definitely a python issue I was having.

I installed python version 2.3.4 (set the PATH in the environment variables) and it ran first time no problem.

I do not know why the other versions did not work as other people have used them with success. So I guess if anyone has the same problem just keep trying different python versions till something works.

Thanks for trying to help with your responses to my query.
Post Reply

Return to “PR:BF2 Community Modding”