dogs in snowy park

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

dogs in snowy park

Post by wacko »

wanted to let some dogs bark in my map and thought it to be a good idea to take a look in the script of mohdm5 (snowy park) where there are some barks
problem is i do not find anything doggy in this script nor in ambience.scr.
where/how do they let the dogs out?
smartaiguy
Brigadier General
Posts: 512
Joined: Tue Jul 08, 2003 2:52 pm

Post by smartaiguy »

I believe dogs work just like human ai, just they can't drive and man machineguns (OH NO a dog is driving, look out! :lol: ) Thats my guess
Fallschirmjager in europe(FIE)! (Mapper/Webmaster)
.Map map reviewer
Look up in the sky! Its a bird its a plane, oh wait its a bird.:lol:
panTera
Brigadier General
Posts: 573
Joined: Wed Jan 29, 2003 11:46 pm
Location: The Netherlands
Contact:

Post by panTera »

Alright, take a look at the music files in pak0 => mohdm5.mus:

path sound/amb_stereo

normal Amb_M6_ParkAreaExt.mp3 // Plays over entire level

!normal volume 1
!normal loop

The mp3 is in sound\amb_stereo. So my guess is when you put in "exec global/ambient.scr mohdm5", this part of the ambient.scr: -> local.string = ("music/" + local.music + ".mus") executes the mohdm5.mus file and it starts playing the Amb_M6_ParkAreaExt.mp3 with the howling dog sounds in it. So it's not a random dogbark script or anything like that, just a mp3.
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

thanks pantera, this is how it must have be done.

unfortunately not really what i was hoping to find, i wanted rather the scripted random dogbark coming from a speaker. The barking mustn't be heard from inside the building (snowy park has none), so this probably won't work for me.
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

Hurray, I built a BARK-O-MAT!

In the map, there's now a script_model with
targetname/bark_o_mat
model/fx/dummy.tik
always_draw checked

just where the dog shall bark.

In the script, I did

Code: Select all

main:
local.master=spawn ScriptMaster
local.master aliascache b_1 sound/characters/dog_bark_1.wav soundparms 1.5 0.0 0.8 0.4 160 4000 voice loaded maps "dm "
local.master aliascache b_2 sound/characters/dog_bark_2.wav soundparms 1.5 0.0 0.8 0.4 160 4000 voice loaded maps "dm "
local.master aliascache b_3 sound/characters/dog_bark_3.wav soundparms 1.5 0.0 0.8 0.4 160 4000 voice loaded maps "dm "
local.master aliascache b_4 sound/characters/dog_bark_4.wav soundparms 1.5 0.0 0.8 0.4 160 4000 voice loaded maps "dm "
local.master aliascache b_5 sound/characters/dog_bark_5.wav soundparms 1.5 0.0 0.8 0.4 160 4000 voice loaded maps "dm "
level waittill spawn
thread dog_bark
end

dog_bark:
//by wacko (woof, woof)
level.bark_times=(randomint(11)+1)
wait (randomint(20) + 20)
for (level.times_barked=1;level.times_barked<=level.bark_times;level.times_barked++)
{
level.bark_num=(randomint(5)+1)
level.bark_style="b_"+level.bark_num
$bark_o_mat playsound level.bark_style
level.bark_wait=(randomfloat(1)+.5)
wait level.bark_wait
}
goto dog_bark
end
This bark-o-mat can
bark in 5 randomized ways
with a randomized waittime between the single barks
for a randomized number of times, then
wait a randomized time until it starts again
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

Image i knew we'd make a scripter out of ya Image

good work matey :D
hope this helps, prob not cos it's all foreign 2 me :-/
echo_rancid
Captain
Posts: 264
Joined: Sat Jan 31, 2004 4:31 pm

Post by echo_rancid »

Hey wacko, first of all Can I use this in a map I made, since you did make it I thought I should ask. Ive been playing with it but no sound. I have a scr file in my pk3, does this script go in there or can I make a seperate script just for the dog bark?
Image
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

why, of course you can!
put that script into the existing script. u also could take a look at that decalattack map (->recyclingbin) where those dogs are barking.
echo_rancid
Captain
Posts: 264
Joined: Sat Jan 31, 2004 4:31 pm

Thanks

Post by echo_rancid »

Thanks Wacko, Ill take a look.
Image
Post Reply