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

Remove Viewhands for Specific Weapon

HOT
broken avatar :(
Created 7 years ago
by jiggy22
0 Members and 1 Guest are viewing this topic.
4,846 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2016
Last active: 1 year ago
Posts
229
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
My Contact & Social Links
More
×
jiggy22's Groups
jiggy22's Contact & Social Linksarchdukesquidlyllljiggy22
Would it be possible to make it so that when holding a specific weapon, the viewhands are completely invisible? I've tried using the ugx weapon editor, but I can't seem to get anything to work. Anybody else know if there's a way? Thanks!
broken avatar :(
×
broken avatar :(
Location: aupotato
Date Registered: 27 September 2013
Last active: 3 years ago
Posts
588
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
respect the dead

donates greatly appreciated :) paypal.me/F3ARxReaper666
discord server:
https://discord.gg/tsGHW99
×
death_reaper0's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
you need to do this via script, the viewhands in the weapon file isnt the same thing as the proper viewhands
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2016
Last active: 1 year ago
Posts
229
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
My Contact & Social Links
More
×
jiggy22's Groups
jiggy22's Contact & Social Linksarchdukesquidlyllljiggy22
you need to do this via script, the viewhands in the weapon file isnt the same thing as the proper viewhands

That's what I was thinking. What would the script look like, and which gsc file would I have to add it to? Thank you so much!
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2016
Last active: 1 year ago
Posts
229
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
My Contact & Social Links
More
×
jiggy22's Groups
jiggy22's Contact & Social Linksarchdukesquidlyllljiggy22
Anybody out there that can help me with this? Thanks :)
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2016
Last active: 1 year ago
Posts
229
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
My Contact & Social Links
More
×
jiggy22's Groups
jiggy22's Contact & Social Linksarchdukesquidlyllljiggy22
Bumping again I guess.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2016
Last active: 1 year ago
Posts
229
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
My Contact & Social Links
More
×
jiggy22's Groups
jiggy22's Contact & Social Linksarchdukesquidlyllljiggy22
I won't stop bumping this!
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2016
Last active: 1 year ago
Posts
229
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
My Contact & Social Links
More
×
jiggy22's Groups
jiggy22's Contact & Social Linksarchdukesquidlyllljiggy22
Bumping for the fourth time lol
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2016
Last active: 1 year ago
Posts
229
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
My Contact & Social Links
More
×
jiggy22's Groups
jiggy22's Contact & Social Linksarchdukesquidlyllljiggy22
Bumping for the fifth time!

This place is dead, isn't it?
broken avatar :(
×
broken avatar :(
Location: fi
Date Registered: 25 June 2013
Last active: 6 days ago
Posts
3,997
Respect
1,024Add +1
Forum Rank
Eviscerator
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
×
HitmanVere's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Bumping for the fifth time!

This place is dead, isn't it?

Yep.
In script, do:
Code Snippet
Plaintext
self setViewModel("tag_origin");
No promises that it will work with tag_origin. If not, make invisible viewhands
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2016
Last active: 1 year ago
Posts
229
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
My Contact & Social Links
More
×
jiggy22's Groups
jiggy22's Contact & Social Linksarchdukesquidlyllljiggy22
Sorry to bump this month old topic, but I'm looking to actually solve this problem now, and I'm still kind of confused on what to do. I tried out something like this:

Code Snippet
Plaintext
while(1)
{
self.weap_model = GetWeaponModel(self GetCurrentWeapon());
self waittill_any( "weapon_change", "weapon_change_complete" );

if((self GetCurrentWeapon() == "m2_flamethrower_zombie" || "m2_flamethrower_zombie_upgraded"))
self setViewModel("tag_origin");
}

But that just messed up every single viewmodel lol. Anyone got any recommendations on fixing this?
broken avatar :(
×
broken avatar :(
Location: aupotato
Date Registered: 27 September 2013
Last active: 3 years ago
Posts
588
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
death_reaper0's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Sorry to bump this month old topic, but I'm looking to actually solve this problem now, and I'm still kind of confused on what to do. I tried out something like this:

Code Snippet
Plaintext
while(1)
{
self.weap_model = GetWeaponModel(self GetCurrentWeapon());
self waittill_any( "weapon_change", "weapon_change_complete" );

if((self GetCurrentWeapon() == "m2_flamethrower_zombie" || "m2_flamethrower_zombie_upgraded"))
self setViewModel("tag_origin");
}

But that just messed up every single viewmodel lol. Anyone got any recommendations on fixing this?
try
Code Snippet
Plaintext
while(1)
{
self.weap_model = GetWeaponModel(self GetCurrentWeapon());
self waittill_any( "weapon_change", "weapon_change_complete" );

if((self GetCurrentWeapon() == "m2_flamethrower_zombie" || "m2_flamethrower_zombie_upgraded"))
self setViewModel("tag_origin");
        else if(IsDefined(level.player_viewmodel))
        self SetViewModel(level.player_viewmodel);
}
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
Both of you have done the if statement wrong

If ( value == value ) - correct

If ( value == value || value == value ) - correct

If ( value == value || value ) - wrong
broken avatar :(
×
broken avatar :(
Location: aupotato
Date Registered: 27 September 2013
Last active: 3 years ago
Posts
588
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
death_reaper0's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
didnt even check that, just added two lines, btw without those it would take the hands when using the weapon then never give it back, or at least it looks like it would
Last Edit: May 16, 2017, 05:07:28 pm by death_reaper0
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2016
Last active: 1 year ago
Posts
229
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
My Contact & Social Links
More
×
jiggy22's Groups
jiggy22's Contact & Social Linksarchdukesquidlyllljiggy22
I have this script as its own separate GSC file, called within _zombiemode.gsc like usual. I've gotten the viewmodels for the weapons fixed, but the viewarms for the flamethrower remain visible. I came up with a different solution to use a pair of invisible viewarms to switch to instead of tag_origin, but that didn't fix anything. Anyone wanna look at the full script that I'm using to see if I'm doing anything wrong?

Code Snippet
Plaintext
init()
{
level thread OnPlayerConnect();
}

OnPlayerConnect()
{
for( ;; )
{
level waittill( "connecting", player );
player thread OnPlayerSpawned();
}
}

OnPlayerSpawned()
{
for( ;; )
{
self waittill( "spawned_player" );
self thread Flammenwerfer();
}
}

Flammenwerfer()
{
while(1)
{
self.weap_model = GetWeaponModel(self GetCurrentWeapon());
self waittill_any( "weapon_change", "weapon_change_complete" );

if((self GetCurrentWeapon() == "m2_flamethrower_zombie" || "m2_flamethrower_zombie_upgraded"))
self setViewModel("viewmodel_blank_arms");
        else if(IsDefined(level.player_viewmodel))
        self SetViewModel(level.player_viewmodel);
}
}
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 March 2014
Last active: 3 years ago
Posts
264
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
Signature
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
×
buttkicker845's Groups
buttkicker845's Contact & Social Links
they have already told you that you implemented your if statement in correctly.
if you do it like this:
Code Snippet
Plaintext
if((self GetCurrentWeapon() == "m2_flamethrower_zombie" || "m2_flamethrower_zombie_upgraded"))
is what happens is the first string and GetCurrentWeapon get turned into a Boolean evaluation and then the second string is evaluated as a Boolean which is not comparable. if you run it in developer 1 you should get an error stating "can't compare Boolean to string" but if you arent running in developer 1 it will just kill the thread and not do anything

you need to make your if statement like this since you are testing the same string twice against two different values.
Code Snippet
Plaintext
if(self GetCurrentWeapon() == "m2_flamethrower_zombie" 
|| self GetCurrentWeapon() == "m2_flamethrower_zombie_upgraded")

As well as if you are using a model  that is not loaded by the zombiemode scripts then you need to preCacheModel the model before _load::main is called which is done inside of _zombiemode::main.

 
Loading ...