Data Realms Fan Forums
http://45.55.195.193/

Parent Absence Deletion
http://45.55.195.193/viewtopic.php?f=73&t=18541
Page 1 of 2

Author:  whitty [ Tue Apr 20, 2010 12:04 am ]
Post subject:  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?

Author:  Grif [ Tue Apr 20, 2010 12:20 am ]
Post subject:  Re: Parent Absence Deletion

that can't be all of your code

Unless CC's attachable based lua is really that broken.

Author:  whitty [ Tue Apr 20, 2010 12:23 am ]
Post subject:  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.

Author:  Geti [ Tue Apr 20, 2010 12:32 am ]
Post subject:  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.

Author:  whitty [ Tue Apr 20, 2010 1:18 am ]
Post subject:  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.

Author:  Geti [ Tue Apr 20, 2010 1:52 am ]
Post subject:  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.

Author:  whitty [ Tue Apr 20, 2010 2:10 am ]
Post subject:  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?

Author:  Geti [ Tue Apr 20, 2010 2:12 am ]
Post subject:  Re: Parent Absence Deletion

Do you have to use a magazine for the script? That's msot likely what's causing the problem.

Author:  whitty [ Tue Apr 20, 2010 2:16 am ]
Post subject:  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.

Author:  Duh102 [ Tue Apr 20, 2010 2:17 am ]
Post subject:  Re: Parent Absence Deletion

Discarable = 0 in the ini?

Author:  whitty [ Tue Apr 20, 2010 2:18 am ]
Post subject:  Re: Parent Absence Deletion

...Seriously?

Author:  Duh102 [ Tue Apr 20, 2010 2:19 am ]
Post subject:  Re: Parent Absence Deletion

If your mag is finished and you reload, instead of falling it just disappears.

Author:  Geti [ Tue Apr 20, 2010 2:20 am ]
Post subject:  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.

Author:  whitty [ Tue Apr 20, 2010 2:21 am ]
Post subject:  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.

Author:  Duh102 [ Tue Apr 20, 2010 2:24 am ]
Post subject:  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.

Page 1 of 2 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/