Page 1 of 1

Testing objectives

Posted: Mon Feb 10, 2003 4:31 am
by Faceball
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?

Posted: Mon Feb 10, 2003 6:30 am
by ButtChew
In order to test obj maps, your gonna actually need two people I believe. Not sure though, still new at this :roll:

Posted: Mon Feb 10, 2003 7:23 am
by Gener_AL
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 ..!

Posted: Mon Feb 10, 2003 8:49 pm
by Faceball
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

Image
Image

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?

Posted: Tue Feb 11, 2003 2:11 am
by mohaa_rox
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.

Posted: Tue Feb 11, 2003 7:10 am
by jv_map
$bomb.trigger_name = $trigger2

should be
$bomb.trigger_name = trigger2

Posted: Tue Feb 11, 2003 2:56 pm
by Faceball
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.
LOL....i tried that....no go. That was my whole reason for posting....just wanted to make sure everything was set correctly.
jv_map wrote:$bomb.trigger_name = $trigger2

should be
$bomb.trigger_name = trigger2
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.

I will try and see if that works and post a reply. Thx again

Posted: Tue Feb 11, 2003 10:58 pm
by Faceball
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
Image

bomb
Image

flak
Image


Could me having Spearhead installed be causing me any difficulties? I know it kept me from see some objects before i removed certain files.

Posted: Wed Feb 12, 2003 4:49 pm
by jv_map
You can also type $trigger_name in the entity box as a key with the value you need (the trigger name). Also check your console for errors.

Posted: Wed Feb 19, 2003 10:39 pm
by Bjarne BZR
If you follow my tutorialthere will be hardly no scripting to have errors in... :D

Posted: Thu Feb 20, 2003 7:18 am
by jv_map
In your script, change all occurances of '$bomb' to '$bomb2'.

Posted: Fri Feb 28, 2003 9:19 am
by 6thDLI-Quantum
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.

Posted: Mon Mar 03, 2003 6:32 am
by CHeesER
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.

Posted: Mon Mar 03, 2003 7:35 am
by jv_map
Uh sorry CHeesER, but none of your statements are correct :?.
You have used the key triggerable but no value.should be 1.
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.
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.
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.
And third,you should set the thread to be used by the trigger.
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 final targetname trigger2 in radiant for the trigger,should have a $ in front of targetname.(ie: $targetname)
Nope, doesn't matter. You can either set $targetname or targetname or both, although both isn't recommended.

Oh well that's about it ;).

Posted: Mon Mar 03, 2003 8:51 am
by CHeesER
Thanks jv_map for correcting me.Wrong on all points,dam I've got alot to learn.Oh Well