Anyone know mohaa scripting?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Gorfy
Private
Posts: 1
Joined: Sat May 12, 2007 10:47 pm

Anyone know mohaa scripting?

Post by Gorfy »

Could anyone help me out with this? I want to make a script that puts certain text into the LOG file of the server when certain things happen (more specifically when a new map is loaded, if possible when a new round is started, in multiplayer of course).

here is what i have so far, to try and give you an idea:

Code: Select all

main:

/if (mapname==obj/obj_team2) {
subtract x 1
while (mapname==obj/obj_team2)
{
wait 5.0
}
append x a
}

/if (mapname==obj/obj_team1) {
subtract x 1
while (mapname==obj/obj_team1)
{
wait 5.0
}
append x a
}
goto main

end
All this would do (if it even worked) is print "subtract" and "append" in the logfile, but I want more than that. I want to be able to put whatever I want. I am very new at scripting for mohaa and have searched every forum I can find.

Thx~
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

The only log file in mohaa is called qconsole.log and it logs everything that gets outputed to the console including errors . By useing a command line like this

Code: Select all

"C:\Program Files\EA GAMES\MOHAA\MOHAA.exe" +set thereisnomonkey 1 +set developer 1 +set cheats 1 +set logfile 2 +set ui_console 1

+set logfile 2 would turn on logging also +set developer 1 puts you in delevoper mode and more detailed info gets logged . You can type logfile 2 into the console to turn on loging as well . When a map is loaded the script for that map that has the same name as the map with a .scr extention gets loaded . When a new map is loaded so is a new scirpt . If your script was called by the new script or executed from global/DMprecache.scr that is called to exectue by many of the stock MP maps then it would run . Like I said the console log logs everything includeing errors and is used to debug mainly . A statement in the level scriot such as iprintln would show on the screen and the log . println I think only shows in the log . You can get the map name from a cvar

Code: Select all

while((getcvar mapname) == "obj/obj_team2") 
The thing is then that map ends so does your script . If needed you can set a cvar that does keep a value between maps also a game variable such as game.info or any one you can make up will keep a value between rounds but not between maps .

There is no way to append a log file other than causing something to be output to the console and console log .
Image
Post Reply