Alliedassault

Alliedassault (alliedassault.us/index.php)
-   MoH Maps, Mods & Skins (alliedassault.us/forumdisplay.php?f=11)
-   -   Spawning a radio via script with sound (alliedassault.us/showthread.php?t=34215)

loboveloz 01-23-2004 11:57 PM

Spawning a radio via script with sound
 
Hi everyone,

I've tried setting a sound to a object (radio), but every time i set the sound to play it says it needs an alias in ubersound.scr or uberdialog.scr, i have opened the ubersound.scr and used one of the alias that is arleady set for another map, but it still gives me the same error. the script is as follows:

local.radio = spawn script_model "model" "miscobj/radio_civilian.tik" "targetname" "radio"
local.radio.origin = local.position
local.radio.angles = local.angle
local.speaker = spawn script_origin "origin" local.position "targetname" "speaker"
local.speaker glue local.radio
$speaker playsound m2l3_radio1

I don't know if this is the proper way, the script is longer but the rest only contains a trigger that sets the radio on fire and turns the sound off when you fire at it. (some people in my clan hate the music in maps so i thought i would give them a way to turn the radios off) biggrin: .

Thanks for your help

Dragonwraith 01-24-2004 05:47 AM

this works for me

local.fire = spawn script_model
local.fire model "emitters/fire.tik"
local.fire.origin = ( 3239 4143 129)
local.fire.angles = (0 45 0)
local.fire.scale = 2.0
local.fire loopsound fire_large

loopsound will make the sound play over abd over rather than once

loboveloz 01-24-2004 08:39 AM

Making a radio work via Script with sound
 
Thanks for the tip, but the problem is that it says tha in needs an alias in ubersound.scr or uberdialog.scr, i'am using sounds that already have an alias in ubersound.scr and it still gives me the same error. i even added another like to this file, adding dm at the end, so it would start up form Death Match Maps, but still gives the same error oOo:

Dragonwraith 01-24-2004 11:18 AM

in one of my maps I have radio chatter play when a C47 flys overhead, the alias for it is dfr_m3l3_radio

dunno if this helps

loboveloz 01-24-2004 07:04 PM

Nop, still doesn't work
 
Thanks, but it still doesn't work:

I'm posting the entire script, so if you could see where i posibly went wrong, please tell me.

I've set up this script in global/radio.scr so that i can call it from any map, to call this thread from the map script, all you have to do is:


exec global/radio.scr::radio_1 ( x y z ) ( x y z ) // sure you know how to do it, but just in case, as i'm only on the BETA i haven't commented the cript yet.

[code:adc55]radio_1 local.position local.angle:

local.radio = spawn script_model "model" "miscobj/radio_civilian.tik" "targetname" "radio"
local.radio.origin = local.position
local.radio.angles = local.angle
//local.speaker = spawn script_origin "origin" local.position "targetname" "speaker"
//local.speaker glue local.radio
//$speaker playsound mb3_music
local.radio loopsound mb3_music

// spawn the trigger
local.trigger = spawn trigger_multiple targetname "trigger"
local.trigger.origin = local.position
local.trigger.angles = local.angle
local.trigger setsize ( -9 -9 -9 ) ( 9 9 9 )
local.trigger.health = 25
local.trigger takedamage
local.trigger solid


// tag the trigger to the radio
local.radio.trigger = local.trigger

// setup the explosion model


// wait till someone shots the radio
local.trigger waittill trigger
radiusdamage (local.position + (0 0 32)) 50 50
//exec global/model.scr local.position
local.speaker stoploopsound

local.radiofire = spawn script_model
local.radiofire model "models/emitters/fireandsmoke.tik"
local.radiofire.origin = local.position
local.radiofire.angles = local.angle
local.radiofire.scale = 0.2
local.radiofire notsolid
local.radiofire.targetname = "myfire1"
local.radiofire thread firehurts

end

firehurts:

self loopsound fire_med
while(1)
{
for(local.i=1;local.i <= $player.size ; local.i++)
{
if ( $player[local.i] istouching self)
{
iprintlnbold "Que te chamuscas el culo!!!"
self volumedamage 1
$player[local.i] playsound player_death
wait 1
}
}
waitframe
}
end
[/code:adc55]

The message it displays when you touch the fire is in Spanish, only tells you that you're burning your ass.

Thanks for your help, hope you have more luck in finding where i went wrong.

By the way some parts of the code are not mine, as could be the fire damage part. I have the name of the original scripter to give credit, once I've got it working.


All times are GMT -6. The time now is 06:08 AM.

Powered by vBulletin® Version 3.8.12 by ScriptzBin
Copyright ©2000 - 2025, vBulletin Solutions Inc.
© 1998 - 2007 by Rudedog Productions | All trademarks used are properties of their respective owners. All rights reserved.