Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Picking up 'grenade' weapontypes [CoD4]

  1. #11
    Private
    Join Date
    Jul 2015
    Posts
    44
    Thanks
    7
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by Tally View Post
    Why would you replace "player" with "owner"? Where is "owner" defined? It isn't! But player is. So, I guess you should leave "player" as being the right entity.



    Both what? There is 1 script. What is the second one you are referring to?
    Code:
    setMarker( origin )
    {
    	
    	trigger = spawn( "trigger_radius", origin-(0,0,32), 0, 32, 64 );
    	
    	for(;;)
    	{
    		trigger waittill( "trigger", user );
    		
    		if( user canUse( user ) )
    			user.lowerMessage SetText( &"MPUI_PRESS_USE_TO_PICK_TK" );
    			user.lowerMessage.alpha = 1;
    			user.lowerMessage FadeOverTime( 0.05 );
    			user.lowerMessage.alpha = 0;
    
    		if( user usebuttonpressed() )
    		{
    			if( user == owner )
    			{
    				if( self deleteTK() )
    				{
    					tkammo = user getammocount( "throwingknife_mp" );
    					user setWeaponAmmoOverall( "throwingknife_mp", tkammo+1 );
    				}
    			}
    			else
    			{
    				return false;
    			}
    			break;
    		}
    	}
    }
    and one with owner at the beginning of the thread

    Code:
    setMarker( origin, owner )
    {
    	
    	trigger = spawn( "trigger_radius", origin-(0,0,32), 0, 32, 64 );
    	
    	for(;;)
    	{
    		trigger waittill( "trigger", user );
    		
    		if( user canUse( user ) )
    			user.lowerMessage SetText( &"MPUI_PRESS_USE_TO_PICK_TK" );
    			user.lowerMessage.alpha = 1;
    			user.lowerMessage FadeOverTime( 0.05 );
    			user.lowerMessage.alpha = 0;
    
    		if( user usebuttonpressed() )
    		{
    			if( user == owner )
    			{
    				if( self deleteTK() )
    				{
    					tkammo = user getammocount( "throwingknife_mp" );
    					user setWeaponAmmoOverall( "throwingknife_mp", tkammo+1 );
    				}
    			}
    			else
    			{
    				return false;
    			}
    			break;
    		}
    	}
    }
    If i don't put 'owner' at the beginning of the thread it causes a compile error as this part of the thread used in the beginning script
    Last edited by akuma2099; 15th September 2015 at 12:53.

  2. #12
    Private
    Join Date
    Jul 2015
    Posts
    44
    Thanks
    7
    Thanked 2 Times in 2 Posts
    This makes the pickup trigger work, but the pickup trigger only spawns when the grenade is thrown from it's 'press g to throw back' action i.e when it has already been thrown, is idle on the floor, and gets thrown back.
    Is there anything I can edit inside of _weapons.gsc or anywhere to change this/fix this, i've tried everything from editing owner/user permissions deleting script from _weapons in an attempt to remove the throwback notify from showing, using code from _disarmexplosives from OW SVN, but nothing seems to be working
    Last edited by akuma2099; 17th September 2015 at 11:37.

  3. #13
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by akuma2099 View Post
    This makes the pickup trigger work, but the pickup trigger only spawns when the grenade is thrown from it's 'press g to throw back' action i.e when it has already been thrown, is idle on the floor, and gets thrown back.
    Is there anything I can edit inside of _weapons.gsc or anywhere to change this/fix this, i've tried everything from editing owner/user permissions deleting script from _weapons in an attempt to remove the throwback notify from showing, using code from _disarmexplosives from OW SVN, but nothing seems to be working
    No idea what you are blathering on about. In fact, no idea what it is you are trying to do anymore. Talk about confusing posts, or what? I thought you were trying to find the origin of a THROWN grenade, but apparently not. if you don't want to find the origin of a thrown grenade, why not revert back to your original code? that will give you exactly what you seem to be asking for.

    In which case, I will delete this entire thread as completely pointless and redundant garbage.
    Last edited by Tally; 17th September 2015 at 14:06.

  4. #14
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    I also find it hard to identify your goal here. Are you trying to allow a player to pick up a thrown throwingknife to immediately throw it back, by trying to reuse nadethrowback code?
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  5. #15
    Private
    Join Date
    Jul 2015
    Posts
    44
    Thanks
    7
    Thanked 2 Times in 2 Posts
    My goal is to make the throwingknife able to be picked and placed into the inventory of the player.

    Your code is making the pickup trigger spawn only after the throwingknife has been thrown back (as it is a frag grenade weapontype the press g to throw back text spawns), sorry if my paragraph was hard to understand.

    I'm trying to say that the pickup trigger will only spawn once the throwingknife has been idle and is being thrown back.
    I'm trying to make the pickup trigger spawn once it has been idle in the first place.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •