Code not working

Questions and answers about the how and why of making maps.
Post Reply
CaptainHiggins
Private First Class
Private First Class
Posts: 20
Joined: Wed Sep 30, 2009 11:41 pm

Code not working

Post by CaptainHiggins » Wed Sep 08, 2010 10:35 pm

Hi, I was almost done with my map, but I was trying to add physics drivers for jumps from the corners. But they didn't work, and I realized I had to make them meshboxes. But something about the meshbox code is stopping the map from working, and I can't test it. What is wrong? I tried to run it in iBZEdit to find out what lines were wrong, but it can't support zones or meshboxes anyway.

Code: Select all

# Created with iBZEdit on Wed Sep 08 15:03:37 2010
#ibzcam -55.179249 -47.904758 59.056118 -673.318726 -22.993326 60.000000
#ibzwindow -3.000000 221.000000 1076.000000 807.000000

world
  size 200.000000
end

options
  -c
  +r
  -fb
  -j
  -set _tankSpeed 25.000000
  -ms 3
  -mp 0,3,0,3,0,5
  -set _explodeTime 0.15
  -set _flagEffectTime 0.1
  -set _gmTurnAngle .6
  -set _maxFlagGrabs 1
  -set _mGunAdVel 7.5
  -set _reloadTime 2
  -set _laserAdRate 3
end

box
  name Box
  position 130.000000 60.000000 0.000000
  size 10.000000 10.000000 10.000000
  rotation 0.000000
end

zone
  name Zone
  position 130 60 0
  size 5 5 0
  rotation 0
  zoneflag L 1
end

box
  name Box
  position 60.000000 130.000000 0.000000
  size 10.000000 10.000000 10.000000
  rotation 0.000000
end

zone
  name Zone
  position 60 130 0
  size 5 5 0
  rotation 0
  zoneflag L 1
end

box
  name Box
  position -130.000000 -60.000000 0.000000
  size 10.000000 10.000000 10.000000
  rotation 0.000000
end

zone
  name Zone
  position -130 -60 0
  size 5 5 0
  rotation 0
  zoneflag L 1
end

box
  name Box
  position -60.000000 -130.000000 0.000000
  size 10.000000 10.000000 10.000000
  rotation 0.000000
end

zone
  name Zone
  position -60 -130 0
  size 5 5 0
  rotation 0
  zoneflag L 1
end

box
  name Box
  position 90.000000 0.000000 0.000000
  size 5.000000 5.000000 20.000000
  rotation 0.000000
end

box
  name Box
  position 0.000000 90.000000 0.000000
  size 5.000000 5.000000 20.000000
  rotation 0.000000
end

box
  name Box
  position 0.000000 -90.000000 0.000000
  size 5.000000 5.000000 20.000000
  rotation 0.000000
end

box
  name Box
  position -90.000000 0.000000 0.000000
  size 5.000000 5.000000 20.000000
  rotation 0.000000
end

box
  name Box
  position 0.000000 0.000000 0.000000
  size 20.000000 20.000000 20.000000
  rotation 0.000000
end

box
  name Box
  position 0.000000 0.000000 20.000000
  size 20.000000 20.000000 10.000000
  rotation 0.000000
  drivethrough
end

box
  name Box
  position 0.000000 0.000000 30.000000
  size 8.000000 8.000000 1.000000
  rotation 0.000000
end

zone
  name Zone
  position 0 0 31
  size 6 6 0
  rotation 0
  zoneflag G 1
end

box
  name Box
  position 130.000000 51.000000 10.000000
  size 10.000000 1.000000 1.000000
  rotation 0.000000
end

box
  name Box
  position 121.000000 60.000000 10.000000
  size 1.000000 10.000000 1.000000
  rotation 0.000000
end

box
  name Box
  position 121.000000 51.000000 10.000000
  size 1.000000 1.000000 2.000000
  rotation 0.000000
end

box
  name Box
  position 139.000000 51.000000 10.000000
  size 1.000000 1.000000 2.000000
  rotation 0.000000
end

box
  name Box
  position 121.000000 69.000000 10.000000
  size 1.000000 1.000000 2.000000
  rotation 0.000000
end

box
  name Box
  position 121.000000 60.000000 12.000000
  size 1.000000 10.000000 1.000000
  rotation 0.000000
end

box
  name Box
  position 130.000000 51.000000 12.000000
  size 10.000000 1.000000 1.000000
  rotation 0.000000
end

box
  name Box
  position 51.000000 130.000000 10.000000
  size 1.000000 10.000000 1.000000
  rotation 0.000000
end

box
  name Box
  position 60.000000 121.000000 10.000000
  size 10.000000 1.000000 1.000000
  rotation 0.000000
end

box
  name Box
  position 69.000000 121.000000 11.000000
  size 1.000000 1.000000 1.000000
  rotation 0.000000
end

box
  name Box
  position 51.000000 139.000000 11.000000
  size 1.000000 1.000000 1.000000
  rotation 0.000000
end

box
  name Box
  position 51.000000 121.000000 11.000000
  size 1.000000 1.000000 1.000000
  rotation 0.000000
end

box
  name Box
  position 60.000000 121.000000 12.000000
  size 10.000000 1.000000 1.000000
  rotation 0.000000
end

box
  name Box
  position 51.000000 130.000000 12.000000
  size 1.000000 10.000000 1.000000
  rotation 0.000000
end

box
  name Box
  position -51.000000 -130.000000 10.000000
  size 1.000000 10.000000 1.000000
  rotation 0.000000
end

box
  name Box
  position -60.000000 -121.000000 10.000000
  size 10.000000 1.000000 1.000000
  rotation 0.000000
end

box
  name Box
  position -69.000000 -121.000000 11.000000
  size 1.000000 1.000000 1.000000
  rotation 0.000000
end

box
  name Box
  position -51.000000 -121.000000 11.000000
  size 1.000000 1.000000 1.000000
  rotation 0.000000
end

box
  name Box
  position -51.000000 -139.000000 11.000000
  size 1.000000 1.000000 1.000000
  rotation 0.000000
end

box
  name Box
  position -51.000000 -130.000000 12.000000
  size 1.000000 10.000000 1.000000
  rotation 0.000000
end

box
  name Box
  position -60.000000 -121.000000 12.000000
  size 10.000000 1.000000 1.000000
  rotation 0.000000
end

box
  name Box
  position -130.000000 -51.000000 10.000000
  size 10.000000 1.000000 1.000000
  rotation 0.000000
end

box
  name Box
  position -121.000000 -60.000000 10.000000
  size 1.000000 10.000000 1.000000
  rotation 0.000000
end

box
  name Box
  position -121.000000 -51.000000 11.000000
  size 1.000000 1.000000 1.000000
  rotation 0.000000
end

box
  name Box
  position -139.000000 -51.000000 11.000000
  size 1.000000 1.000000 1.000000
  rotation 0.000000
end

box
  name Box
  position -121.000000 -69.000000 11.000000
  size 1.000000 1.000000 1.000000
  rotation 0.000000
end

box
  name Box
  position -130.000000 -51.000000 12.000000
  size 10.000000 1.000000 1.000000
  rotation 0.000000
end

box
  name Box
  position -121.000000 -60.000000 12.000000
  size 1.000000 10.000000 1.000000
  rotation 0.000000
end

pyramid
  name Pyramid
  position 110.000000 110.000000 0.000000
  size 10.000000 10.000000 10.000000
  rotation 0.000000
end

pyramid
  name Pyramid
  position -110.000000 -110.000000 0.000000
  size 10.000000 10.000000 10.000000
  rotation 0.000000
end

pyramid
  name Pyramid
  position 110.000000 -110.000000 0.000000
  size 10.000000 10.000000 10.000000
  rotation 0.000000
  drivethrough
end

pyramid
  name Pyramid
  position -110.000000 110.000000 0.000000
  size 10.000000 10.000000 10.000000
  rotation 0.000000
  drivethrough
end

base
  name BlueBase
  color 3
 oncap SW
  position -180.000000 -180.000000 0.000000
  size 20.000000 20.000000 10.000000
  rotation 0.000000
end

zone
  name Zone
  position -180 -180 10
  size 18 18 0
  rotation 0
  zoneflag ST 4
  zoneflag SE 1
  zoneflag GM 4
  zoneflag SB 4
  zoneflag SW 4
  zoneflag TH 2
end

base
  name RedBase
  color 1
 oncap SW
  position 180.000000 180.000000 0.000000
  size 20.000000 20.000000 10.000000
  rotation 0.000000
end

zone
  name Zone
  position 180 180 10
  size 18 18 0
  rotation 0
  zoneflag ST 4
  zoneflag SE 1
  zoneflag GM 4
  zoneflag SB 4
  zoneflag SW 4
  zoneflag TH 2
end

box
  name Box
  position 40.000000 -40.000000 0.000000
  size 30.000000 1.000000 14.000000
  rotation 315.000000
end

box
  name Box
  position -40.000000 40.000000 0.000000
  size 30.000000 1.000000 14.000000
  rotation 315.000000
end

meshbox
  name JumpTop
  position -195 195 0
  size 5 5 0
  rotation 0
  shift 0 0 0
  shear 0 0 0
  scale 0 0 0
  spin 0 0 0
  phydrv JumpTop
  obstacle
end

physics
  name JumpTop
  linear 200 -200 200
end

meshbox
  name JumpBottom
  position 195 -195 0
  size 5 5 0
  rotation 0
  shift 0 0 0
  shear 0 0 0
  scale 0 0 0
  spin 0 0 0
  phydrv JumpBottom
  obstacle
end

physics
  name JumpBottom
  linear -200 200 200
end

User avatar
blast
General
General
Posts: 4746
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: Code not working

Post by blast » Thu Sep 09, 2010 12:03 am

Code: Select all

    meshbox
      name JumpTop
      position -195 195 0
      size 5 5 0
      rotation 0
      shift 0 0 0
      shear 0 0 0
      scale 0 0 0
      spin 0 0 0
      phydrv JumpTop
      obstacle
    end
The spin attribute takes 4 values, not 3. This is what is causing your problem. Check the manual page for the BZW format.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image

CaptainHiggins
Private First Class
Private First Class
Posts: 20
Joined: Wed Sep 30, 2009 11:41 pm

Re: Code not working

Post by CaptainHiggins » Thu Sep 09, 2010 11:22 pm

Thanks, but I got another problem.

I changed the code and tried it, and I started a server successfully (great!).

Then I quit the game and came back 7 hours or so later, and now I can't make any server for any map, even random map. It says, failed (exit=2). What do I do?

CaptainHiggins
Private First Class
Private First Class
Posts: 20
Joined: Wed Sep 30, 2009 11:41 pm

Re: Code not working

Post by CaptainHiggins » Thu Sep 09, 2010 11:25 pm

Also, how would I add genostats?

User avatar
blast
General
General
Posts: 4746
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: Code not working

Post by blast » Thu Sep 09, 2010 11:58 pm

Do not use the "Start Server" menu in the game to run a server. If an error occurs, you will have no way of knowing what error. Run bzfs from the command prompt or terminal with the correct paramaters. As for adding genostats, you'd first have to compile and install that plugin, and then it's as easy as adding "-loadplugin genostats" to your configuration.

Edit: Here is where genostats was from: http://my.bzflag.org/bb/viewtopic.php?f=79&t=12418

I modified it to respond to /gs as well.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image

CaptainHiggins
Private First Class
Private First Class
Posts: 20
Joined: Wed Sep 30, 2009 11:41 pm

Re: Code not working

Post by CaptainHiggins » Fri Sep 10, 2010 12:42 am

Ok...

I tried to set up a server for the map. I completely confused myself and am totally clueless.

I opened bzfs and it said that it can't run a server, perhaps one is already running? Then it logged out. I couldn't type anything.

I got this iBZServer application somewhere, is that of any use? I tried to run a server with it but it didn't work.

I tried the "Running a Server on Mac OSX" thread but I couldn't download the files.

I tried the How to Run a Public Server thread but I couldn't complete any of the steps.

What do I do?

User avatar
Tanx
Private First Class
Private First Class
Posts: 125
Joined: Sat Mar 22, 2008 11:14 pm

Re: Code not working

Post by Tanx » Fri Sep 10, 2010 2:33 am

I can't help you there, but I did notice an error. Your physics are after the object it's used in, but they need to be before.
known as: Tanx, Eoncho, ckw.
Bzflag player since 2001.

User avatar
McSpider
Private First Class
Private First Class
Posts: 49
Joined: Mon May 11, 2009 10:11 pm
Location: Yukon Canada
Contact:

Re: Code not working

Post by McSpider » Fri Sep 10, 2010 2:35 am

Hi,
To check it "bzfs" is already running:
Go to the utilities folder and open activity monitor, in the upper right corner of the activity monitor window there should be a search field type in "bzfs". If it's already running it should appear in the list select it and press "Quit Process" then quit.

To start a local server:
I assume you already know this but anyway,
Navigate to where bzflag is located and right click it chose show package contents and navigate to Contents/MacOS/bzfs
drop this file into a open terminal window it should now read something like this:

Code: Select all

Last login: Thu Sep  9 19:21:33 on ttys000
McSpiders-MacBook-Pro:~ mcspider$ /Applications/Games/Action/BZFlag-2.0.16.app/Contents/MacOS/bzfs
now add -world and drop in your world file it should read something like this:

Code: Select all

Last login: Thu Sep  9 19:21:33 on ttys000
McSpiders-MacBook-Pro:~ mcspider$ /Applications/Games/Action/BZFlag-2.0.16.app/Contents/MacOS/bzfs -world /Users/mcspider/Documents/BZFlag/Maps-WIP/DownUnder\(fin\).bzw
you can add any other options you wish such as:

Code: Select all

Last login: Thu Sep  9 19:21:33 on ttys000
McSpiders-MacBook-Pro:~ mcspider$ /Applications/Games/Action/BZFlag-2.0.16.app/Contents/MacOS/bzfs -world /Users/mcspider/Documents/BZFlag/Maps-WIP/DownUnder\(fin\).bzw -tk -passwd omni -ddd
And I would recommend that you try running a server with -ddd it will show all the errors in the map file (if any).

to make it public you need to add these options:

Code: Select all

-public " Your server name " <your server name>
-publicaddr 000.000.000.000:8080  <your IP and Port>
-p 8080 <port to listen on>
Don't include the <descriptions>
This should work but if you have any questions ask them. :wink:
McSpider - BZFlag Maps

CaptainHiggins
Private First Class
Private First Class
Posts: 20
Joined: Wed Sep 30, 2009 11:41 pm

Re: Code not working

Post by CaptainHiggins » Fri Sep 10, 2010 11:06 pm

Thanks tankx and McSpider!

I started a server correctly, and then I couldn't make another after I fixed a problem with the map.

This is the code for my meshboxes:

Code: Select all

physics
  name JumpTop
  linear 200 -200 200
end

meshbox
  name JumpTop
  position -195 195 0
  size 5 5 0
  rotation 0
  shift 0 0 0
  shear 0 0 0
  scale 0 0 0
  spin 0 0 0 0
  phydrv JumpTop
end

physics
  name JumpBottom
  linear -200 200 200
end

meshbox
  name JumpBottom
  position 195 -195 0
  size 5 5 0
  rotation 0
  shift 0 0 0
  shear 0 0 0
  scale 0 0 0
  spin 0 0 0 0
  phydrv JumpBottom
end
It still doesn't work, what is the problem?

I took out "obstacle" line because the terminal rejected it, and the boxes didn't appear.

User avatar
Tanx
Private First Class
Private First Class
Posts: 125
Joined: Sat Mar 22, 2008 11:14 pm

Re: Code not working

Post by Tanx » Fri Sep 10, 2010 11:29 pm

The only thing I see is you have 0 for the meshbox's z size.
known as: Tanx, Eoncho, ckw.
Bzflag player since 2001.

User avatar
McSpider
Private First Class
Private First Class
Posts: 49
Joined: Mon May 11, 2009 10:11 pm
Location: Yukon Canada
Contact:

Re: Code not working

Post by McSpider » Sat Sep 11, 2010 12:10 am

CaptainHiggins wrote: I started a server correctly, and then I couldn't make another after I fixed a problem with the map.
hmm, the only reason I can think of for that is that you didn't stop the previous server.
You can try checking with activity monitor as I described above.
To stop a server you should go to the terminal window that the server is running in and press cmd and . or if you have a server password setup use /shutdownserver
McSpider - BZFlag Maps

User avatar
blast
General
General
Posts: 4746
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: Code not working

Post by blast » Sat Sep 11, 2010 3:58 pm

Doesn't Ctrl-C work on OSX?
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image

User avatar
Runic
Private First Class
Private First Class
Posts: 23
Joined: Fri Jul 02, 2004 8:51 pm

Re: Code not working

Post by Runic » Sat Sep 11, 2010 4:47 pm

Yes, Ctrl-C does work for OSX in terminal to abort the currently running process, but only if you didn't tell the process to run in the background.

another option would be to use the command "kill -KILL pid" in termial to stop the process, if you know the pid of the process you want to kill.

you could use the command "ps -ax | grep bzfs" (without the quotes) to get the pid

Activity Monitor, is nice for those wanting a GUI program to see/kill processes with and more. It's similar to Task Manager for Windows
This web page has a picture of it,
http://oreilly.com/pub/a/mac/2005/10/04 ... nitor.html
BZFlag ROCKS!!!

Post Reply