Message Boards

Topic: Mapscript examples?  (Read 12304 times)

Offline killingblair

  • Posts: 12
  • Odamechs
    • View Profile
Mapscript examples?
« on: February 14, 2007, 10:16:06 »
There was fairly limited information in the OdaWiki, so I'll ask here.

May I see an example of how to use a startmapscript/endmapscript with if commands to see how to correctly cycle wads and maps?

Offline Manc

  • Administrator
  • Posts: 77
  • Fist to the face!
    • View Profile
    • odamex.net
Re: Mapscript examples?
« Reply #1 on: February 16, 2007, 15:24:11 »
I have yet to use it myself, but denis (voxel) would be the best person to provide more info.  He is gone for another week, but I will point him to this thread and let him to he should provide a bit more documentation and example.

In the meantime, I would suggest taking what info is there and experimenting.  I highly recommend you run your server through a debugger and report any crashes that may occur to a new bug on the bug tracker.  And of course report any useful findings here as well as updating the wiki if possible.
Odamex Web Administrator

Offline Marcus Koller

  • Posts: 15
    • View Profile
Re: Mapscript examples?
« Reply #2 on: March 19, 2007, 13:46:05 »
So, it will contain some ZDoom scripting or is this its own script language?

Offline deathz0r

  • Administrator
  • Posts: 61
  • kick it oldskewl
    • View Profile
    • deathz0r's Place of DOOM
Re: Mapscript examples?
« Reply #3 on: March 19, 2007, 20:57:56 »
This is its own language. It's entirely server-side, not client-side.

Offline Voxel

  • Developer
  • Posts: 22
    • View Profile
    • Voxelsoft
Re: Mapscript examples?
« Reply #4 on: March 23, 2007, 08:04:19 »
The syntax for starmapscript is very simple:

Code: [Select]
if CVAR1 eq VALUE1 CVAR2 VALUE2

CVAR2 will be set to VALUE2 if CVAR1 is currently set to VALUE1. 'curmap' is a read-only cvar that tracks the current map, so it is a useful condition:

Code: [Select]
if curmap eq MAP01 skill 5
if curmap eq MAP02 skill 4
if curmap eq MAP30 hostname "join if you dare"

This code can be placed directly into starmapscript, or it can be put in a script, and starmapscript can be set to "exec script.cfg".

While bug 112 is still open, these scripts are SUBJECT TO CHANGE. Suggestions for improvement/replacement are welcome.

Offline killingblair

  • Posts: 12
  • Odamechs
    • View Profile
Re: Mapscript examples?
« Reply #5 on: March 25, 2007, 02:32:59 »
Sheds a lot of light on the subject, many thanks!

Offline Russell

  • Developer
  • Posts: 70
    • View Profile
Re: Mapscript examples?
« Reply #6 on: March 26, 2007, 18:23:47 »
I made an article for it on the wiki, it probably needs some work, but its a start.

http://odamex.net/wiki/Map_scripts