jadav.rakesh Posted January 27, 2012 Share Posted January 27, 2012 Hi guys, I want to store object/instance of an "AmbientSource" Class on CPP side to track all objects on CPP side. We are saving all objects/instances of "Node" class on CPP side using "Unigine::Variable", is it possible to use same for "AmbientSource" Class ? Thanks rakeshj. Link to comment
frustum Posted January 27, 2012 Share Posted January 27, 2012 It's not possible right now. AmbientSource isn't exported into the engine API. Link to comment
jadav.rakesh Posted January 28, 2012 Author Share Posted January 28, 2012 Hi frustum, Thanks for quick reply, so that we can find another solution. One more thing, Is there any way to play "AmbientSource" sound without loading world ? e.g. Menu screen which contains only Gui elements. Thanks, rakeshj. Link to comment
frustum Posted January 28, 2012 Share Posted January 28, 2012 You can create AmbientSource in the system script when you need it. Link to comment
ashwin.sudhir Posted January 31, 2012 Share Posted January 31, 2012 @frustum That's precisely what we did. We created AmbientSources in the system hierarchy and tried playing them. But it seems for you to actually hear the sound, one needs either the World or Editor scripts to be running. We have a custom app and we are playing the AmbientSource from the app, and there's no world or editor script loaded. The moment we load the editor, the sound starts to play and the moment we quit the editor the sound stops. Ditto for world loading. Also, we tried printing the current time of the sound clip etc. to the console; the time is advancing, just that the sound can't actually be heard. Link to comment
manguste Posted February 3, 2012 Share Posted February 3, 2012 For sound to be played (even if it's an ambient sound), a player should be created in your system script unigine.cpp. Without a player, none of sound sources work. Try the following code snippet: log.message("play\n"); AmbientSource source = new AmbientSource("samples/sounds/sounds/static_mono_00.oga"); source.setLoop(1); source.play(); Player p = new PlayerSpectator(); engine.game.setPlayer(p); Link to comment
Recommended Posts