Home   Help Search Login Register  

Author Topic: Replace sound  (Read 790 times)

0 Members and 1 Guest are viewing this topic.

O Neil

  • Guest
Replace sound
« on: 08 Jun 2004, 04:02:37 »
Hey

How would I get a sound file to play when a tank or vehicle starts up ?

(O'Neil

j-man

  • Guest
Re:Replace sound
« Reply #1 on: 08 Jun 2004, 07:10:02 »
Well, you could replace the original sounds with the new one. But that's a bit excesive if it's just for a mission. I suppose you could detect if the vehicle was moving and then play the sound. Just a idea, and probably not the best way to do it :P

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Replace sound
« Reply #2 on: 08 Jun 2004, 07:20:19 »
check the latest version of the ComRef. I think in 1.90 or something some commands like ifengine or engineon were introduced.

:beat: *Gets Shot* :beat:

EDIT: Can't find it but I know I've used it. :-\
« Last Edit: 08 Jun 2004, 07:21:52 by The real Armstrong »

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Replace sound
« Reply #3 on: 08 Jun 2004, 07:24:27 »
Yeeeeeeh! Found it. Wasn't in the ComRef. WTF?

isengineon
Returns true or false I belive.

:beat: *Gets Shot* :beat:

O Neil

  • Guest
Re:Replace sound
« Reply #4 on: 08 Jun 2004, 08:08:02 »
Hey

Soz, not into scripting very well, wtf do I do with it ? ;)

(O'Neil

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Replace sound
« Reply #5 on: 08 Jun 2004, 09:45:16 »
Quote
not into scripting very well
Quote
Scripted Cut-Scene scripter
???

Dilemma... ??

;D


I think you can use this even in a trigger:

cond.:  isEngineOn
on Act.: vehicleName say "soundName"

Or then in a script like:

@isEngineOn
vehicleName say "sound"

or the same with a loop (well, sort of..)...

#lyyp
? isEngineOn: goto "playSound"
~.5
goto "lyyp"

#playSound
vehicleName say "soundName"


And for the record, no guarantees on anything I say... :P
« Last Edit: 08 Jun 2004, 09:47:12 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Replace sound
« Reply #6 on: 08 Jun 2004, 10:54:11 »
I'm not at home now so I ain't sure but I can check the script later. However, I think it was something like:

? !(isengineon _whatever) : tjommitjommitjommi

This checks if engine is off on the vehicle _whatever, thus the !, which I think you know means Not.

So if you want to wait untill vehicle has his engine on and then, say, put a hint in you do this:

@ (isengineon _whatever) : hint format ["%1 just put his engine on!", _whatever]

Happy cutscening (like your cutscene page btw)

:beat: *Gets Shot* :beat:

andersgrim

  • Guest
Re:Replace sound
« Reply #7 on: 08 Jun 2004, 15:06:00 »
That will loop the script (which might cause lag), so I'd rather go for eventhandlers - to get rid of the looping.

Something like this would be it (not sure if this is correct though):

unitName addEventHandler ["Engine",if (_this select 1) then {[_this select 0] exec "yourscript.sqs"}]

and in yourscript.sqs:
unitName say "soundName"

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Replace sound
« Reply #8 on: 08 Jun 2004, 15:28:39 »
Using an @ won't make the script to loop.

:beat: *Gets Shot* :beat:

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Replace sound
« Reply #9 on: 08 Jun 2004, 17:07:07 »
Quote
so I'd rather go for eventhandlers
Right..
Totally forgot that there was that EH too...
That would be the way to go...

Quote
Using an @ won't make the script to loop.
Well, it sort of does as it stops the script there and checks in every frame if the condition is met, so it kinda loops the 'question'... ::)
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

andersgrim

  • Guest
Re:Replace sound
« Reply #10 on: 08 Jun 2004, 20:05:51 »
Using an @ won't make the script to loop.

It sure does mate ;)
Can't remember the exact number, but something tells me it looped back to check every 0.5 second ;)

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Replace sound
« Reply #11 on: 08 Jun 2004, 20:51:57 »
0.5 seconds correct (just like a trigger) . The reason I said the previous was that I thought he mixed it with the questionmark (?) which you will have to loop if you want to check it again. :)

:beat: *Gets Shot* :beat:

O Neil

  • Guest
Re:Replace sound
« Reply #12 on: 09 Jun 2004, 09:11:16 »
Hey

Lol, caught be out Hater_kint. Cut-Scene scripting is all I can do, trust me, I'm no good at ANYTHING else.

Anys, thxs for all your help guys, be trying it out soon ;)

(O'Neil