| Author | 
            Message | 
        
        
			| 
				
				 whitty 
				
				
					 Joined: Sat Jun 16, 2007 2:31 am Posts: 2982 Location: Texas
				 
				 
			 | 
			
				
				  Parent Absence Deletion  
					
						Applied to a magazine: Code: function Update(self)    if not (MovableMan:IsHeldDevice(self.parent)) then    self.ToDelete = true;    self.LifeTime = 0;    end end Spits out this: Code: ERROR: [string "Magazines.Obj00001 = ToMagazine(MoveableMan...."]:1: attempt to call global 'ToMagazine' (a nil value)
  What do?  
					
  
			 | 
		
		
			| Tue Apr 20, 2010 12:04 am | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Grif 
				REAL AMERICAN HERO 
				
					 Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
				 
				 
			 | 
			
				
				  Re: Parent Absence Deletion  
					
						that can't be all of your code
  Unless CC's attachable based lua is really that broken. 
					
  
			 | 
		
		
			| Tue Apr 20, 2010 12:20 am | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 whitty 
				
				
					 Joined: Sat Jun 16, 2007 2:31 am Posts: 2982 Location: Texas
				 
				 
			 | 
			
				
				  Re: Parent Absence Deletion  
					
						Nope, that's all of it.     So then should I just check for the nearest actor and the gun it's holding? Then make it delete based on that.  
					
  
			 | 
		
		
			| Tue Apr 20, 2010 12:23 am | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Geti 
				
				
					 Joined: Sun Jul 13, 2008 9:57 am Posts: 4886 Location: some compy
				 
				 
			 | 
			
				
				  Re: Parent Absence Deletion  
					
						Wow. Looks like it's trying to use ToMagazine to convert the MO pointer to a Magazine pointer but the function doesn't exist, similar to the lack of ToArm and ToLeg I suppose. Goddamn. 
					
  
			 | 
		
		
			| Tue Apr 20, 2010 12:32 am | 
			
				
					 
					
					 
				    
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 whitty 
				
				
					 Joined: Sat Jun 16, 2007 2:31 am Posts: 2982 Location: Texas
				 
				 
			 | 
			
				
				  Re: Parent Absence Deletion  
					
						I want to hurt this game. So much.
 
  I mean really why even put something in there if it's broken. 
					
  
			 | 
		
		
			| Tue Apr 20, 2010 1:18 am | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Geti 
				
				
					 Joined: Sun Jul 13, 2008 9:57 am Posts: 4886 Location: some compy
				 
				 
			 | 
			
				
				  Re: Parent Absence Deletion  
					
						It likely just does To<self.ClassName>(self) when you try to run an update string on self, which is probably a MO pointer before create(). Obviously it wouldn't actually do the preceding code what with the <> and all, but something to that effect, still running the original function, and as it doesn't exist, causing a crash. 
					
  
			 | 
		
		
			| Tue Apr 20, 2010 1:52 am | 
			
				
					 
					
					 
				    
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 whitty 
				
				
					 Joined: Sat Jun 16, 2007 2:31 am Posts: 2982 Location: Texas
				 
				 
			 | 
			
				
				  Re: Parent Absence Deletion  
					
						So then, whitty wrote: So then should I just check for the nearest actor and the gun it's holding? Then make it delete based on that. do this?  
					
  
			 | 
		
		
			| Tue Apr 20, 2010 2:10 am | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Geti 
				
				
					 Joined: Sun Jul 13, 2008 9:57 am Posts: 4886 Location: some compy
				 
				 
			 | 
			
				
				  Re: Parent Absence Deletion  
					
						Do you have to use a magazine for the script? That's msot likely what's causing the problem. 
					
  
			 | 
		
		
			| Tue Apr 20, 2010 2:12 am | 
			
				
					 
					
					 
				    
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 whitty 
				
				
					 Joined: Sat Jun 16, 2007 2:31 am Posts: 2982 Location: Texas
				 
				 
			 | 
			
				
				  Re: Parent Absence Deletion  
					
						Errr yeah. The magazine has the sprite of a nuke, so it looks like it's mounted on a gun. When it shoots, the mag disappears (duh) and falls. But I want the mag to disappear completely as soon as it's fired. 
					
  
			 | 
		
		
			| Tue Apr 20, 2010 2:16 am | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Duh102 
				happy carebear mom 
				
					 Joined: Tue Mar 04, 2008 1:40 am Posts: 7096 Location: b8bbd5
				 
				 
			 | 
			
				
				  Re: Parent Absence Deletion  
					
						Discarable = 0 in the ini? 
					
  
			 | 
		
		
			| Tue Apr 20, 2010 2:17 am | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 whitty 
				
				
					 Joined: Sat Jun 16, 2007 2:31 am Posts: 2982 Location: Texas
				 
				 
			 | 
			
				
				  Re: Parent Absence Deletion  
					
						...Seriously? 
					
  
			 | 
		
		
			| Tue Apr 20, 2010 2:18 am | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Duh102 
				happy carebear mom 
				
					 Joined: Tue Mar 04, 2008 1:40 am Posts: 7096 Location: b8bbd5
				 
				 
			 | 
			
				
				  Re: Parent Absence Deletion  
					
						If your mag is finished and you reload, instead of falling it just disappears. 
					
  
			 | 
		
		
			| Tue Apr 20, 2010 2:19 am | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Geti 
				
				
					 Joined: Sun Jul 13, 2008 9:57 am Posts: 4886 Location: some compy
				 
				 
			 | 
			
				
				  Re: Parent Absence Deletion  
					
						Duh102 wrote: Discarable = 0 in the ini? Yeah, this. Possibly destroy the gun at the same time, smoking muzzle AEmitter on a dummy "device" particle spawned by the script. Also self.parent isn't a valid pointer anyway.  
					
  
			 | 
		
		
			| Tue Apr 20, 2010 2:20 am | 
			
				
					 
					
					 
				    
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 whitty 
				
				
					 Joined: Sat Jun 16, 2007 2:31 am Posts: 2982 Location: Texas
				 
				 
			 | 
			
				
				  Re: Parent Absence Deletion  
					
						Duh102 wrote: If your mag is finished and you reload, instead of falling it just disappears. ....Goddamit. I had literally no idea that variable existed.  
					
  
			 | 
		
		
			| Tue Apr 20, 2010 2:21 am | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Duh102 
				happy carebear mom 
				
					 Joined: Tue Mar 04, 2008 1:40 am Posts: 7096 Location: b8bbd5
				 
				 
			 | 
			
				
				  Re: Parent Absence Deletion  
					
						Yeah, it's one of the lesser-known ones. I've used it only a few times for exactly that kind of effect. I think in Food Fight and maybe VaultTec. 
					
  
			 | 
		
		
			| Tue Apr 20, 2010 2:24 am | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
	
		 |