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

[Help] GiveWeapon error

HOT
broken avatar :(
Created 8 years ago
by Deleted User
0 Members and 1 Guest are viewing this topic.
7,322 views
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
So while i was rewriting my perk system i came a across a very strange error

My perk bottles are not given at all (i can give my bottle in game but not via script)

See here for more info

if any one knows why this is happening it would be greatly appreciated

Edit: other than this error my perk system seems to work (solo still need to test coop)
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,790
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
Sounds like it isn't precached to me.
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
Sounds like it isn't precached to me.

it must be preached as im precaching it when my perks are registered and the default weapon (if you pass a undefined var in the set weapon it defaults to this one) is precached during pre_init of my perk system

Jugg set_perk_weapon call
set_perk_weapon function
Default weapon init

Edit: ive also tried precaching the weapon name directly (not passed as a var)

Edit 2: i also thought if it wasnt precached you couldnt give from console in game but i guess you learn something new every day
broken avatar :(
×
broken avatar :(
Location: usbuffalo
Date Registered: 16 August 2013
Last active: 11 months ago
Posts
927
Respect
Forum Rank
The Decider
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Giggity.
Signature
maps:
Undead Town
http://ugx-mods.com/forum/index.php?topic=2294.0 (Release)
Origins 1922
http://ugx-mods.com/forum/index.php?topic=2659.0
[WIP] mapping 39%, weapons 85%, scripts 65%
[/url]
×
RamboBadass'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.
RamboBadass's Contact & Social LinksAsk merambobadassRamboDaGreat
I think he means like this

Code Snippet
Plaintext
[/	// this map uses atleast 1 perk machine
PrecacheItem( "zombie_perk_bottle_doubletap" );
PrecacheItem( "zombie_perk_bottle_jugg" );
PrecacheItem( "zombie_perk_bottle_revive" );
PrecacheItem( "zombie_perk_bottle_sleight" );
PrecacheItem( "bo2_t6_wpn_zmb_perk_bottle_cherry_view" );
PrecacheItem( "zombie_perk_bottle_phd" );
PrecacheItem( "zombie_perk_bottle_staminup" );
PrecacheItem( "zombie_perk_bottle_mulekick" );
PrecacheItem( "zombie_perk_bottle_deadshot" );

PrecacheItem( "zombie_knuckle_crack" );code]

I don't know much about script but I think you have to precache them
Last Edit: January 20, 2016, 09:29:37 pm by RamboBadass
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,790
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
it must be preached as im precaching it when my perks are registered and the default weapon (if you pass a undefined var in the set weapon it defaults to this one) is precached during pre_init of my perk system

Jugg set_perk_weapon call
set_perk_weapon function
Default weapon init

Edit: ive also tried precaching the weapon name directly (not passed as a var)


Edit 2: i also thought if it wasnt precached you couldnt give from console in game but i guess you learn something new every day

Is that pre init function called before load.gsc and isnt threaded/ wait before it?

If so, that is probably why.

On my phone ATM, sorry for not being clear.

All pre caching MUST be done before load with NO threading or waits before it.
Last Edit: January 20, 2016, 09:34:43 pm by daedra descent
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
Is that pre init function called before load.gsc and isnt threaded/ wait before it?

If so, that is probably why.

its called in _zombiemode just moved to below _load call in _zombiemode and the bottle still isnt given :(

Spoiler: click to open...


Edit: also none of my pre_init functiosn are threaded / have a wait before them

Edit 2: should i revert to my old perk system (this version allows for each perk to have a seperate bottle my old version didnt)
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,790
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
I think he means like this

Code Snippet
Plaintext
[/	// this map uses atleast 1 perk machine
PrecacheItem( "zombie_perk_bottle_doubletap" );
PrecacheItem( "zombie_perk_bottle_jugg" );
PrecacheItem( "zombie_perk_bottle_revive" );
PrecacheItem( "zombie_perk_bottle_sleight" );
PrecacheItem( "bo2_t6_wpn_zmb_perk_bottle_cherry_view" );
PrecacheItem( "zombie_perk_bottle_phd" );
PrecacheItem( "zombie_perk_bottle_staminup" );
PrecacheItem( "zombie_perk_bottle_mulekick" );
PrecacheItem( "zombie_perk_bottle_deadshot" );

PrecacheItem( "zombie_knuckle_crack" );code]

I don't know much about script but I think you have to precache them

Yes, like that. However, it shouldn't matter if you use a literal string or a variable as long as the variable is defined and is a string(maybe it isn't defined?).

its called in _zombiemode just moved to below _load call in _zombiemode and the bottle still isnt given :(

Spoiler: click to open...


Edit: also none of my pre_init functiosn are threaded / have a wait before them

You should only precache weapons/models once. Also, the second call is AFTER _load, not before(where it should be.

broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
Yes, like that. However, it shouldn't matter if you use a literal string or a variable as long as the variable is defined and is a string(maybe it isn't defined?).

You should only precache weapons/models once. Also, the second call is AFTER _load, not before(where it should be.
the second call was me moving it there just to check but i moved it back above _load (the first image)

Edit: the reason i have 2 precaches is just incase the weapon passed in maps\wardog\perks\_wardog_perks_util::set_perk_weapon is not the default bottle (set and precached in maps\wardog\perks\_wardog_perks::pre_init)
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,790
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
the second call was me moving it there just to check but i moved it back above _load (the first image)

Edit: the reason i have 2 precaches is just incase the weapon passed in maps\wardog\perks\_wardog_perks_util::set_perk_weapon is not the default bottle (set and precached in maps\wardog\perks\_wardog_perks::pre_init)

Ah, okay.

precacheItem should precache the model by itself. All your doing there is precaching the model itself, which would only be useful if you wanted to spawn the model via script but don't have a weapon with the model precached elsewhere.

Edit: honestly, the only way i'm going to be able to figure this out at this rate is if i had a copy of whatever map your using to test these perks. I could then run developer and developer_script and see if it is indeed not being preached or if the variable isn't defined.
Last Edit: January 20, 2016, 10:20:30 pm by daedra descent
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
Ah, okay.

precacheItem should precache the model by itself. All your doing there is precaching the model itself, which would only be useful if you wanted to spawn the model via script but don't have a weapon with the model precached elsewhere.

Edit: honestly, the only way i'm going to be able to figure this out at this rate is if i had a copy of whatever map your using to test these perks. I could then run developer and developer_script and see if it is indeed not being preached or if the variable isn't defined.
i dont mind sending you a compiled version of my map as ive tried everything and cant it to work and just really want this fixed but im not going to send a uncompiled version out (:( sorry)

Edit: pm me if you want me to send the compiled map
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents'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.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
You really should only use one weapon file. Your taking up a lot of weapon files that way.

For bottles just make sure you Precache the weapon file and add the models and weapon file to a csv your including in the mod (and checked while building mod). Most use the mod.csv. Missing one of those causes the can give in console works but not via script thing. I forget which one off hand. As a matter of fact, usually if you give on console, after that the script will give then for that game. Unless I misunderstood what you said.
Last Edit: January 21, 2016, 12:43:56 am by MakeCents
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
You really should only use one weapon file. Your taking up a lot of weapon files that way.

For bottles just make sure you Precache the weapon file and add the models and weapon file to a csv your including in the mod (and checked while building mod). Most use the mod.csv. Missing one of those causes the can give in console works but not via script thing. I forget which one off hand. As a matter of fact, usually if you give on console, after that the script will give then for that game. Unless I misunderstood what you said.
i am using 1 weapon file but with all waw, bo1 and bo2 perks that takes up almost all 16 slots in the weapon file so im trying to add the ability to call 1 function and change the weapon file (but for some reason it seems the weapon file isnt been saved even though it should)
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents'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.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Oh, I saw the one comment and all the precaches above and thought you were using more, my bad.
Last Edit: January 21, 2016, 01:07:50 am by MakeCents
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
Oh, I saw the one comment and all the precaches above and thought you were using more, my bad.
yeah the weapon file im using can be found here dont know if all this can be caused be a mistake in the weapon file (i dont really know how weapon files work i tend to edit them with UGX Weapon editor and add the extra models in Sublime)
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 6 months ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
give by console vs giveweapon by script do completely different things.

GiveWeapon only gives it if the weapon was cached into the level at level-load vs give giving the loaded asset pool for weapons.

You missing the precache is the only thing wrong. (Are you 100% sure it's been precached though?)

 
Loading ...