Scripting for stealing objectives?...
Moderator: Moderators
- GrimReaper
- Sergeant
- Posts: 58
- Joined: Tue Dec 30, 2003 5:40 am
Scripting for stealing objectives?...
Alrighty,guys I have got the objective(documents) and got the trigger but on the scripting what do I save it as?...scr?
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
- GrimReaper
- Sergeant
- Posts: 58
- Joined: Tue Dec 30, 2003 5:40 am
It didnt seem to work I put the scr file in with the BSP while making the pk3 it loads.The documents flash red but the allies cant take them nor can the axis?Can someone give me a screenshot of where the trigger should go or something?Anything that you people can think of that could make it not work/work?!When I type in targetname and then documents it sais classname instead of targetname...is that right?
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
1) Dont make a pk3 while testing. Its only extra work.
2) The trigger should enclose the documents (because the player will try to trigger the docs, as he/she cant see the trigger itself).
3) Is the scr file in the same dir as the bsp file?
4) Does the scr file have the same name as the bsp file (if your map is "hello_monkey.bsp", the script should be named "hello_monkey.scr")?
5) Does your script contain errors? Look in the text in the console... or set logfile 2 before loading the map and look in the "qconsole.log" file in your main dir afterwards...
Help any?
2) The trigger should enclose the documents (because the player will try to trigger the docs, as he/she cant see the trigger itself).
3) Is the scr file in the same dir as the bsp file?
4) Does the scr file have the same name as the bsp file (if your map is "hello_monkey.bsp", the script should be named "hello_monkey.scr")?
5) Does your script contain errors? Look in the text in the console... or set logfile 2 before loading the map and look in the "qconsole.log" file in your main dir afterwards...
Help any?
- GrimReaper
- Sergeant
- Posts: 58
- Joined: Tue Dec 30, 2003 5:40 am
I dont get errors but I get a lot of warnings if that is what you mean.I get WARNING-DOWNGRADING TO OLD ANIMATION FORMAT- and the other is the light leaked entity.Oh error loading objtest(name of my map).pft!!!!!!I think that is probibly it!But under where your guyses General tutorials for mapping it doesnt say that you need to put the pft file in with your PK3 so that shouldnt be it?I may be doing the script wrong...All the things that you added with "//" should I delete them or keep them there?I kept them there!
- GrimReaper
- Sergeant
- Posts: 58
- Joined: Tue Dec 30, 2003 5:40 am
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
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!
So... what does your script look like? Please post it inside a pair of CODE tags. Maby there is an error in there....
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
- GrimReaper
- Sergeant
- Posts: 58
- Joined: Tue Dec 30, 2003 5:40 am
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
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
This should work better:
You had commented out the very important "main:" (or rather moved it up to the comment on line 2).
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 test- GrimReaper
- Sergeant
- Posts: 58
- Joined: Tue Dec 30, 2003 5:40 am
I know you have done a lot for me but can you make the script for me becaseu its still confusing.The name of my map is objtest.Man I still couldnt get it to work!You dont have to if you dont want obviously but it would really be appreciated!Man where it sais exec global/ambient.scr <objtest>. I wasent sure if I had to change the ambient to objtest or what:PSo please someone help the newbie.
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
This should be it:
If it still doesent work, I suggest you go over all targetnames again and read the tutorial again, both VERY carefully 
It's SOOOO very easy to forget one small thing that makes it all F.U.B.A.R.
Code: 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 testIt's SOOOO very easy to forget one small thing that makes it all F.U.B.A.R.
- GrimReaper
- Sergeant
- Posts: 58
- Joined: Tue Dec 30, 2003 5:40 am
Ok,im finally back because I got some virus but anyways..thanks bro I finally got it to work after that but...I have one more question.You know how you put the noise in my script,Well the noise doesnt really follow my map.I have a map like the v2,and I woundering if someone could just put the name of one that would fit for a factory inside kinda map.So someone just give a little list of different noises.Thanks!!!
