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

weapon storage locker (carries on between games) v1.2

HOT
broken avatar :(
Created 9 years ago
by death_reaper0
0 Members and 1 Guest are viewing this topic.
21,178 views
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 9 November 2013
Last active: 3 years ago
Posts
502
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Custom Zombies Videos: YouTube.com/RichGaming
Signature
YouTube: YouTube.com/RichGaming
Twitter: Twitter.com/RichGaming

×
RichGaming's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Oil Rig Beta Access
Oil Rig Beta Access
RichGaming's Contact & Social Linksrichgaming1RichGamingRich_GamingRichGaming1
Dont know if anyone has pointed this out but if you buy a wall weapon, store it in the fridge then try and rebuy the same wall weapon it will charge you for the weapon but not give it to you. Same happens if you try to take the weapon out of the box.
Last Edit: April 03, 2016, 03:01:38 pm by RichGaming
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.
its been pointed out to me that this is not compatible with Harry Bo21's perks, so dont use this if you are or plan to use those until i can get it fixed
Last Edit: April 08, 2016, 04:43:29 pm by death_reaper0
broken avatar :(
×
broken avatar :(
Location: usIndiana
Date Registered: 13 September 2013
Last active: 2 years ago
Posts
66
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
krimzon's Groups
krimzon's Contact & Social Links
I'm not claiming to know the solution, merely asking a question and making a suggestion given the context.

 is it possible harry's perks are using a stat slot some where in the same range you are eg 3005?

 If so maybe adapt numbers to follow after his?

Maybe it's something else you have an idea on?

I'd be willing to test in any case as my map is currently only using ugx script placer/ugx modtools patch and harry's bo1 perks and wunderfizz( havent updated to widows wine version yet although I hear it has who's who now, not that it's ever been useful to me lolz, but for continuity sake)

Would like to see this working properly as it is a great function that would go great with a multi map style mod (eg. Transit's Bus stop/town/farm inspired mod like Dawnville)
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
I already know what the issue is and it's nothing to do with set stat

I wrote a "give" weapon function to work with my inventory but not a "take" weapon

So when you put your gun in this fridge, player.inventory array still "thinks" you have that gun
broken avatar :(
×
broken avatar :(
Location: usIndiana
Date Registered: 13 September 2013
Last active: 2 years ago
Posts
66
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
krimzon's Groups
krimzon's Contact & Social Links
Is it possible to add the take weapon function to your scripts from my end?
With your permission of course.
Or might that break some other function?
Last Edit: May 09, 2016, 02:31:09 pm by krimzon
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 9 November 2013
Last active: 3 years ago
Posts
502
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Custom Zombies Videos: YouTube.com/RichGaming
×
RichGaming's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Oil Rig Beta Access
Oil Rig Beta Access
RichGaming's Contact & Social Linksrichgaming1RichGamingRich_GamingRichGaming1
Is it possible to add the give weapon function to your scripts from my end?
With your permission of course.
Or might that break some other function?

Just accept that this doesn't work with Harry's perks. Give Fear and Harry some time to come up with a solution and in the mean time don't include it in your map. Simples.
broken avatar :(
×
broken avatar :(
Location: usIndiana
Date Registered: 13 September 2013
Last active: 2 years ago
Posts
66
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
krimzon's Groups
krimzon's Contact & Social Links
Just accept that this doesn't work with Harry's perks. Give Fear and Harry some time to come up with a solution and in the mean time don't include it in your map. Simples.

Can we at least give the man a chance to answer please?
I don't feel that I'm out of line in requesting this with respect to his work.
Also I'm not trying to rush him just merely offering my assistance in testing and brain storming.
Trying to be progressive and active in the community sir.
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
×
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
All you need to do is set that array index back to "none"

Prob loop through the array to get the right index
broken avatar :(
×
broken avatar :(
Location: usIndiana
Date Registered: 13 September 2013
Last active: 2 years ago
Posts
66
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
krimzon's Groups
krimzon's Contact & Social Links
Would you be willing to assist me on this in a pm when you get a chance sir?
I'm in no particular rush as I lead a busy life as well with a home studio,full time job and committed relationship.
But I usually have a few hours every morning to put in on my map, taking my time and paying attention to detail on it.

I still have to repurchase bo1&2 on pc (own on console but just recently built new rig capable of modern gaming) so I can port the guns I want in.

Plus I'm producing some custom sounds for ambient,ee song, ee confirm sound as well as building some textures from scratch using source photo's of my own. All of which I intend to release when the map does, as well as any non basic prefabs I have made.

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
×
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
Code Snippet
Plaintext
take_gun( name )
{
    if ( isDefined( self.inventory ) && self.inventory.size > 0 )
    {
        for ( i = 0; i < self.inventory.size; i++ )
        {
            if ( self.inventory[ i ] == name )
            {
                self.inventory[ i ] = "none";
                break;
            }
        }
    }
    self takeWeapon( name );
}

player take_gun( "weapon_name" );

Wrote that on my phone so forgive any syntax errors
Last Edit: May 09, 2016, 05:32:00 pm by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: usIndiana
Date Registered: 13 September 2013
Last active: 2 years ago
Posts
66
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
krimzon's Groups
krimzon's Contact & Social Links
Haven't tested above script yet but I'm not having the specific wall weapon error mentioned above.

Using ugx mod tools patch v1.0.6
Harrys perks v2.0.4
And reapers current script on front page.

No other edits that would affect inventory

Perks version I have had the array index already set to "none"

I did get a few other inventory oddities.

Noticed

somewhere it's not checking for full weapon inventory gave 3 weapon glitch at some point buying wall weap with same weap in fridge and two gun in inventory

Also doesn't check for same weapon in inventory.  When pulling g43 out of fridge and one in inventory it took my pistol and left me with one g43
upon hitting fridge again, got pistol back no issue, g43 in fridge still had g43  in inventory.

Another thing is hintstring stays the same whether you're trading or just putting one in but I also haven't got around to adding trems hintstring fix either, will follow up on that once it's implemented and tested.

I am aware though that these are old perk scripts so I will back up map at this point
add update, sort through 50+ pages for error fixing and also add trems hintstring fix.
Then I will test above changes thoroughly and report my finding

Should be able to sort syntax errors to as long as I make sure to get updated perks working first sonI know errors aren't coming from different places.

Thanks for taking the time harry as I read you've moved on from modding cod5.
Still trying to catch up but I appreciate your patience and assistance very much sir.
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
×
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
Haven't tested above script yet but I'm not having the specific wall weapon error mentioned above.

Using ugx mod tools patch v1.0.6
Harrys perks v2.0.4
And reapers current script on front page.

No other edits that would affect inventory

Perks version I have had the array index already set to "none"

I did get a few other inventory oddities.

Noticed

somewhere it's not checking for full weapon inventory gave 3 weapon glitch at some point buying wall weap with same weap in fridge and two gun in inventory

Also doesn't check for same weapon in inventory.  When pulling g43 out of fridge and one in inventory it took my pistol and left me with one g43
upon hitting fridge again, got pistol back no issue, g43 in fridge still had g43  in inventory.

Another thing is hintstring stays the same whether you're trading or just putting one in but I also haven't got around to adding trems hintstring fix either, will follow up on that once it's implemented and tested.

I am aware though that these are old perk scripts so I will back up map at this point
add update, sort through 50+ pages for error fixing and also add trems hintstring fix.
Then I will test above changes thoroughly and report my finding

Should be able to sort syntax errors to as long as I make sure to get updated perks working first sonI know errors aren't coming from different places.

Thanks for taking the time harry as I read you've moved on from modding cod5.
Still trying to catch up but I appreciate your patience and assistance very much sir.
sigh...

This will mean you haven't changed the normal give weapon function to mine either

I don't get what's so complicated about this...

The game by default only let's you hold two and "does not" track the order

I had to make a custom function to imitate this behaviour which means you have to edit any scripts you get off this site

Seriously - where is the complication


I'm going to reiterate this one more time

Any - ANY reference to give or take weapon functions needs to be REPLACED with mine or my system will have no idea what you do or don't have. I made it as simple as swapping

Giveweapon

To.

Harrybo21_give_gun

Or something like that - it's in harrybo21_utilities

Seriously that's all it needs - and in this case you need a take gun function coz this script also TAKES your weapons

I gave Instructions on how to change the wall buys and mystery box in the video on page one of said 50 page post....
Last Edit: May 10, 2016, 12:30:10 pm by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 8 months ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
My preferred name is "xSanchez78".
Check me out here: www.steamcommunity.com/id/xSanchez78
×
alaurenc9'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.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
Another thing is hintstring stays the same whether you're trading or just putting one in but I also haven't got around to adding trems hintstring fix either, will follow up on that once it's implemented and tested.
What is trem's hintstring fix got to do with anything?

Changing the hintstring depending on the trading or placing or whatever the hell else it says can only be accomplished by BO2's trigger-per-player system, where it spawns multiple triggers and makes them only visible to their specific players, that way different people can see different hinstrings.
broken avatar :(
×
broken avatar :(
Location: usIndiana
Date Registered: 13 September 2013
Last active: 2 years ago
Posts
66
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
krimzon's Groups
krimzon's Contact & Social Links
Merely missed that fact harry as I haven't updated to 4.0.2 perks yet.
Hadn't had any troubles yet so it hadn't come up yet, pehaps because the perks were the only thing I had added.
sometime ago as well so I may have just forgot that fact
Just stating observations and what scripts I have.
Not so much asking for help fixing the things I mentioned, considering I haven't updated perks yet, just stating that I wasn't able to recreate the issue with not receiving wall weapon.


About hintstrings,
Again stating observations and that I didn't have trems hintsring update fix so I wasn't sure if that was why or not. Hadn't tested multiplayer yet either.
I wasn't aware that was the way it worked alaurenc9 thank you for letting me know.

Might also mention again that I map in what little free time I have, I understand you guy's get alot of issues brought to you by people who need help with every little thing, I'm sorry if I seem like I should know these things but I don't have as much time invested in the forums as most so it's possible that I'll make mistakes but please forgive me, I'd like to be able to bring something to the table and not just be helpless.
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
×
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
change the code in mapname.gsc to this instead :

Code Snippet
Plaintext
weapon_locker_begin()
{
level.harry_perks_fix = true;

players = getplayers();
for( i = 0; i < players.size; i++ )
{
players[ i ] thread get_stored_gun();
}
self thread weapon_locker();
}

get_stored_gun()
{
wait 1;
self.stored_gun_ammo = self GetStat( 3007 );
self.stored_ammo_clip = self GetStat( 3008 );
self.has_stored_weapon = self GetStat( 3009 );
keys = GetArrayKeys( level.zombie_weapons );
self.stored_weapon = keys[ self GetStat( 3006 ) ];
}

weapon_locker()
{
wait 2;
weapon_locker = getEnt( "weapon_locker", "targetname" );
    weapon_locker setHintString( "press & hold &&1 to store current weapon" );
weapon_locker setCursorHint( "HINT_NOICON" );
while( 1 )
{
weapon_locker waittill( "trigger", user );
if( is_player_valid( user ))
{
user.old_gun = user getcurrentweapon();
user.gun_ammo = user GetAmmoCount( user.old_gun );
user.gun_ammo_clip = user GetWeaponAmmoClip(user.old_gun);

// this line is for non valid weapons, such as perk bottles, knuckle crack and the syringe when reviving, this should only need to be changed if adding extra perks etc.
if (!( user.old_gun == "none" || user.old_gun == "syrette" || user.old_gun == "zombie_melee" || user.old_gun == "zombie_perk_bottle_revive" || user.old_gun == "zombie_perk_bottle_doubletap" || user.old_gun == "zombie_perk_bottle_jugg" || user.old_gun == "zombie_perk_bottle_sleight" || user.old_gun == "zombie_perk_bottle_staminup" || user.old_gun == "zombie_perk_bottle_phd" || user.old_gun == "zombie_perk_bottle_mulekick" || user.old_gun == "zombie_perk_bottle_deadshot" || user.old_gun == "zombie_perk_bottle_cherry" || user.old_gun == "zombie_perk_bottle_vulture" || user.old_gun == "zombie_knuckle_crack" || user.old_gun == "stielhandgranate" || user.old_gun == "zombie_cymbal_monkey" || user.old_gun == "zombie_bowie_flourish" ))
{
primaryWeapons = user GetWeaponsListPrimaries();
if( ( isDefined( primaryWeapons ) && primaryWeapons.size == 1 || isDefined( primaryWeapons ) && primaryWeapons.size == 2 && user hasPerk ( "specialty_extraammo" ) ) && user.has_stored_weapon == 1 )
{
if ( isDefined( level.harry_perks_fix ) && level.harry_perks_fix )
harrybo21_give_gun( user.old_gun );
else
user giveweapon( user.stored_weapon );

user SetWeaponAmmoStock(user.stored_weapon,user.stored_gun_ammo);
user SetWeaponAmmoClip(user.stored_weapon,user.stored_ammo_clip);
user switchtoweapon( user.stored_weapon );
user.has_stored_weapon = 0;
user SetStat(3009,0);
}
else
// the following line is for weapons that you do not want storeable, i added some from my own map and advise customizing for weapons in your own map. zombie colt should be changed to your starting weapon
if ( user.old_gun == "colt" || user.old_gun == "zombie_colt" || user.old_gun == "zombie_colt_upgraded" || user.old_gun == "tesla_gun" || user.old_gun == "tesla_gun_upgraded" || user.old_gun == "thundergun" || user.old_gun == "thundergun_upgraded" || user.old_gun == "ray_gun" || user.old_gun == "ray_gun_upgraded" || user.old_gun == "scavenger" || user.old_gun == "scavenger_upgraded" || user.old_gun == "vorkuta_knife" || user.old_gun == "vorkuta_knife_upgraded" )
{
user iPrintLnBold("^7cannot store this weapon");
wait 2;
}
else
{
primaryWeapons = user GetWeaponsListPrimaries();
if(!( isDefined( primaryWeapons ) && primaryWeapons.size == 1 || isDefined( primaryWeapons ) && primaryWeapons.size == 2 && user hasPerk ( "specialty_extraammo" ) ))
{
if ( isDefined( level.harry_perks_fix ) && level.harry_perks_fix )
harrybo21_take_gun( user.old_gun );
else
user takeWeapon( user.old_gun );

}

if(user.has_stored_weapon == 1)
{
if ( isDefined( level.harry_perks_fix ) && level.harry_perks_fix )
harrybo21_give_gun( user.old_gun );
else
user giveweapon( user.stored_weapon );

user SetWeaponAmmoStock( user.stored_weapon, user.stored_gun_ammo );
user SetWeaponAmmoClip( user.stored_weapon,user.stored_ammo_clip );
user switchtoweapon( user.stored_weapon );
}
user.switch_weapon = user.stored_weapon;
wait 0.1;
user.stored_weapon = user.old_gun;
user.stored_ammo_clip = user.gun_ammo_clip;
user.stored_gun_ammo = user.gun_ammo - user.stored_ammo_clip;
wait 0.1;

keys = GetArrayKeys( level.zombie_weapons );
for( i = 0; i < keys.size; i ++ )
{
if( keys[ i ] == user.stored_weapon )
{
user SetStat( 3006, i );
break;
}
}
user SetStat( 3007, user.stored_gun_ammo );
user SetStat( 3008, user.stored_ammo_clip );
user.has_stored_weapon = 1;
user SetStat( 3009, 1 );

user playlocalsound( "cha_ching" );
user.cur_gun = user getcurrentweapon();
primaryWeapons = user GetWeaponsListPrimaries();
if( isDefined( primaryWeapons ) && primaryWeapons.size > 0 && ( !( user.cur_gun == user.switch_weapon ) ) )
{
user SwitchToWeapon( primaryWeapons[ 0 ] );
}
wait 2;
}
}
}
}
}

harrybo21_take_gun( name )
{
if ( isDefined( self.grenade ) && self.grenade == name )
self.grenade = undefined;
else if ( isDefined( self.alt_grenade ) && self.alt_grenade == name )
self.alt_grenade = undefined;
    else if ( isDefined( self.inventory ) && self.inventory.size > 0 )
    {
        for ( i = 0; i < self.inventory.size; i++ )
        {
            if ( self.inventory[ i ] == name )
            {
                self.inventory[ i ] = "none";
                break;
            }
        }
    }
    self takeWeapon( name );
}

harrybo21_give_gun( gun, model_index )
{
primaryWeapons = self GetWeaponsListPrimaries();
currentWeapon = self getCurrentWeapon();
for ( i = 0; i < primaryWeapons.size; i++ )
if ( primaryWeapons[ i ] == gun + "_upgraded" )
gun = gun + "_upgraded";

if ( !self harrybo21_has_weapon( gun ) )
{
if ( gun == "zombie_cymbal_monkey" )
{
self maps\_zombiemode_cymbal_monkey::player_give_cymbal_monkey();
self harrybo21_set_alt_grenade( gun, 3 );
}
else if ( gun == "stielhandgranate" )
self harrybo21_set_grenade( gun, 4 );
else if ( gun == "molotov" || gun == "molotov_zombie"  )
self harrybo21_set_alt_grenade( gun, 4 );
else
self harrybo21_set_weapon( gun, model_index );

}
else
{
if ( weaponClass( gun ) == "grenade" )
self giveMaxAmmo( gun );
else
self giveMaxAmmo( gun );
}
self notify( "weapon_obtained" );
}

harrybo21_get_weapon_index( gun )
{
for ( i = 0; i < self.inventory.size; i++ )
{
if ( self.inventory[ i ] == gun )
{
return i;
}
}
return undefined;
}

harrybo21_set_weapon( gun, model_index )
{
if ( !isDefined( model_index ) )
model_index = 0;

slot = self harrybo21_get_weapon_index( "none" );
if ( !isDefined( slot ) )
slot = self harrybo21_get_weapon_index( self getCurrentWeapon() );

if ( self.inventory[ slot ] != "none" )
self takeWeapon( self.inventory[ slot ] );

self.inventory[ slot ] = gun;
self giveWeapon( gun, model_index );
self switchToWeapon( gun );
}

harrybo21_set_grenade( gun, ammo )
{
ammo = ammo;
if ( !isDefined( ammo ) )
ammo = 0;

if ( isDefined( self.grenade ) && self.grenade != gun )
self takeWeapon( self.grenade );

self.grenade = gun;
self giveWeapon( gun );

self setWeaponAmmoClip( self.grenade, ammo );
}

harrybo21_set_alt_grenade( gun, ammo )
{
ammo = ammo;
if ( !isDefined( ammo ) )
ammo = 0;

if ( isDefined( self.alt_grenade ) && self.alt_grenade != gun )
self takeWeapon( self.alt_grenade );

self.alt_grenade = gun;
self giveWeapon( gun );

self setWeaponAmmoClip( self.alt_grenade, ammo );
}

they can change this :

Code Snippet
Plaintext
level.harry_perks_fix = true;

to true or false if they need the fix with my perks or not

 
Loading ...