UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Need help with a client script.

broken avatar :(
Created 12 years ago
by Ege115
0 Members and 1 Guest are viewing this topic.
3,853 views
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Hello there UGX members!

I am editing and experimenting with a clientscript. And what I am doing here is that I am trying to make a flashlight on a gun. Because a while ago I saw over at ZM that Ray needed help with his flashlight , and I saw that he said that you can do the same type of flashlight if you modify _zombiemode_tesla.csc so just a note, I have not stealed Ray's script okey? Just wanted to give you that note. This is my own editing.

And as I am currently using UGX mod at the moment, I am trying to design this clientscript for the desert eagle to begin with. So I edited it and I have removed some of the tesla stuff and added a light fx, and I am using the UGX easy fx.
But when I load my map, I get a "clientscript compile error, bad syntax" I don't know whats wrong when I look at the script.
This is how I have been editing _zombiemode_tesla.csc

So my question today is are there anybody who can see any errors in how I edited it?

Code Snippet
Plaintext
#include clientscripts\_utility; 
#include clientscripts\_fx;
#include clientscripts\_music;

init()
{
if ( GetDvar( "createfx" ) == "on" )
{
return;
}

level._effect["level._effect["light1"] = loadFX("env/light/fx_light_outdoor_white");
}

player_init()
{
waitforclient( 0 );
//level.tesla_play_fx = [];
//level.tesla_play_rail = true;

//players = GetLocalPlayers();
players = GetPlayers();
for( i = 0; i < players.size; i++ )
{
players[i] thread gun_flashlight( i );
}
}

gun_flashlight( localclientnum )
{
self endon( "disconnect" );

for( ;; )
{
realwait( RandomFloatRange( 8, 12 ) );
weaponname = undefined;

if ( GetCurrentWeapon( localclientnum ) != "silver_deagle" && GetCurrentWeapon( localclientnum ) != "silver_deagle_upgraded" )
{
continue;
}
else
{
weaponname = GetCurrentWeapon( localclientnum );
}

if ( IsADS( localclientnum ) || IsThrowingGrenade( localclientnum ) )
{
continue;
}

if ( GetWeaponAmmoClip( localclientnum, weaponname ) <= 0 )
{
continue;
}

fx = level._effect["level._effect["light1"] = loadFX("env/light/fx_light_outdoor_white");"];

if ( weaponname == "silver_deagle_upgraded" )
{
fx = level._effect["light1"];
}

PlayViewmodelFx( localclientnum, fx, "tag_flash" );
}
}
Thanks in advance  :)
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 3 years ago
Posts
5,544
Respect
6,646Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
Signature
If Java had true garbage collection, most programs would delete themselves upon execution.
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
Flashlights just don't work well in WaW. You can't make a fx that projects a cone of dynamic light, so every flashlight I've seen basically has the functionality of a lantern that lights up everything in a 360 degree radius of you. In Black Ops 1 3arc added a flashlight to the ENGINE (!!! lol) because their stupid effects program was incapable of making the type of flashlight they wanted for the pistols in their SP missions.

To find the syntax error, turn on developer mode and check the full console like you would with a GSC error. It will be displayed.
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Quote
Flashlights just don't work well in WaW. You can't make a fx that projects a cone of dynamic light, so every flashlight I've seen basically has the functionality of a lantern that lights up everything in a 360 degree radius of you. In Black Ops 1 3arc added a flashlight to the ENGINE (!!! lol) because their stupid effects program was incapable of making the type of flashlight they wanted for the pistols in their SP missions.

To find the syntax error, turn on developer mode and check the full console like you would with a GSC error. It will be displayed.

Ah, so making a flashlight in WaW is like making gun dual wields in WaW? I have only seen flashlights in 2 or 3 custom maps.

Do I only have to type developer? I always type developer 1 to look for errors, but that didn't work for the clientscript I had, so is it different with searching errors for clientscripts? "developer 0" or "developer 2"?

So that is why I asked this in a post if anybody could see any errors in the scripts because the error didn't came up when I typed developer 1.
Last Edit: March 03, 2014, 06:37:09 pm by Ege115
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 3 years ago
Posts
5,544
Respect
6,646Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
Ah, so making a flashlight in WaW is like making gun dual wields in WaW? I have only seen flashlights in 2 or 3 custom maps.
I've seen flashlights attached to viewmodels and fake flashlights just attached to the player's model by GSC and they both give the same lighting effects (360 degree light circle). The only difference is if you do viewmodel fx you spawn somelight rays on the joint to make it look a little more convincing.

Do I only have to type developer? I always type developer 1 to look for errors, but that didn't work for the clientscript I had, so is it different with searching errors for clientscripts? "developer 0" or "developer 2"?
developer 1. Always developer 1. 2 isn't going to help any more than 1 as far as I've ever experienced.
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Wait a minute, I have seen that the upgraded winters howl in the UGX mod (Hellfire) do have a blue light that does light up a bit in dark areas.

Can I use the hellfire.csc on the desert eagle and edit it to the desert eagle and change fx?
Or am I correct that the light from the Hellfire.csc in the mod is for the blue light from the hellfire?
Marked as best answer by Ege115 12 years ago
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 3 years ago
Posts
5,544
Respect
6,646Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
Wait a minute, I have seen that the upgraded winters howl in the UGX mod (Hellfire) do have a blue light that does light up a bit in dark areas.

Can I use the hellfire.csc on the desert eagle and edit it to the desert eagle and change fx?
Or am I correct that the light from the Hellfire.csc in the mod is for the blue light from the hellfire?
Lol you can use any of the csc functions that spawn a light on the viewmodel. It's not complicated at all: you just check to see if its the weapon you want to have fx on with getCurrentWeapon(clientNum) and then you use playviewmodelfx() to play the fx, then you wait a very short interval and run the check again.
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Alright then, I'll use that csc, your scripts always works so I use that. And I'll make it work for the desert eagle and change fx. But I use UGX easy fx, so do I have to add the fx name I use like as it does in the easy fx script,

Code Snippet
Plaintext
level._effect["light1"] = loadFX("env/light/fx_light_outdoor_white");
playviewmodelfx(light1)

Am I right about this?

I'll give you the best answer in the meantime, Thanks Treminaor!
Last Edit: March 03, 2014, 07:21:27 pm by Ege115
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 3 years ago
Posts
5,544
Respect
6,646Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
Alright then, I'll use that csc, your scripts always works so I use that. And I'll make it work for the desert eagle and change fx. But I use UGX easy fx, so do I have to add the fx name I use like as it does in the easy fx script,

Code Snippet
Plaintext
level._effect["light1"] = loadFX("env/light/fx_light_outdoor_white");
playviewmodelfx(light1)

Am I right about this?

I'll give you the best answer in the meantime, Thanks Treminaor!
whatever fx you use needs to also have been loaded in GSC. Your fx also needs to have the "Draw with viewmodel" checkbox checked on the first tab of EffectsEd.

The code you posted above should work as long as it is in the correct context and the client number is also added to the args of playviewmodelfx.
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Hmm, well using the script I posted, or your hellfire script, I'll start with getting the one I posted to work first.

Thanks again!

Post Merge: March 04, 2014, 05:37:50 pm
Edit: Okey, I need to know one more thing, what am I supposed to script the light to get it working with the fx on the gun, as you Trem said that to get the fx on the gun working, I will have to make something in a .gsc script too.

So, what am I supposed to do in the script itself? I don't mean that someone should give me a script, I just want to know what I am supposed to do in the script, so I know what I am doing.

Thanks!
Last Edit: March 04, 2014, 05:37:50 pm by Ege115

 
Loading ...