Testing objectives
Moderator: Moderators
Testing objectives
I could have sworn i saw this asked before but am having no luck finding it.
I have made a map with two obj's and would like to test them.
How do you do this? Do you have to alter the script somehow?
I have made a map with two obj's and would like to test them.
How do you do this? Do you have to alter the script somehow?
to test obj with only 1 player .... and i quote
"To test the objective scripts. You need to comment out the 'level waitill roundstart' line by adding the '//'[comment command] ie "// level waitill roundstart" . This line tells the Multiplayer game to wait until two opposing members are in the game. Uncomment before distributing your map"
works for me ..!
"To test the objective scripts. You need to comment out the 'level waitill roundstart' line by adding the '//'[comment command] ie "// level waitill roundstart" . This line tells the Multiplayer game to wait until two opposing members are in the game. Uncomment before distributing your map"
works for me ..!
Hmmm, still having trouble with testing the objs.....here is what i have got and what i have done.
I followed the .map tut on objectives


this is the script i made from using the TUT and comparing to other obj scripts.
// test8
// test
// test
main:
exec global/exploder.scr
setcvar "g_obj_alliedtext1" ""
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" " ""
level waittill prespawn
exec global/DMprecache.scr
level.script = maps/obj/test8.scr
exec global/ambient.scr mohdm2
level waittill spawn
level.bomb_damage = 200
level.bomb_explosion_radius = 640
level.defusing_team = "axis"
level.planting_team = "allies"
level.targets_to_destroy = 1
level.dmrespawning = 1
level.dmroundlimit = 15
level.clockside = axis
//level waittill roundstart
$bomb.trigger_name = $trigger2
$bomb.target.target = $trigger2
$bomb.target.destroyed_model = "models/statweapons/flak88_d.tik"
$bomb.explosion_fx = "models/emitters/explosion_mine.tik"
$bomb.explosion_sound = "sound/weapons/explo/explo_metalmed1.wav"
$bomb thread global/obj_dm.scr::bomb_thinker
$bomb thread axis_win_timer
thread allies_win_bomb
thread bomb1_exploded $bomb
end
explode_my_bomb:
iprintlnbold_noloc "Bomb has been set , 10 seconds to detonation"
wait 2
iprintlnbold_noloc "8"
wait 2
iprintlnbold_noloc "6"
wait 2
iprintlnbold_noloc "4"
wait 1
iprintlnbold_noloc "3"
wait 1
iprintlnbold_noloc "2"
wait 1
iprintlnbold_noloc "1"
wait 1
exec global/exploder.scr::explode 1
iprintlnbold_noloc "The bomb will go off again"
end
// Axis Win
axis_win_timer:
level waittill axiswin
end
// Allies Win
allies_win_bomb:
while(level.targets_destroyed < level.targets_to_destroy)
waitframe
teamwin allies
end
//*** --------------------------------------------
//*** "Bomb 1 Exploded"
//*** --------------------------------------------
bomb1_exploded local.bomb1:
while (local.bomb1.exploded != 1)
wait .1
iprintlnbold_noloc "East Flak88 has been destroyed!!!!"
//$spawn_axis2 disablespawn
//$spawn_axis3 enablespawn
end
I have placed the .scr in with my .bsp under maps/obj.....everything works and i can even here the sound from mohdm2. i even placed the "//" in front of "level waittill roundstart"
i have also triple checked to make sure all N entries match up and they do.
When i jump on with allies it won't set the bomb.
can anyone help me notice where i have gone wrong?
I followed the .map tut on objectives


this is the script i made from using the TUT and comparing to other obj scripts.
// test8
// test
// test
main:
exec global/exploder.scr
setcvar "g_obj_alliedtext1" ""
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" " ""
level waittill prespawn
exec global/DMprecache.scr
level.script = maps/obj/test8.scr
exec global/ambient.scr mohdm2
level waittill spawn
level.bomb_damage = 200
level.bomb_explosion_radius = 640
level.defusing_team = "axis"
level.planting_team = "allies"
level.targets_to_destroy = 1
level.dmrespawning = 1
level.dmroundlimit = 15
level.clockside = axis
//level waittill roundstart
$bomb.trigger_name = $trigger2
$bomb.target.target = $trigger2
$bomb.target.destroyed_model = "models/statweapons/flak88_d.tik"
$bomb.explosion_fx = "models/emitters/explosion_mine.tik"
$bomb.explosion_sound = "sound/weapons/explo/explo_metalmed1.wav"
$bomb thread global/obj_dm.scr::bomb_thinker
$bomb thread axis_win_timer
thread allies_win_bomb
thread bomb1_exploded $bomb
end
explode_my_bomb:
iprintlnbold_noloc "Bomb has been set , 10 seconds to detonation"
wait 2
iprintlnbold_noloc "8"
wait 2
iprintlnbold_noloc "6"
wait 2
iprintlnbold_noloc "4"
wait 1
iprintlnbold_noloc "3"
wait 1
iprintlnbold_noloc "2"
wait 1
iprintlnbold_noloc "1"
wait 1
exec global/exploder.scr::explode 1
iprintlnbold_noloc "The bomb will go off again"
end
// Axis Win
axis_win_timer:
level waittill axiswin
end
// Allies Win
allies_win_bomb:
while(level.targets_destroyed < level.targets_to_destroy)
waitframe
teamwin allies
end
//*** --------------------------------------------
//*** "Bomb 1 Exploded"
//*** --------------------------------------------
bomb1_exploded local.bomb1:
while (local.bomb1.exploded != 1)
wait .1
iprintlnbold_noloc "East Flak88 has been destroyed!!!!"
//$spawn_axis2 disablespawn
//$spawn_axis3 enablespawn
end
I have placed the .scr in with my .bsp under maps/obj.....everything works and i can even here the sound from mohdm2. i even placed the "//" in front of "level waittill roundstart"
i have also triple checked to make sure all N entries match up and they do.
When i jump on with allies it won't set the bomb.
can anyone help me notice where i have gone wrong?
LOL....i tried that....no go. That was my whole reason for posting....just wanted to make sure everything was set correctly.mohaa_rox wrote:Maybe you have to play it correctly. Go near the bomb and press the use key and hold until you see a stopwatch. Hold it until the bomb is set.
Thx for the help again jv_map.....if what you stated about removing the "$" is true, does that mean the tut on setting objectives is wrong? That's where i got it from.jv_map wrote:$bomb.trigger_name = $trigger2
should be
$bomb.trigger_name = trigger2
I will try and see if that works and post a reply. Thx again
jv_map, i treid ur suggestion about removing the $, but it didn't work.
I am getting to the point where i wanna take a sledge hammer to my computer, becasue i have no hair left to pull out.
Below are pics of my scripts objects and trigger. Can someone see if i missed something. Again these came straight from the TUT on the main page.
trigger

bomb

flak

Could me having Spearhead installed be causing me any difficulties? I know it kept me from see some objects before i removed certain files.
I am getting to the point where i wanna take a sledge hammer to my computer, becasue i have no hair left to pull out.
Below are pics of my scripts objects and trigger. Can someone see if i missed something. Again these came straight from the TUT on the main page.
trigger

bomb

flak

Could me having Spearhead installed be causing me any difficulties? I know it kept me from see some objects before i removed certain files.
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
If you follow my tutorialthere will be hardly no scripting to have errors in... 
-
6thDLI-Quantum
- Corporal
- Posts: 44
- Joined: Tue Jan 14, 2003 6:08 pm
This may not be possible for everyone, but I have two PC's at home, both with MOH:AA installed. My PC's are networked therefore I play one as Axis [on the slowest box] and the other as Allies. I just switch between the two to test the objective script.
Try this if you have more than one PC and they are networked. Do not run one as a dedicated server though, just connect via your internal IP range, which would usually be 192.168.0.x.
Try this if you have more than one PC and they are networked. Do not run one as a dedicated server though, just connect via your internal IP range, which would usually be 192.168.0.x.
[6th-DLI]Quantum
In the land of the blind, the one-eyed man is King.
In the land of the blind, the one-eyed man is King.
First thing I noticed from your pics is your trigger settings in radiant.
You have used the key triggerable but no value.should be 1.
Second you should give the trigger a #set of the gun.Like key #set and a value of 1 for the first trigger and gun.And #set 2 for the second set.
And third,you should set the thread to be used by the trigger.
In radiant use the key setthread and a value of explode_my_bomb for the trigger.
setthread explode_my_bomb
And final targetname trigger2 in radiant for the trigger,should have a $ in front of targetname.(ie: $targetname)
I am not that experianced with objective maps,or scripting for that matter,But I think the information I am providing here is correct.
I will leave it with jv_map,or other compitant mapper to confirm or correct.
You have used the key triggerable but no value.should be 1.
Second you should give the trigger a #set of the gun.Like key #set and a value of 1 for the first trigger and gun.And #set 2 for the second set.
And third,you should set the thread to be used by the trigger.
In radiant use the key setthread and a value of explode_my_bomb for the trigger.
setthread explode_my_bomb
And final targetname trigger2 in radiant for the trigger,should have a $ in front of targetname.(ie: $targetname)
I am not that experianced with objective maps,or scripting for that matter,But I think the information I am providing here is correct.
I will leave it with jv_map,or other compitant mapper to confirm or correct.
Uh sorry CHeesER, but none of your statements are correct
.
Oh well that's about it
.
Nope, the triggerable key doesn't need a value. You can just type it in blank. Note you don't need to set this key as triggers default to triggerable.You have used the key triggerable but no value.should be 1.
No, that's not necessary. Because of the $trigger_name key of the bomb, only one trigger can be designated, so a #set is not needed.Second you should give the trigger a #set of the gun.Like key #set and a value of 1 for the first trigger and gun.And #set 2 for the second set.
That's not necessary either. The trigger is used by the obj_dm bomb_think thread using a 'waittill' command. No need for another bomb explode thread.And third,you should set the thread to be used by the trigger.
Nope, doesn't matter. You can either set $targetname or targetname or both, although both isn't recommended.And final targetname trigger2 in radiant for the trigger,should have a $ in front of targetname.(ie: $targetname)
Oh well that's about it

