Odamex Message Boards

Community Discussion => Technical Support => Topic started by: killingblair on February 14, 2007, 10:16:06

Title: Mapscript examples?
Post by: killingblair 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?
Title: Re: Mapscript examples?
Post by: Manc 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 (http://odamex.net/wiki/Debugger) and report any crashes that may occur to a new bug on the bug tracker (http://odamex.net/bugs).  And of course report any useful findings here as well as updating the wiki if possible.
Title: Re: Mapscript examples?
Post by: Marcus Koller on March 19, 2007, 13:46:05
So, it will contain some ZDoom scripting or is this its own script language?
Title: Re: Mapscript examples?
Post by: deathz0r on March 19, 2007, 20:57:56
This is its own language. It's entirely server-side, not client-side.
Title: Re: Mapscript examples?
Post by: Voxel 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 (http://odamex.net/bugs/show_bug.cgi?id=112) is still open, these scripts are SUBJECT TO CHANGE. Suggestions for improvement/replacement are welcome.
Title: Re: Mapscript examples?
Post by: killingblair on March 25, 2007, 02:32:59
Sheds a lot of light on the subject, many thanks!
Title: Re: Mapscript examples?
Post by: Russell 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