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 (https://github.com/WARDOGSK93/CoD-Perk-System/blob/master/maps/wardog/perks/_wardog_perks_waw.gsc#L23)
set_perk_weapon function (https://github.com/WARDOGSK93/CoD-Perk-System/blob/master/maps/wardog/perks/_wardog_perks_util.gsc#L139)
Default weapon init (https://github.com/WARDOGSK93/CoD-Perk-System/blob/master/maps/wardog/perks/_wardog_perks.gsc#L23)
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.
I think he means like this
I don't know much about script but I think you have to precache them
its called in _zombiemode just moved to below _load call in _zombiemode and the bottle still isnt given :(Spoiler: click to open...(https://i.gyazo.com/e938543d605138914648a9adc7586fd1.png)(https://i.gyazo.com/52974476513dc748b7afe5ddddff9040.png)
Edit: also none of my pre_init functiosn are threaded / have a wait before 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?).the second call was me moving it there just to check but i moved it back above _load (the first image)
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)
Ah, okay.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)
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.
You really should only use one weapon file. Your taking up a lot of weapon files that way.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)
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.
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 (https://github.com/WARDOGSK93/CoD-Perk-System/blob/master/weapons/sp/wardog_perk_bottle) 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)
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?)
i 101% sure its been precached but after a nights rest im just gonna rewrite my system (its the only thing i can think of to fix it)
i 101% sure its been precached but after a nights rest im just gonna rewrite my system (its the only thing i can think of to fix it)