Author Topic: Is possible to create sounds by CreateObject() function?  (Read 387 times)

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0
Is possible to create sounds by CreateObject() function?
« on: July 19, 2015, 06:25:22 pm »


               

I want to create the sound resref ="campfire" is possible to create it by typing:


 


object oSound = CreateObject(OBJECT_TYPE_PLACEABLE, "campfire", lLocation);


DelayCommand(fDelay, DestroyObject(oSound));


 


???



               
               

               
            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
Is possible to create sounds by CreateObject() function?
« Reply #1 on: July 19, 2015, 07:54:03 pm »


               

The best way to go about this, when a campfire is created - if your locations are static campfires - is to simply place the sound and make it not active. Then, turn it on via a script.


 


If a character can create a campfire anywhere in an exterior area, then yes, you can create a sound placeable using its resref.


Just remember to use DestroyObject(GetNearestObjectByTag("TAG_NAME") to destroy the nearest sound placeable to the camp location when the campfire is doused.


FP!



               
               

               
            

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0
Is possible to create sounds by CreateObject() function?
« Reply #2 on: July 19, 2015, 09:09:21 pm »


               

Fester Pot, OK. I'll try do it.



               
               

               
            

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0
Is possible to create sounds by CreateObject() function?
« Reply #3 on: July 19, 2015, 09:31:48 pm »


               


If a character can create a campfire anywhere in an exterior area, then yes, you can create a sound placeable using its resref.




 


Does not work. I tried this:



object oSound = CreateObject(OBJECT_TYPE_PLACEABLE,"campfire",GetLocation(OBJECT_SELF));

I can't listen to the sound of campfire


 


I guess because it isn't PLACEABLE and it is SOUND.


 


How to play sound al_cv_firecamp1 by 60 seconds?



               
               

               
            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
Is possible to create sounds by CreateObject() function?
« Reply #4 on: July 21, 2015, 08:15:18 pm »


               

Bummer. Figured it would work. Oh well. '<img'>


 


FP!



               
               

               
            

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0
Is possible to create sounds by CreateObject() function?
« Reply #5 on: July 21, 2015, 08:20:41 pm »


               

I need to loop a campfire sound. The string of the sound is "al_cv_firepit1"