Game Modding | Call of Duty: Black Ops 3 | Scripting
Spiki:
Jukebox V2
I present to you a clickable jukebox that plays 2d songs (for all players in the map). I was going to make it so that you can choose if you want to hear it but then I remembered that I don't like streamers cuz many of them don't even mention your name or the map name. Imma level with you. I'm not good in lua so if you don't like the design you can go suck a lemon. I pulled parts of the lua code from previous projects, idk who the original scripter was. Prob quentin
Instructions:
1: You need to have lua in your map. If you don't know what that is, this tutorial will be hell for you. 2: Download the GSC from the attachment (change txt to gsc) and drop it in mapname/scripts/zm (or where ever you want i don't care :p). 3: Add the jukebox gsc to your main gsc with a #using and add it to your zone file 4: Copy the following lua code to the bottom your main lua file (not bottom of function):
4: Make some aliases Example:
5: Add aliases to the lua file. In the top of my code you'll see AliasTable and TitlesTable
AliasTable contains aliases TitlesTable contains the names displayed on screen The aliases and titles must be in the same order otherwise wrong sounds will play If ingame it says "Mismatch" in the top left, there aren't the same amount of aliases as titles
You can change the amount of entries per column by changing max_vert from 9 to whatever (check pic above)
ATTENTION: This is a mouse only menu. Controllers are useless here.
Changelog: 2020 04 20 - Release
ModmeBot:
Reply By: Lapin123 How to add new sounds? Can you help me to add sound Do you have a tutorial for this ?
ModmeBot:
Reply By: mathfag
Lapin123 How to add new sounds? Can you help me to add sound Do you have a tutorial for this ?
this is a tutorial. to change sounds just change the alias in the array
ModmeBot:
Reply By: tygo246 Script and sounds are working however the text is not showing up when you are next to the trigger
ModmeBot:
Reply By: mathfag
tygo246 Script and sounds are working however the text is not showing up when you are next to the trigger
fixed
ModmeBot:
Reply By: tygo246 Thanks it's working fine now
ModmeBot:
Reply By: Artleck I'm trying to use this myself. But it isn't working at all, Not even running the script. I have no clue what is happening. But i did make sure that the Trigger multiple has targetname - trig_jukebox and that the code is in MAP_NAME.GSC. Any ideas why this is happening?
ModmeBot:
Reply By: modric Did you thread it properly
ModmeBot:
Reply By: Artleck
modric Did you thread it properly
Yea that was my issue, Thank you!
ModmeBot:
Reply By: Lokii Hey math, just one quick issue, i don't know if i could take this any further in discord but basically, whenever someone walks upto the jukebox and doesn't activate it, the jukebox enable message stays on the screen indefinitely, i have added everything, i even tried to add my own little destroy HUD command, but alas, that didn't work.
ChiefMustardo:
Hi there, I am currently receiving and unexpected token error and I have had a look through the line specified but I can't identify where the typo is. Anybody got any solutions or ran into this problem before?
The Error
The Function
ChiefMustardo:
I've gotten numerous errors from the script now even after fixing the one above so I assume it just fails to work as of 16/10/19
Haxxatoic:
I've gotten numerous errors from the script now even after fixing the one above so I assume it just fails to work as of 16/10/19
I had to parse out a lot of odd characters out of the song_switch function but this is what I ended up with.
The jukebox worked fine for me once I added my linked song aliases to the juke_songs array. Hopefully this helps you.
ChiefMustardo:
Ah ok. I will give it another shot and see. Thanks!