Scripting for stealing objectives?...
Posted: Tue Dec 30, 2003 5:49 am
Alrighty,guys I have got the objective(documents) and got the trigger but on the scripting what do I save it as?...scr?
MoHAA Mapping
http://map.moh-central.net/forum/
Does not affect the triggers and objectives.GrimReaper wrote:I get WARNING-DOWNGRADING TO OLD ANIMATION FORMAT- and the other is the light leaked entity.
Think this is something to do with transparent textures... not sure, but pretty sure it won't affect triggers and objectives.GrimReaper wrote:Oh error loading objtest(name of my map).pft!!!!!!I think that is probibly it!
Everything after "//" on a line is ignored by MOH... "//" are used to remove code while keeping it in the file, or writing helpful comments for humans to read.GrimReaper wrote:All the things that you added with "//" should I delete them or keep them there?I kept them there!
No not really, but you can add things with scripting. There is a tutoial on adding a working flak in the tutorial section.GrimReaper wrote:I was woundering if you can edit the MOH:AA stock maps?
Code: Select all
// Custom objective test map
// ARCHITECTURE: Bjarne Gr?nnevik// SCRIPTING: Bjarne Gr?nnevikmain:
setcvar "g_obj_alliedtext1" "Steal the documents."
setcvar "g_obj_alliedtext2" "- Go get them"
setcvar "g_obj_alliedtext3" "- U know U want to"
setcvar "g_obj_axistext1" "Prevent the allies"
setcvar "g_obj_axistext2" "from stealing the"
setcvar "g_obj_axistext3" "documents."
setcvar "g_scoreboardpic" "none"
level waittill prespawn
exec global/OBJprecache.scr
// Change <objtest> to
// the name of you'r map file
level.script = maps/obj/<objtest>.scr
exec global/ambient.scr <objtest>
level waittill spawn
// Set the parameters for round based match
level.dmrespawning = 0 // 1 or 0 (0=no respawn)
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = axis // axis, allies, kills, or draw
// Comment out this line to be able to set the bomb
// when alone on the map ( just for testing )
// level waittill roundstart
// Start the win check thread for allies
thread desk_document_check
// If the end of the match is reached, the Axis win
level waittill axiswin
end // end of main
// Document checks
desk_document_check: while(1) { // forever
// Dont execute past this line
// until someone triggers the object
$documents_trigger waittill trigger
// parm.other is the triggerer
if(parm.other.dmteam == allies) {
// Make the document graphix disappear
$documents hide
// break out of the while loop
break
}
// protection against making this
// thread use too much CPU
waitframe
}
teamwin allies // Make allies win the match
end // end allies victory test
Code: Select all
// Custom objective test map
// ARCHITECTURE: Bjarne Gr?nnevik
// SCRIPTING: Bjarne Gr?nnevik
// the main below was on the line above (commented out)
main:
setcvar "g_obj_alliedtext1" "Steal the documents."
setcvar "g_obj_alliedtext2" "- Go get them"
setcvar "g_obj_alliedtext3" "- U know U want to"
setcvar "g_obj_axistext1" "Prevent the allies"
setcvar "g_obj_axistext2" "from stealing the"
setcvar "g_obj_axistext3" "documents."
setcvar "g_scoreboardpic" "none"
level waittill prespawn
exec global/OBJprecache.scr
// Change <objtest> to
// the name of you'r map file
// Really... change the <objtest> to
// your map name... no '<' or '>'
level.script = maps/obj/<objtest>.scr
exec global/ambient.scr <objtest>
level waittill spawn
// Set the parameters for round based match
level.dmrespawning = 0 // 1 or 0 (0=no respawn)
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = axis // axis, allies, kills, or draw
// Comment out this line to be able to set the bomb
// when alone on the map ( just for testing )
// level waittill roundstart
// Start the win check thread for allies
thread desk_document_check
// If the end of the match is reached, the Axis win
level waittill axiswin
end // end of main
// Document checks
desk_document_check:
while(1) { // forever
// Dont execute past this line
// until someone triggers the object
$documents_trigger waittill trigger
// parm.other is the triggerer
if(parm.other.dmteam == allies) {
// Make the document graphix disappear
$documents hide
// break out of the while loop
break
}
// protection against making this
// thread use too much CPU
waitframe
}
teamwin allies // Make allies win the match
end // end allies victory testCode: Select all
// Custom objective test map
// ARCHITECTURE: GrimReaper
// SCRIPTING: GrimReaper
main:
setcvar "g_obj_alliedtext1" "Steal the documents."
setcvar "g_obj_alliedtext2" "- Go get them"
setcvar "g_obj_alliedtext3" "- U know U want to"
setcvar "g_obj_axistext1" "Prevent the allies"
setcvar "g_obj_axistext2" "from stealing the"
setcvar "g_obj_axistext3" "documents."
setcvar "g_scoreboardpic" "none"
level waittill prespawn
// There is no OBJprecache.scr
exec global/DMprecache.scr
level.script = maps/obj/objtest.scr
// m6l1a is a blowing wnind sound
exec global/ambient.scr m6l1a
level waittill spawn
// Set the parameters for round based match
level.dmrespawning = 0 // 1 or 0 (0=no respawn)
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = axis // axis, allies, kills, or draw
// Comment out this line to be able to set the bomb
// when alone on the map ( just for testing )
// level waittill roundstart
// Start the win check thread for allies
thread desk_document_check
// If the end of the match is reached, the Axis win
level waittill axiswin
end // end of main
// Document checks
desk_document_check:
while(1) { // forever
// Dont execute past this line
// until someone triggers the object
$documents_trigger waittill trigger
// parm.other is the triggerer
if(parm.other.dmteam == allies) {
// Make the document graphix disappear
$documents hide
// break out of the while loop
break
}
// protection against making this
// thread use too much CPU
waitframe
}
teamwin allies // Make allies win the match
end // end allies victory test