Home   Help Search Login Register  

Author Topic: Creating sound objects  (Read 937 times)

0 Members and 2 Guests are viewing this topic.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Creating sound objects
« on: 21 Apr 2005, 15:43:55 »
I want to create a sound object.

I put an empty Abrams and a sound object on an empty map.  In the mission file I found the following:

Code: [Select]
   class Vehicles
   {
      items=2;
      class Item0
      {
         position[]={6208.428223,337.511169,6405.082031};
         id=1;
         side="EMPTY";
         vehicle="Dog";
         skill=0.600000;
      };
      class Item1
      {
         position[]={6221.935547,335.428680,6398.851563};
         id=2;
         side="EMPTY";
         vehicle="M1Abrams";
         skill=0.600000;
      };
   };

So the sound for a Dog and an empty Abrams both just empty objects.
To create another empty Abrams I have a trigger with the code:

Code: [Select]
snd = "M1Abrams" createVehicle getPos playerBut when I try to create a sound object in the same way:
Code: [Select]
snd = "Dog" createVehicle getPos playerOFP crashes to windows.

Does anyone have any experience with this?
« Last Edit: 21 Apr 2005, 15:45:45 by THobson »

Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:Creating sound objects
« Reply #1 on: 21 Apr 2005, 16:31:57 »
Can't quite see where the 'sounds are objects' idea is coming from.
The only 'non-trigger' way I've used to place a sound (as in a cfgSound sample) is to use an invisible object - like a GL or HeliH - and then get that unit to 'Say' the desired sound.  It might also work with on-map objects and it might also work with the looped sound effects in the triggers.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Creating sound objects
« Reply #2 on: 21 Apr 2005, 18:04:00 »
When you place an 'Empty' unit on the map one of the options is 'Sound'.  And it works, it puts a sound object on the map.
« Last Edit: 21 Apr 2005, 18:25:19 by THobson »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Creating sound objects
« Reply #3 on: 21 Apr 2005, 18:15:46 »
More than likely you just can't camCreate a sound object.

Can they be setPossed?
Plenty of reviewed ArmA missions for you to play

Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:Creating sound objects
« Reply #4 on: 21 Apr 2005, 18:24:09 »
Ahh - didn't read the first post properly, did I!
Have you tried CamCreate-ing the sound, instead of CreateVehicle-ing it?  Could be a difference between an 'object' and a 'unit' thats causing the CTD.  Just a guess - CreateVehicle is not a command I've used.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Creating sound objects
« Reply #5 on: 21 Apr 2005, 18:24:40 »
I hope so setPos was my fall back, but I only really want the CPU load when I have to.

I will also try a camCreate rather than a createVehicle.  What struck me though was the similarity between an Abrams and Dog in the mission file.  I had better tell mikero this ;D
« Last Edit: 21 Apr 2005, 18:28:45 by THobson »

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Creating sound objects
« Reply #6 on: 21 Apr 2005, 18:41:07 »
What a pain!

A sound object cannot be camCreated not can it be setPossed.  In fact doing a getPos select x results in the famous scalar boolean thingy.  In other words its location is undefined.

So I now have to either use a trigger that I can setPos in or write a script to loop the sound.

Ho joy.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Creating sound objects
« Reply #7 on: 21 Apr 2005, 19:48:17 »
The class Dog is defined in the config under class Sounds which is under cfgVehicles.

It has no model name though.

Here is something for you to try:

cr = "Crater" createvehicle getpos player

This also has no model defined, but it does have an effect.


Planck
I know a little about a lot, and a lot about a little.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Creating sound objects
« Reply #8 on: 22 Apr 2005, 06:43:21 »
Interesting.  Crater is an odd name for what happens.  I looked through the commented config files and do see that none of the sounds have a model.  It doesn't explain for me why I get a CTD with a sound and not with other things that have no model.  Anyway I will just treat this as a fact of life and work round it.

Thanks.  I seems like you have memorised these config files :)

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Creating sound objects
« Reply #9 on: 22 Apr 2005, 16:00:13 »
I believe the keyword here is simulation...
The crater has simulation="crater"...

Simulations contain some hardcoded stuff...
It seems to be so that the simulation is what determines which values the game engine uses from the class the simulation has been put under...

For example putting definitions of a tank under a class that has simulation="car" completely ignores those tank related values, unless some of them are used with car class vehicles as well...
Same goes for all simulations...

Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Creating sound objects
« Reply #10 on: 22 Apr 2005, 19:55:54 »
Quote
Thanks.  I seems like you have memorised these config files

Well, I have poked around them fairly extensively, also doing the P3D Project had me looking at every game P3D file for its list of textures.   ::)  ::)


Planck
I know a little about a lot, and a lot about a little.