ivan
Scripting?!
Moderator: Moderators
Scripting?!
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
ivan
- Deutsche Dogge
- First Lieutenant
- Posts: 183
- Joined: Wed May 07, 2003 11:50 pm
- Location: Quebec
- Contact:
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.
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.
-
Green Beret
- Major General
- Posts: 746
- Joined: Mon Apr 19, 2004 12:21 pm
- Contact:
-
LiquorKraZy
- Captain
- Posts: 267
- Joined: Tue Aug 10, 2004 5:38 am
- Location: CA
- Contact:
-
Rookie One.pl
- Site Admin
- Posts: 2752
- Joined: Fri Jan 31, 2003 7:49 pm
- Location: Nowa Wies Tworoska, Poland
- Contact:
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
Here, this is the script for mohdm2 (Destroyed Village). Copy it to Notepad and save it as "mohdm_sample_script.scr" for now.
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.
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
Text that follows the "//" symbols is not read by the game. They are use to add comments for scripters.
- Deutsche Dogge
- First Lieutenant
- Posts: 183
- Joined: Wed May 07, 2003 11:50 pm
- Location: Quebec
- Contact:
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)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
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
-
LiquorKraZy
- Captain
- Posts: 267
- Joined: Tue Aug 10, 2004 5:38 am
- Location: CA
- Contact:







