Hallo erstmal
ich wollte zum pipeParticle ein sound zuweisen, nur meine frage wie mach ich das am besten? ich hab selber versucht aber es will nicht so wie ich das will kann sein das schon zu späht ist? daswegen frage ich auch hier vieleicht kann mir jemand weiter helfen.
ich danke euch in vorraus
mfg jan
[lua]
--
-- extrapipeSound
-- Specialization for extrapipeSound
--
extrapipeSound = {};
function extrapipeSound.prerequisitesPresent(specializations)
return SpecializationUtil.hasSpecialization(combine, specializations);
end;
function extrapipeSound:load(xmlFile)
local extrapipeSound = getXMLString(xmlFile, "vehicle.extrapipeSound#file");
if extrapipeSound ~= nil and extrapipeSound ~= "" then
extrapipeSound = Utils.getFilename(extrapipeSound, self.baseDirectory);
self.extrapipeSoundPitchOffset = Utils.getNoNil(getXMLFloat(xmlFile, "vehicle.extrapipeSound#pitchOffset"), 0);
self.extrapipeSoundRadius = Utils.getNoNil(getXMLFloat(xmlFile, "vehicle.extrapipeSound#radius"), 50);
self.extrapipeSoundInnerRadius = Utils.getNoNil(getXMLFloat(xmlFile, "vehicle.extrapipeSound#innerRadius"), 10);
self.extrapipeSoundVolume = Utils.getNoNil(getXMLFloat(xmlFile, "vehicle.extrapipeSound#volume"), 1);
self.extrapipeSound = createAudioSource("extrapipeSound", extrapipeSound, self.extrapipeSoundRadius, self.extrapipeSoundInnerRadius, self.extrapipeSoundVolume, 0);
link(self.components[1].node, self.extrapipeSound);
setVisibility(self.extrapipeSound, false);
end;
end;
function extrapipeSound:delete()
end;
function extrapipeSound:readStream(streamId, connection)
end;
function extrapipeSound:writeStream(streamId, connection)
end;
function extrapipeSound:mouseEvent(posX, posY, isDown, isUp, button)
end;
function extrapipeSound:keyEvent(unicode, sym, modifier, isDown)
end;
function extrapipeSound:update(dt)
end;
function extrapipeSound:updateTick(dt)
if self.pipeParticleActivated = true;
setVisibility(self.extrapipeSound, true);
else
setVisibility(self.extrapipeSound, false);
end;
end;
[/lua]