Page 2 of 4

Posted: Tue Jan 04, 2005 9:08 pm
by HDL_CinC_Dragon
i havnt really mastered speakers yet either but, instead if saying

Code: Select all

$speaker loopsound alarm
would it have to be

Code: Select all

$speaker loopsound Mec_Alarm_03
and again, i havnt mastered this but am i right?

Posted: Wed Jan 05, 2005 12:46 am
by Green Beret
he had a sound he called at the top.u can give them nick names

Posted: Wed Jan 05, 2005 2:08 am
by lizardkid
that line was an ubersound (means oversound in German... hmmz...) alias, means he just made Mec_Alarm_2 be alarm. if he so wishes.

Posted: Wed Jan 05, 2005 2:29 am
by panTera
ravage wrote:on my speaker i got :

classname static_miscobj_alarmbell
model static/alarmbell.tik
origin 8.00 48.00 80.00
scale 1.0
targetname speaker
testanim idle
You can't turn a speaker into a static alarmbell model. Make them two seperate things, one alarmbell model and one (invisible) speaker.
First add the static/alarmbell model and leave out the targetname.
Then make a new "script_model" close to the alarmbell model and give it:
Key: model
Value: fx/dummy.tik
and
Key: targetname
Value: speaker

Posted: Wed Jan 05, 2005 3:10 pm
by Green Beret
i use script origins for my speakers.but u can also call sounds from a trigger,so most of the time i dont need a speaker.
on my alarm i got a switch/targetname alarm_switch.
then i got a fx/dummy.tik for my light targetname light.
then i put a cage light near the dummy.tik.
then put a trigger around the switch /targetname alarm_switch_trigger.

Code: Select all

level waittill spawn

end

//alert_switch---------------------------------------------------------------------

alert_switch:

            $alarm_switch_trigger triggerable
            $alarm_switch_trigger waittill trigger
            $alarm_switch anim turn
            $alarm_switch_trigger playsound alarm_switch
            $alarm_switch_trigger loopsound alarmbell//i have an alias cache
            $alarm_switch_trigger nottriggerable
            wait .5
            goto lighton

end

lighton:
            $light light 0 0 1 706
            wait .5
            goto turnoffswitch

end

turnoffswitch:

            $alert_switch_trigger triggerable
            $alert_switch_trigger waittill trigger
            $alert_switch anim off
            $alert_switch_trigger playsound alarm_switch
            $alarm_switch_trigger stop loopsound
            $alert_switch_trigger nottriggerable
            wait .5
            $light light 0 0 0 24
            goto alert_switch

end
works great :wink:

Posted: Wed Jan 05, 2005 5:33 pm
by ravage
i test later thnx for info all

Posted: Wed Jan 05, 2005 8:24 pm
by ravage
can u post the full script completed??


somone mail it to Futuresily@hotmail.com plz *thnx*

Posted: Wed Jan 05, 2005 9:36 pm
by Green Beret
ok,i will even send the .map and a pk3 with everything included 8-)

Posted: Wed Jan 05, 2005 10:55 pm
by Master-Of-Fungus-Foo-D
panTera wrote:
ravage wrote:on my speaker i got :

classname static_miscobj_alarmbell
model static/alarmbell.tik
origin 8.00 48.00 80.00
scale 1.0
targetname speaker
testanim idle
You can't turn a speaker into a static alarmbell model. Make them two seperate things, one alarmbell model and one (invisible) speaker.
First add the static/alarmbell model and leave out the targetname.
Then make a new "script_model" close to the alarmbell model and give it:
Key: model
Value: fx/dummy.tik
and
Key: targetname
Value: speaker
whay cant we just make anything loopsound? why do we ALWAYS have to use an fx/dummy.tik script model????

Posted: Thu Jan 06, 2005 1:33 am
by Green Beret
here is the code..it works great,except i couldnt get the sound to loop,never messed with sound too much.

Code: Select all

// 
// ARCHITECTURE: Green Beret
// SCRIPTING: Green Beret

main:

// set scoreboard messages
setcvar "g_obj_alliedtext1" "alarm"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" " Run"
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""

setcvar "g_scoreboardpic" "NONE"


        local.master = spawn ScriptMaster
        local.master aliascache alarmbell sound/mechanics/Mec_Alarm_07.wav soundparms 1.2 0.0 1.0 0.0 300 12000 item loaded maps "m dm moh obj "

        level waittill prespawn

        thread alert_switch
        $alarm_switch angles 0 180 0

	//*** Precache Dm Stuff
        level.script = maps/dm/alarm_tut.scr//your map name

        level waittill spawn


end

//alert_switch---------------------------------------------------------------

alert_switch:

            $alarm_switch_trigger triggerable
            $alarm_switch_trigger waittill trigger
            $alarm_switch anim turnon
            $alarm_switch_trigger playsound alarm_switch
            $alarm_switch_trigger playsound alarmbell
            $alarm_switch_trigger nottriggerable
            wait .5
            goto lighton

end

lighton:
            $light light 1 0 0 706
            wait .5
            goto turnoffswitch

end

turnoffswitch:

            $alarm_switch_trigger triggerable
            $alarm_switch_trigger waittill trigger
            $alarm_switch anim turnoff
            $alarm_switch_trigger playsound alarm_switch
            $alarm_switch_trigger stopsound alarmbell
            $alarm_switch_trigger nottriggerable
            wait .5
            $light light 0 0 0 24
            goto alert_switch

end
download the pk3 here the .map is in the .pk3

Posted: Thu Jan 06, 2005 12:11 pm
by wacko
to make it complete, here's a pk3 with working loopsound and a little corona added to the light.

I think, u can't add 2 sounds to one entity, so I added another script_model which does the job.
This is the script:

Code: Select all

main:
        local.master = spawn ScriptMaster
        local.master aliascache alarm1 sound/mechanics/Mec_Alarm_07.wav soundparms 1.2 0.0 1.0 0.0 300 12000 auto loaded maps "dm obj"
	
	    level waittill prespawn
		$alarmcorona hide
        thread alert_switch        

	//*** Precache Dm Stuff
        level.script = maps/dm/alarm_tut.scr

        level waittill spawn
end


alert_switch:
while (1)
{
            $alarm_switch_trigger triggerable
//-------------------waiting---------------------------------- 
            $alarm_switch_trigger waittill trigger
            $alarm_switch anim turnon
            $alarm_switch_trigger playsound alarm_switch
            $alarm_switch_trigger nottriggerable
            $light light 1 0 0 100
            $alarmcorona show
            $alarmbell loopsound alarm1
            $alarm_switch_trigger triggerable
//-------------------waiting----------------------------------           
            $alarm_switch_trigger waittill trigger
            $alarmbell stoploopsound
            $alarm_switch anim turnoff
            $alarm_switch_trigger playsound alarm_switch
            $alarm_switch_trigger nottriggerable
            $light light 0 0 0 24
            $alarmcorona hide
}
end

Posted: Thu Jan 06, 2005 12:45 pm
by Green Beret
for some reason when i used the loopsound command,my sound wouldnt play,till i made it playsound.

thnx for the loopsound wacko :wink:

i updated my pk3 and added the loop sound and carona.

http://wolfbattalion.com/alarm_tut.pk3

enjoy :wink:

Posted: Thu Jan 06, 2005 8:26 pm
by HDL_CinC_Dragon
my loopsounds wont work... and i dont feel like posting the long script... but the sounds i have are from pak3 : veh_jeep_on ; veh_jeep_idle ; veh_jeep_move ; veh_jeep_off ; horn. they are all .wav's i found in pak3 that go very well to what i want.... and i also have lighthouse_run ; item_timer_01 ; final_countdown but those 3 sounds work... i have some debugging to do with the actual movements of the thing im making so maybe ill uncover something ive missed several times?

the sounds in red dont work for some reason...

thread_name:
$bot loopsound veh_jeep_on
wait 1
$bot loopsound veh_jeep_idle
wait 1
$bot stoploopsound
$bot loopsound veh_jeep_move
$bot do some stuff
$bot stoploopsound
$bot loopsound veh_jeep_idle
wait 1
$arm loopsound lighthouse_run
$arm rotateX 45
wait 1
$arm rotateX -90
wait 2
$arm rotateX 45
wait 1
$arm rotateX 0
$arm stoploopound

end

theres more to this script but you get the basic idea.
most of the stuff that i want to move and that i have scripted work except for some minor things.

Posted: Thu Jan 06, 2005 8:34 pm
by wacko
dont think the problem is the sound, rather $bot which cant do a loopsound... :?
try to change the sounds veh_jeep_on and so on to lighthouse_run and see whether this works. prob not.
u could also try to change $bot to $arm in the loopsound lines and check this.
maybe bind a speaker to ur bot and let it do the sounds?!

Posted: Thu Jan 06, 2005 10:27 pm
by HDL_CinC_Dragon
well $bot isnt actually an AI bot. its stands for robot.... bot just sounds a little less childish that robot... lol.