Jump to content

Recommended Posts

I'm trying to have the game run a randomization everytime you change from the main menu/item collection, so far I got this much working on the modmain.lua

(I'm a total noob at .lua lmao)

 

local array={"_box","_1"}                                        
local randomIndex = math.random(1, #array)
local stuff = array[randomIndex]


RemapSoundEvent("dontstarve/HUD/Together_HUD/collectionscreen/music/jukebox","music_mod/music/juke"..stuff)

 

This chooses between juke_box and juke_1 for the item collection, the problem is that it only runs once, and stays like that until the entire main menu is reloaded (Like when you Apply Mods)

Anyone know what kind of 'if' statement and condition I would need for the randomization to happen everytime the item collection screen is exit/returning from it, to main menu?

4 hours ago, Sukaiba said:

I'm trying to have the game run a randomization everytime you change from the main menu/item collection, so far I got this much working on the modmain.lua

(I'm a total noob at .lua lmao)

 

local array={"_box","_1"}                                        
local randomIndex = math.random(1, #array)
local stuff = array[randomIndex]


RemapSoundEvent("dontstarve/HUD/Together_HUD/collectionscreen/music/jukebox","music_mod/music/juke"..stuff)

 

This chooses between juke_box and juke_1 for the item collection, the problem is that it only runs once, and stays like that until the entire main menu is reloaded (Like when you Apply Mods)

Anyone know what kind of 'if' statement and condition I would need for the randomization to happen everytime the item collection screen is exit/returning from it, to main menu?

I remember that in FMOD there is an option to play sounds randomly, which seems easier than scripting, at least for me.

12 hours ago, Haruhi Kawaii said:

I remember that in FMOD there is an option to play sounds randomly, which seems easier than scripting, at least for me.

Oh yeah, I am aware its possible to randomize it

The problem is that it for example with 'juke_1', that's an event that has an 'intro' (plays once) and a 'loop' (after intro) soundfile

While 'juke_box' can pick randomly and loop whatever soundfile picked, there's no way to tell the randomization to play one sound once, and then keep looping another afterwards, hence why I'm looking for a way to randomize the sound event selection instead

Edited by Sukaiba

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...