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
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
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?).
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)
Title: Re: [Help] GiveWeapon error
Post by: daedra descent on January 20, 2016, 10:19:07 pm
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.
Title: Re: [Help] GiveWeapon error
Post by: DeletedUser on January 20, 2016, 10:29:56 pm
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
Title: Re: [Help] GiveWeapon error
Post by: MakeCents on January 21, 2016, 12:28:53 am
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.
Title: Re: [Help] GiveWeapon error
Post by: DeletedUser on January 21, 2016, 12:47:20 am
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)
Title: Re: [Help] GiveWeapon error
Post by: MakeCents on January 21, 2016, 01:07:22 am
Oh, I saw the one comment and all the precaches above and thought you were using more, my bad.
Title: Re: [Help] GiveWeapon error
Post by: DeletedUser on January 21, 2016, 01:14:52 am
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 had this issue with my perk system a while ago and can't remember what fixed it. I too passed the string to precache the weapon file after init in another function. I almost want to say it fixed itself, but I don't remember. I currently still have that option but only use one weapon file so I precache it in my init function of my perk system which I call in zombiemode where the others are called. It very well could still not be working for multiple weapon files in the passing the string system, I don't know. But if you have precached the weapon file in the init function, or even tried in one of the zombiemode precache functions, hud or shader or whatever, to add the weapons/bottles/items there, checked for misspellings, I guess you don't have a choice then.
Title: Re: [Help] GiveWeapon error
Post by: DeletedUser on January 21, 2016, 03:33:12 pm