Page 1 of 2
Scripting?!
Posted: Mon Mar 28, 2005 6:05 pm
by k47a
Yeah, I know, it's bad to ask this question, but I've never done any scripting before (either), so please excuse.... Well, how can I do scripting? I mean, where do I write the stuff in?
ivan
Posted: Mon Mar 28, 2005 6:09 pm
by Deutsche Dogge
Have a look at existing maps files (*mapname*.scr) they are in pak5.pk3 and pak6.pk3 in "maps/dm/" or "maps/obj/" and also go around in the other files included with the game, pak0.pk3 contains a lot of scripts. Looking at how the developers worked can give you a good start.
Also go to
http://www.gronnevik.se/rjukan/ as it contains a lot of tutorials and explanations.
There is no "easy way to start", you have to read existing stuff and you'll get it.
And never overlook the
Search button of the forums if you ever need to find something, can be already there.
Have fun learning.

Posted: Tue Mar 29, 2005 1:50 pm
by k47a
Yo, thanks a lot for the tips!
Bu, well, t I don't even know where I can find the scripting files - I mean, where I have to write the commands in...

Posted: Tue Mar 29, 2005 3:42 pm
by Green Beret
open the pak5.pk3 go into the maps folder,then go into the Dm or OBJ folder wich ever gametype ur editing,then choose the .scr u want to edit for the map.e.g(mohdm1.scr)
just edit them with notepad.
Posted: Tue Mar 29, 2005 4:36 pm
by k47a
Aaaaaaaaaaaaaaaaaaaaarhg!!!!
I can't open that file!!!

Do I have to run the MOHAA (the actual game)???
Sorry I'm so bloody stupid...
ivan
Posted: Tue Mar 29, 2005 5:05 pm
by jv_map
You can open it with winzip

Posted: Tue Mar 29, 2005 5:10 pm
by k47a
Okay, I got it unzipped and have an acrobat reader file in my MOHAA/main folder which I can't open though... So how do I open that damn pak.files, please... I'm on the edge of hyperventilating, you see...
ivan
Posted: Tue Mar 29, 2005 6:06 pm
by LiquorKraZy
use notepad...
Posted: Tue Mar 29, 2005 6:07 pm
by Rookie One.pl
I'm using Total Commander - it accesses .pk3s like directories.

Posted: Tue Mar 29, 2005 6:47 pm
by k47a
Okay, sorry guys, nvm, I give up... When I tried notepad, my computer hung itself and fell in kinda endless loop...
Anyway, what's Total Commander? Could I open the scripting stuff while in the game?
ivan
Posted: Tue Mar 29, 2005 7:24 pm
by bighoss
Umm I'm not sure, but I don't think you can. An easy way to open a pk3 file is to make a copy of it on your desktop or somewhere away from the original. When you have the copy there, rename it from a pk3 to a zip file. You should be able to open it now. Then when you find the scr files you can't just double click them. Your computer will probably believe it to be a screensaver. Just open notepad and then open the file or maybe right click and open with notepad that way. Hope this helped.
mohdm2
Posted: Tue Mar 29, 2005 7:55 pm
by tltrude
Here, this is the script for mohdm2 (Destroyed Village). Copy it to Notepad and save it as "mohdm_sample_script.scr" for now.
Code: Select all
// DESTROYED VILLAGE
// ARCHITECTURE: NED
// SCRIPTING: NED
main:
// set scoreboard messages
setcvar "g_obj_alliedtext1" "Destroyed Village"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""
setcvar "g_scoreboardpic" "mohdm2"
// call additional stuff for playing this map round based is needed
if(level.roundbased)
thread roundbasedthread
level waittill prespawn
//*** Precache Dm Stuff
exec global/DMprecache.scr
exec global/door_locked.scr::lock
level.script = maps/dm/mohdm2.scr
exec global/ambient.scr mohdm2
level waittill spawn
end
//-----------------------------------------------------------------------------
roundbasedthread:
// Can specify different scoreboard messages for round based games here.
level waitTill prespawn
level waittill spawn
// set the parameters for this round based match
level.dmrespawning = 0 // 1 or 0
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = kills // set to axis, allies, kills, or draw
level waittill roundstart
end
The above script does not do much. It adds text and a picture to the scoreboard. It adds background sound and door locked sounds. It allows the map to be played as a roundbased game.
Text that follows the "//" symbols is not read by the game. They are use to add comments for scripters.
Posted: Tue Mar 29, 2005 9:17 pm
by Deutsche Dogge
ivan saurochel wrote:Okay, sorry guys, nvm, I give up... When I tried notepad, my computer hung itself and fell in kinda endless loop...
Anyway, what's Total Commander? Could I open the scripting stuff while in the game?
ivan
You can edit while in game. Get in a map, open the console and type
editscript, it will open a notepad with the map script file, when you are done, just save (with the editor menu or ctrl+s) and the file will be located in "mohaa/main/maps/dm(or obj)/mapname*.scr. Then you can restart the map for it to take effect (maybe get out of the map completely before restarting, i can't be sure as i use this method only for minor changes and not for item spawning and major changes)
Now on other points:
-
winRAR can open .pk* files (right-click in explorer, open with..., select winRAR)
-
PakScape can open pk* files too and is easy to use
-
Notepad don't open pk* files, as you might thought since Petey posted a useless piece of information.
-
Notepad can open .scr, mus, tik, shader, cfg, st, urc files that comes with the game.
And you can also find very usefull informations that is not in the forums but is on this site too. Click on the ".map" link on the top of the page and have a look at the lefthand menu under "tutorials".
or click here
http://dynamic4.gamespy.com/~map/mohaa/ ... tegory=All
Posted: Tue Mar 29, 2005 9:42 pm
by LiquorKraZy
- Notepad don't open pk* files, as you might thought since Petey posted a useless piece of information.
i thought he was asking about opening the .scr files...but thanks for the acknowledgement!

Posted: Wed Mar 30, 2005 7:54 am
by k47a
Ay thanks so much for your help and patience. I'm gonna check it out asap (hey, I'm supposed to be very busy as a student, right?!
