Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. Also, your doorframe should be lvl 3, so you need to upgrade it.
  3. Today
  4. ATPHHe

    getMusicPosition()

    Here you go, you can stop all music that is forced to play by muting like this. -- Mute Music getSoundManager():setMusicVolume(0.0); -- Unmute Music getSoundManager():setMusicVolume(getCore().getOptionMusicVolume() / 10.0);
  5. ATPHHe

    getMusicPosition()

    Ah, getPosition() doesn't work now that I have tested it. It's only mean't for "Music" objects and doesn't work with the "SoundManager" object.
  6. Nebula

    getMusicPosition()

    getSoundManager():getPosition() Gives an error
  7. Nebula

    getMusicPosition()

    float getPosition() Return the current playing position in the sound Returns: The current position in seconds. Hm. I just don’t understand how to adapt this to my sound?
  8. ATPHHe

    getMusicPosition()

    You're welcome. Glad to try and help out. Hopefully this function will be added sometime in an update.
  9. Nebula

    getMusicPosition()

    I also tried everything .... I did not achieve a result. by getSoundManager (): StopMusic () - the current vanilla track stops, and the next one starts playing immediately. getSoundManager (): playMusic ("1") - nothing happens ... silence ... In any case, thanks for the help! You have clarified.
  10. ATPHHe

    getMusicPosition()

    I looked all over the SoundManager class and could not find a way to get the timeline position of Sounds. The devs may have to add the function or feature for sounds, or the function "PlayAsMusic" would need to be finished.
  11. Try going to "C:\Users\YourUserName\Zomboid" and upload the "console.txt" and "logs.zip" files from there. You can just attach them to your next message, they contain useful information and we can check what exactly causes the problem.
  12. ATPHHe

    getMusicPosition()

    Ah, I took a closer look at "PlayAsMusic()" and I guess the function "getSoundManager():PlayAsMusic("1", obj, false, 1)" has not been implemented/finished yet. There's no getSoundPosition for sounds that I could find in the Decompiler yet. You can stop music with "getSoundManager():StopMusic()" You can try calling "playMusic()", then printing out the time. I used the parameter String "1". getSoundManager():playMusic("1")
  13. Nebula

    getMusicPosition()

    OK. But this only works with music from the Zomboid itself, but how can I do this for the sound that I launch? local obj = getSoundManager():PlaySound("1",false,1); getSoundManager():PlayAsMusic("1",obj,false,1); And by the way, it doesn’t overlap the music built into the zomboid for me ... How can I turn it off while my track is playing?
  14. @leon2356Will try it out! I have one small suggestion though, you should add the profession framework as a dependency for your workshop mod, so that if people subscribe to your mod they automatically get PFM. @Fenris_WolfShould I bump the version on the workshop?
  15. Nebula

    getMusicPosition()

    To go nuts! Thank you very much for your help!
  16. ATPHHe

    getMusicPosition()

    You can use "getSoundManager():getMusicPosition()". You can also test and play around with "getSoundManager():getPosition()". Both functions "getMusicPosition()" and "getPosition()" return only floats. To be exact, they both return Time Elapsed in milliseconds (ms). To get seconds, you need to divide the music position by 1000. local sound_position = getSoundManager():getMusicPosition() local totalSeconds = sound_position / 1000 I created a function that prints the time of the music being played in many various forms. You can choose which time formats you'd like from this, or you can edit or reference this code. -- Prints in various forms, the current elapsed time of the music that is currently playing. function printCurrentMusicTime(isoPlayer) local sound_position = getSoundManager():getMusicPosition() print(string.format("Current Music Time Elapsed (ms): %.2f", sound_position)) local totalHours = sound_position / 1000 / 60 / 60 local totalMinutes = sound_position / 1000 / 60 local totalSeconds = sound_position / 1000 print(string.format("Current Music Time Elapsed (hours): %.1f", totalHours)) print(string.format("Current Music Time Elapsed (minutes): %.1f", totalMinutes)) print(string.format("Current Music Time Elapsed (seconds): %.1f", totalSeconds)) local totalHoursRounded = math.floor(sound_position / 1000 / 60 / 60) local totalMinutesRounded = math.floor(sound_position / 1000 / 60) local totalSecondsRounded = math.floor(sound_position / 1000) print(string.format("Current Music Time Elapsed (hoursRounded): %.1f", totalHoursRounded)) print(string.format("Current Music Time Elapsed (minutesRounded): %.1f", totalMinutesRounded)) print(string.format("Current Music Time Elapsed (secondsRounded): %.1f", totalSecondsRounded)) local music_clock = millisecondsToClock(sound_position) print(string.format("Music Clock: %s", music_clock)) end -- Returns a clock as a String in "hh:mm:ss" format. function millisecondsToClock(ms) local sec = tonumber(ms)/1000 if sec <= 0 then return "00:00:00"; else local hours = string.format("%02.f", math.floor(sec/3600)); local minutes = string.format("%02.f", math.floor(sec/60 - (hours*60))); local seconds = string.format("%02.f", math.floor(sec - hours*3600 - minutes*60)); return string.format("%s:%s:%s", hours, minutes, seconds) end end Events.OnRenderTick.Add(printCurrentMusicTime) When this function "printCurrentMusicTime" is called, it prints the various time formats on console. Here's the actual SoundManager functions. I hope this all helps. Enjoy MusicTimePrinter.lua
  17. Just released my first full mod! Get a job! https://steamcommunity.com/sharedfiles/filedetails/?id=2040632854 Thanks again for making profession framework. Had a lot of fun making my mod and I made sure to credit you! If you want I can friend you on steam and credit you as a co-creator. Now I just got to learn how to make traits.
  18. I just found it like literally 5 seconds ago LOL! Thanks.
  19. \Users\...\Zomboid\Workshop Place the folder with your mod in the specified path ... There is already a folder \ ModTemplate - this is an example of how everything should be. Next, launch the Zomboid and go to the menu on the Workshop tab
  20. I'm new to modding and I just made my first mod. But I can't find out how to upload it to the steam workshop. Can anyone point me to a guide or tutorial on how to do it? Thanks.
  21. Nebula

    getMusicPosition()

    I start playing sound ... local obj = getSoundManager():PlaySound("1",false,1); getSoundManager():PlayAsMusic("1",obj,false,1); How do I get his position in seconds? sound_position = getSoundManager():getMusicPosition():PrepareMusic("1"); I will try this way, but I get an error. Tell me the right way.
  22. Yesterday
  23. When the drag-down animation starts, all you have to do is quit the game, sign back in to your save, hit shift on the loading screen and pray that your character wasn't bitten. The video below shows everything.
  24. Hi, I propose to add: - The effect of clean clothes on boredom; (Wearing dirty, wet clothes from the dead to increase one-time boredom). - The effect of food temperature; (warm food may slightly increase saturation (by about 3-5%) while lowering cold food (by about 7-10%) this probability can be applied to boredom. Based on this mechanics, you can add perks: neat, dirty. (increasing / decreasing the effect of boredom). A tourist may not have a negative impact on food.
  25. I for one want deathblows with long blade or axe weapons to have a chance to decapitate zombies. Who's with me?
  26. Imagine the opposite of a panic moodle, which is when your character drops a couple of zombies who have caused them panic in the first place.
  1. Load more activity
  • Newsletter

    Want to keep up to date with all our latest news and information?
    Sign Up
×
×
  • Create New...