View unanswered posts | View active topics It is currently Sat Jan 11, 2025 3:04 pm



Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
 Parent Absence Deletion 
Author Message
User avatar

Joined: Sat Jun 16, 2007 2:31 am
Posts: 2982
Location: Texas
Reply with quote
Post 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
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post 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
Profile
User avatar

Joined: Sat Jun 16, 2007 2:31 am
Posts: 2982
Location: Texas
Reply with quote
Post 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
Profile
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post 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
Profile WWW
User avatar

Joined: Sat Jun 16, 2007 2:31 am
Posts: 2982
Location: Texas
Reply with quote
Post 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
Profile
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post 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
Profile WWW
User avatar

Joined: Sat Jun 16, 2007 2:31 am
Posts: 2982
Location: Texas
Reply with quote
Post 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
Profile
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post 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
Profile WWW
User avatar

Joined: Sat Jun 16, 2007 2:31 am
Posts: 2982
Location: Texas
Reply with quote
Post 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
Profile
happy carebear mom
User avatar

Joined: Tue Mar 04, 2008 1:40 am
Posts: 7096
Location: b8bbd5
Reply with quote
Post Re: Parent Absence Deletion
Discarable = 0 in the ini?


Tue Apr 20, 2010 2:17 am
Profile
User avatar

Joined: Sat Jun 16, 2007 2:31 am
Posts: 2982
Location: Texas
Reply with quote
Post Re: Parent Absence Deletion
...Seriously?


Tue Apr 20, 2010 2:18 am
Profile
happy carebear mom
User avatar

Joined: Tue Mar 04, 2008 1:40 am
Posts: 7096
Location: b8bbd5
Reply with quote
Post 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
Profile
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post 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
Profile WWW
User avatar

Joined: Sat Jun 16, 2007 2:31 am
Posts: 2982
Location: Texas
Reply with quote
Post 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
Profile
happy carebear mom
User avatar

Joined: Tue Mar 04, 2008 1:40 am
Posts: 7096
Location: b8bbd5
Reply with quote
Post 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
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 19 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.032s | 14 Queries | GZIP : Off ]