Getting a custom grenade to even work..

Grab your favourite IDE and tinker with the innards of game engines

Getting a custom grenade to even work..

Postby Jangalomph on Sun Jul 11, 2010 8:55 pm

Well.. first, i can't get my grenade to even spawn by impulse 101 like it used to.. "before i lost my code" And.. when i "give weapon_apv" it comes up, but its red.. and unselectable, as if it has no ammo!? I have a new ammo def type, and all i did was take grenade_frag.cpp, grenade_frag.h and weapon_frag rename them to weapon_apv, grenade_apv etc.. and then every thing that said CGrenadeFrag: or.. Fragwhatever was changed to Apv.. all of it. I also have a weapon_apv.txt file for it coded correctly AND its in the hl2_weaponstubbs.. or what ever its called. Every thing is normal like a normal weapon would be, but it doesn't work.. how surprising.

Image

:cry:
http://www.nomoreroominhell.com
I don’t know whether I was right or wrong, I guess I’ll never know… But I made it. And I guess I should be thankful for that. - Strelok
Has anyone really been far even as decided to use even go want to do look more like?
User avatar
Jangalomph
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Wed Jun 25, 2008 3:19 pm
Location: Sumter, SC

Re: Getting a custom grenade to even work..

Postby gladers on Thu Jul 22, 2010 6:25 pm

You need to give this weapon to the player within the impulse 101 code section
gladers
Member
Member
 
Joined: Sat Feb 27, 2010 2:53 pm

Re: Getting a custom grenade to even work..

Postby Jangalomph on Fri Jul 23, 2010 2:47 am

Where's that located?
http://www.nomoreroominhell.com
I don’t know whether I was right or wrong, I guess I’ll never know… But I made it. And I guess I should be thankful for that. - Strelok
Has anyone really been far even as decided to use even go want to do look more like?
User avatar
Jangalomph
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Wed Jun 25, 2008 3:19 pm
Location: Sumter, SC

Re: Getting a custom grenade to even work..

Postby JLea on Fri Jul 23, 2010 3:09 am

player.cpp

search for case 101
User avatar
JLea
May Contain Skills
May Contain Skills
 
Joined: Mon Jan 02, 2006 1:19 pm
Location: Melbourne, Australia

Re: Getting a custom grenade to even work..

Postby Jangalomph on Wed Sep 01, 2010 1:53 am

Well guys, many months later, and random tries at getting it to work, it still doesn't give me any ammo.

Code: Select all
      GiveAmmo( 5,   "apv");


In player.cpp

also

Code: Select all
      GiveNamedItem( "weapon_apv" );



Code: Select all
STUB_WEAPON_CLASS( weapon_apv, WeaponApv, C_BaseHLCombatWeapon );


And all of the convars are correct. Why does it do this to me!?
http://www.nomoreroominhell.com
I don’t know whether I was right or wrong, I guess I’ll never know… But I made it. And I guess I should be thankful for that. - Strelok
Has anyone really been far even as decided to use even go want to do look more like?
User avatar
Jangalomph
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Wed Jun 25, 2008 3:19 pm
Location: Sumter, SC

Re: Getting a custom grenade to even work..

Postby Surfa on Wed Sep 01, 2010 10:05 am

Are you sure the script file is set-up correctly and you aren't setting the wrong type of ammo or something. From skimming through your posts it seems like you are doing everything correctly, maybe you just mis-typed a definition or something.
Surfa
May Contain Skills
May Contain Skills
 
Joined: Sun Dec 30, 2007 3:04 pm

Re: Getting a custom grenade to even work..

Postby Jangalomph on Wed Sep 01, 2010 8:22 pm

Its like, almost impossible for a mis-type, i've done EVERY THING! Multiple times! No errors! I'll just recode this stupid thing again for the 4th time. :( Errors, here i come.
http://www.nomoreroominhell.com
I don’t know whether I was right or wrong, I guess I’ll never know… But I made it. And I guess I should be thankful for that. - Strelok
Has anyone really been far even as decided to use even go want to do look more like?
User avatar
Jangalomph
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Wed Jun 25, 2008 3:19 pm
Location: Sumter, SC

Re: Getting a custom grenade to even work..

Postby Jangalomph on Wed Sep 01, 2010 10:16 pm

Okay, i made basedarkmatter_shared.h/cpp, weapon_darkmatter.cpp, grenade_darkmatter.h/.cpp and put this in my ammo.

Code: Select all
      def.AddAmmoType("Darkmatter",      DMG_DISSOLVE,            TRACER_NONE,         "sk_plr_dmg_darkmatter",   "sk_npc_dmg_darkmatter",   "sk_max_darkmatter",   0, 0);


its completely good now.. but it still shows no ammo. It will not work? Where in basedarkmatter_shared.h or cpp would i find the ammo type?

Code: Select all
LINK_ENTITY_TO_CLASS( darkmatter, CBaseDarkMatter );


I was thinking the first darkmatter was it.. but i dont think so :/
http://www.nomoreroominhell.com
I don’t know whether I was right or wrong, I guess I’ll never know… But I made it. And I guess I should be thankful for that. - Strelok
Has anyone really been far even as decided to use even go want to do look more like?
User avatar
Jangalomph
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Wed Jun 25, 2008 3:19 pm
Location: Sumter, SC

Return to Programming

Who is online

Users browsing this forum: No registered users

cron