Modme Forums

i used: SG4Y Flahlight

Game Modding | Call of Duty: Black Ops 3 | Scripting


Viralinvlent:

hey i just added some code for a flashlight and it seems to not work and i only get these errors:
"R:\steam games\steamapps\common\Call of Duty Black Ops III\sound\snd_convert.exe" pc usermaps\zm_test usermaps\zm_test zone_source usermaps\zm_test english zm_test
ERROR: r:\steam games\steamapps\common\call of duty black ops iii\share\raw\sound\aliases\user_aliases.csv
ERROR: '//flashlight' Line Number: 0
ERROR: Parse error in column 'VolumeGroup'. Value 'VolumeGroup' is not valid. //flashlight had empty field VolumeGroup.
ERROR: '//flashlight' Line Number: 0
ERROR: Parse error in column 'DuckGroup'. Value 'DuckGroup' is not valid. //flashlight had empty field DuckGroup.


sharpgamers4you:

Can you send the exact code/script?


mrlednor:

if u didnt fix this then remove this line out your csv its not needed '//flashlight'


mario807906:

Can you send the exact code/script?

am I able to turn the flash light on and off at will if so how do I do that or even am I able to to make it where when u go in a room it turns off automatically


Sleepy216:

am I able to turn the flash light on and off at will if so how do I do that or even am I able to to make it where when u go in a room it turns off automatically

If you are using the flashlight script i think you are, you turn it off by double tapping the USE key.
If you didn't want it to do that, you can remove the function, and script the flashlights to only be on while a player is touching a trigger multiple.
If you were wanting to do something like nightmare, you just set the clientfield for each player when you want them to turn on.


mario807906:

If you are using the flashlight script i think you are, you turn it off by double tapping the USE key.
If you didn't want it to do that, you can remove the function, and script the flashlights to only be on while a player is touching a trigger multiple.
If you were wanting to do something like nightmare, you just set the clientfield for each player when you want them to turn on.

it only came with the script to use it didn't have any function to turn it off or trigger multiple room things. do you happen to have it or do you have a link to find it.


Sleepy216:

You'd have to script it yourself, the flashlight script(at least the one I found online) just allows the player to turn on/off the flash light by double tapping the USE key. However it'd be pretty easy to change it for what you are wanting.
How exactly are you wanting the flashlight to function?


mario807906:

You'd have to script it yourself, the flashlight script(at least the one I found online) just allows the player to turn on/off the flash light by double tapping the USE key. However it'd be pretty easy to change it for what you are wanting.
How exactly are you wanting the flashlight to function?

I want it to just be turned off and on by the player by say just cliking f or something but I tried in game by double clicking but it didn’t work. I don’t really know how to script so if u have a script I can use that be pretty cool.


Sleepy216:

I want it to just be turned off and on by the player by say just cliking f or something but I tried in game by double clicking but it didn’t work. I don’t really know how to script so if u have a script I can use that be pretty cool.

https://forum.modme.co/threads/usable-flashlight.1213/
this is the one i use, it works like that.


mario807906:

https://forum.modme.co/threads/usable-flashlight.1213/
this is the one i use, it works like that.

i downloaded it and nothing is happenning. my map loads but there is no flash light in game.


mario807906:

https://forum.modme.co/threads/usable-flashlight.1213/
this is the one i use, it works like that.

is there a way to modify or add a script in sg4y's thing. because I tried and downloaded the link one and it didn't work.


Sleepy216:

is there a way to modify or add a script in sg4y's thing. because I tried and downloaded the link one and it didn't work.

Sorry I don't know who that is, or where their flashlight script is. If you download the script from the megalink in the post by dreamzyy , it should work for you.
Like i said, I use it right now, and it works great. The only thing that is wonky with it is throwing nades breaks the flashlight, but after you get it installed, I can send you the fix I made for that issue.


mario807906:

Sorry I don't know who that is, or where their flashlight script is. If you download the script from the megalink in the post by dreamzyy , it should work for you.
Like i said, I use it right now, and it works great. The only thing that is wonky with it is throwing nades breaks the flashlight, but after you get it installed, I can send you the fix I made for that issue.

yeah I've already downloaded it are u able to send the fix.


sharpgamers4you:

You can add script (functions) where it triggers the flashlight when you go into a room using trigger multiple.

I am on vacation so can't help at this moment


mario807906:

You can add script (functions) where it triggers the flashlight when you go into a room using trigger multiple.

I am on vacation so can't help at this moment

but i want the player to have the choice to turn it off or on but thanks sg4y.


Sleepy216:

but i want the player to have the choice to turn it off or on but thanks sg4y.

Well I am smooth brained. I thought "sg4y" was someones username, not a shortened version of someones username haha.
For the fix open the .gsc that you add the flashlight script to.
find this function:
function flashlight_watch_usebutton()

replace the entire function with this one:

function flashlight_watch_usebutton()
{
    self endon( "kill_flashlight" );   
    while( 1 )
    {
        if(self IsThrowingGrenade() && self.flashlight_enabled == true )
        {
            self flashlight_state( "OFF" );
            while(self IsThrowingGrenade())
            {
                wait(.05);
            }
            self flashlight_state( "ON" );
        }
        if( self UseButtonPressed() )
        {
            catch_next = false;
            for( i = 0; i <= 0.5; i += 0.05 )
            {
                if( catch_next && self UseButtonPressed() )
                {
                    if( !self.flashlight_enabled )
                    {
                        self flashlight_state( "ON" );
                        wait 1;
                        break;
                    }

                    else
                    {
                        self flashlight_state( "OFF" );
                        wait 1;
                        break;
                    }
                }

                else if( !( self UseButtonPressed() ) )
                    catch_next = true;

                wait 0.05;
            }
        }
        wait 0.05;
    }
}


mario807906:

aaaay it works but do you know how when u use it to make it make the button click noise when u turn it off and on, the sound assets and alias came with it i just need to know how to make it play.


Sleepy216:

aaaay it works but do you know how when u use it to make it make the button click noise when u turn it off and on, the sound assets and alias came with it i just need to know how to make it play.

I'm glad it worked for you. So you can open the sound alias they gave and copy the line into a sound alias you are already using in your map, or you can just include that sound alias as well. I recommend just copying the one line to another alias since it is the only thing in there.
1_flashlight_click,,,custom\flashlight\flashlight_click.wav,,,UIN_MOD,,,,,,,,,0,0,100,100,0,100,300,,,,,,,,,,,,,,,,3d,,,NONLOOPING,,,0,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
That's the line you want to add to one of your aliases.

If you want to add their alias, you can include it in the file located here
root\usermaps\yourmapname\sound\zoneconfig : open yourmapname.szc

only do one or the other, you don't want duplicate sounds


mario807906:

I'm glad it worked for you. So you can open the sound alias they gave and copy the line into a sound alias you are already using in your map, or you can just include that sound alias as well. I recommend just copying the one line to another alias since it is the only thing in there.
1_flashlight_click,,,custom\flashlight\flashlight_click.wav,,,UIN_MOD,,,,,,,,,0,0,100,100,0,100,300,,,,,,,,,,,,,,,,3d,,,NONLOOPING,,,0,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
That's the line you want to add to one of your aliases.

If you want to add their alias, you can include it in the file located here
root\usermaps\yourmapname\sound\zoneconfig : open yourmapname.szc

only do one or the other, you don't want duplicate sounds

hey is this for the sg4y or the other one because it doesn't work for me I am using sg4ys, but when I try to use the other one it never works i put everything in where it is supposed to but i never get a flashlight in game i think it mainly because it doesn't give you anything to put in your gsc and csc unlike sg4y which includes a read me instructions. idk tho


Sleepy216:

hey is this for the sg4y or the other one because it doesn't work for me I am using sg4ys, but when I try to use the other one it never works i put everything in where it is supposed to but i never get a flashlight in game i think it mainly because it doesn't give you anything to put in your gsc and csc unlike sg4y which includes a read me instructions. idk tho

Like I said I don't have sg4y's script. For all I know this is a version of his. Unless Dreamzzy actually made it, which isn't specifically stated just that it was used, nor does it say in the readme file. unless xoxor4d is a username.

I'm guessing that you didn't look at the folders before dragging and dropping them to your root folder?
because there's a folder for "yourmap" which has ther scripts you need to add to your file.
"flashlight\usermaps\yourmap\scripts\zm\"
That's where the 2 scripts called "zm_yourmap.csc/gsc" are.
you just add each chuck of code realtive to where it is in those scripts. that is also where the .zone stuff it that you need to add to your maps zonefile. well it's a few folders back.


mario807906:

Like I said I don't have sg4y's script. For all I know this is a version of his. Unless Dreamzzy actually made it, which isn't specifically stated just that it was used, nor does it say in the readme file. unless xoxor4d is a username.

I'm guessing that you didn't look at the folders before dragging and dropping them to your root folder?
because there's a folder for "yourmap" which has ther scripts you need to add to your file.
"flashlight\usermaps\yourmap\scripts\zm\"
That's where the 2 scripts called "zm_yourmap.csc/gsc" are.
you just add each chuck of code realtive to where it is in those scripts. that is also where the .zone stuff it that you need to add to your maps zonefile. well it's a few folders back.

Like I said I don't have sg4y's script. For all I know this is a version of his. Unless Dreamzzy actually made it, which isn't specifically stated just that it was used, nor does it say in the readme file. unless xoxor4d is a username.

I'm guessing that you didn't look at the folders before dragging and dropping them to your root folder?
because there's a folder for "yourmap" which has ther scripts you need to add to your file.
"flashlight\usermaps\yourmap\scripts\zm\"
That's where the 2 scripts called "zm_yourmap.csc/gsc" are.
you just add each chuck of code realtive to where it is in those scripts. that is also where the .zone stuff it that you need to add to your maps zonefile. well it's a few folders back.

Oh frik I guess I didn’t do it right-well imma go and retry the other one instead of sg4ys and see I can get it to work sorry for me stupidity. Thanks man I will update if it doesn’t work.


Sleepy216:

Oh frik I guess I didn’t do it right-well imma go and retry the other one instead of sg4ys and see I can get it to work sorry for me stupidity. Thanks man I will update if it doesn’t work.

It's all good! I can't tell you how many times I've looked over a simple fix. Sorry if my reply sounded entitled or douchey, that wasn't my intention.
Good luck and I hope it works for you


Holofya:

Oh boy. So I guess there isn't a release for the flashlight, just small conversations that have links here and there. I'm pretty sure Sleepy216 has the script that I modified when Mr. Lednor discovered the fx broke when the player throws a grenade. I'm going to drop the latest flashlight I have in a release as soon as I finish up the last few tweaks and I'll put the linkie here. Probably best to have a release as a consolidated spot for flashlight talk anyway.


mario807906:

It's all good! I can't tell you how many times I've looked over a simple fix. Sorry if my reply sounded entitled or douchey, that wasn't my intention.
Good luck and I hope it works for you

no u good man and thanks


mario807906:

Oh boy. So I guess there isn't a release for the flashlight, just small conversations that have links here and there. I'm pretty sure Sleepy216 has the script that I modified when Mr. Lednor discovered the fx broke when the player throws a grenade. I'm going to drop the latest flashlight I have in a release as soon as I finish up the last few tweaks and I'll put the linkie here. Probably best to have a release as a consolidated spot for flashlight talk anyway.

hey that be awesome man.


dakh:

If you are using the flashlight script i think you are, you turn it off by double tapping the USE key.
If you didn't want it to do that, you can remove the function, and script the flashlights to only be on while a player is touching a trigger multiple.
If you were wanting to do something like nightmare, you just set the clientfield for each player when you want them to turn on.

It would be great if you could give me a script that would turn on the flashlight when the player touches the trigger.


mario807906:

It would be great if you could give me a script that would turn on the flashlight when the player touches the trigger.

he did read through all of the conversation.


Sleepy216:

Oh boy. So I guess there isn't a release for the flashlight, just small conversations that have links here and there. I'm pretty sure Sleepy216 has the script that I modified when Mr. Lednor discovered the fx broke when the player throws a grenade. I'm going to drop the latest flashlight I have in a release as soon as I finish up the last few tweaks and I'll put the linkie here. Probably best to have a release as a consolidated spot for flashlight talk anyway.

So are you the original creator of the flashlight script? I would like to properly credit the maker of the script, I'd feel like a dbag otherwise.
Thanks for taking your time to fix it up, can't wait for the release!

It would be great if you could give me a script that would turn on the flashlight when the player touches the trigger.

I haven't scripted one, I only made a fix for the flashlight breaking when throwing grenades. I was just saying it wouldn't be difficult to change the existing flashlight script to function with triggers.
If Holofya's new script is just the Double tap USE key, I can probablly make it for you. However I don't want to do something if they already did it themselves haha


mario807906:

Oh boy. So I guess there isn't a release for the flashlight, just small conversations that have links here and there. I'm pretty sure Sleepy216 has the script that I modified when Mr. Lednor discovered the fx broke when the player throws a grenade. I'm going to drop the latest flashlight I have in a release as soon as I finish up the last few tweaks and I'll put the linkie here. Probably best to have a release as a consolidated spot for flashlight talk anyway.

sorry to be annoying but any update on that flashlight.


sharpgamers4you:

hey is this for the sg4y or the other one because it doesn't work for me I am using sg4ys, but when I try to use the other one it never works i put everything in where it is supposed to but i never get a flashlight in game i think it mainly because it doesn't give you anything to put in your gsc and csc unlike sg4y which includes a read me instructions. idk tho

Make sure you specify the folders in the sounds, because it will work since it has the same name "flashlight_click"
Should work double check, and try to add it into your useraliases so it's definitely implemented into your map/mod


Harry Bo21:

Make sure you specify the folders in the sounds, because it will work since it has the same name "flashlight_click"
Should work double check, and try to add it into your useraliases so it's definitely implemented into your map/mod

He said none of it works

He said nothing about sounds

Most likely case is he hasn’t added the #using in gsc/csc


mario807906:

He said none of it works

He said nothing about sounds

Most likely case is he hasn’t added the #using in gsc/csc

I did for of downloads the one u suggested still didn't work, and sg4ys just didn't play sound and I did the alias in my thing and i did put the #using in my gsc csc.


Harry Bo21:

I did for of downloads the one u suggested still didn't work, and sg4ys just didn't play sound and I did the alias in my thing and i did put the #using in my gsc csc.

Then it’s not “auto threaded” there’s prob a init function in the script you have to call

Thread Scriptname::functionname()

It didn’t play a sound because it obv isn’t working “at all”


mario807906:

Then it’s not “auto threaded” there’s prob a init function in the script you have to call

Thread Scriptname::functionname()

It didn’t play a sound because it obv isn’t working “at all”

yep there is no function in the gsc or csc that calls the sound and i cant script so idk how to do it. basically is anyone able to come up with a script that works.


sharpgamers4you:

yep there is no function in the gsc or csc that calls the sound and i cant script so idk how to do it. basically is anyone able to come up with a script that works.

Oke imma send you a dm cuz i dont know if im allowed to send links to third-party sites


Holofya:

So are you the original creator of the flashlight script? I would like to properly credit the maker of the script, I'd feel like a dbag otherwise.
Thanks for taking your time to fix it up, can't wait for the release!

I'm not the original creator but I fixed a bug it has. I have the full thing now and someone requested another feature so I'm going to put it up with some instructions. I'll also package it up all nice and neat. (it has double press to turn on as well as auto activation by triggers)


Holofya:

sorry to be annoying but any update on that flashlight.

Sorry, I work on the weekends so I don't have much time to do BO3 stuff. I'm going to work on it today and hopefully get enough done to post it. Shouldn't be much left to do anyway 🤔


Sleepy216:

I'm not the original creator but I fixed a bug it has. I have the full thing now and someone requested another feature so I'm going to put it up with some instructions. I'll also package it up all nice and neat. (it has double press to turn on as well as auto activation by triggers)

Ah i gotcha! I ended up doing my own fix for the grenades when I found out they break the flashlight. I'm glad you mentioned that you made it workable with triggers, Dakh will be hyped for that!
Do you happen to know the original creator of the script? I heard YAW mention "their flashlight", and it too broke when throwing nades. However I feel Chaos would've put his name in the readme if it was his script. I guess it isn't a huge deal about the credit, but it still makes me feel bad.


Holofya:

Ah i gotcha! I ended up doing my own fix for the grenades when I found out they break the flashlight. I'm glad you mentioned that you made it workable with triggers, Dakh will be hyped for that!
Do you happen to know the original creator of the script? I heard YAW mention "their flashlight", and it too broke when throwing nades. However I feel Chaos would've put his name in the readme if it was his script. I guess it isn't a huge deal about the credit, but it still makes me feel bad.

I mean I really have no idea. I was told the one I had was sg4y's, but there's a tread that got transferred from the old Modme where it was shared, and there's also a thread where Spiki shared it. I couldn't tell you who made it but what I'm going to post will be the best version of it 😉.

Edit: and they're all the same base script


Holofya:

Posted my "release" of the updated files I have/made/used. You can find it here: Flashlight v1.0


sharpgamers4you:

Posted my "release" of the updated files I have/made/used. You can find it here: Flashlight v1.0

Its the same but modified, noone knew where it actually came from, cuz inwanted to give credits as well as the others but we couldn't find the guy that started it, have seen a name so i left the name and the way it looked so people or the og creator could see that it was his og scripts, so far still no clue.

Also thanks for everything bro i was talking with the guy that requested the version he wants, was woeking on it but yea i work every day so peace by peace hahaha thanks everyone for all the support


sharpgamers4you:

Posted my "release" of the updated files I have/made/used. You can find it here: Flashlight v1.0

If its like when entering zone or trigger multi then fuck yeaaa like it better❤👍🏼


Holofya:

If its like when entering zone or trigger multi then fuck yeaaa like it better❤👍🏼

It has both ;)
I work a lot too so I don't exactly have much time either, plenty of little side projects that keep me way too busy on top of that


sharpgamers4you:

It has both ;)
I work a lot too so I don't exactly have much time either, plenty of little side projects that keep me way too busy on top of that

Same broooo nice to see someone having the same things