View unanswered posts | View active topics It is currently Mon Jan 13, 2025 6:46 pm



Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
 Yet Another Implementation Issue - now with added crashing 
Author Message
User avatar

Joined: Mon Jun 29, 2009 2:40 am
Posts: 610
Location: Deep below The Map of Mars
Reply with quote
Post Re: Yet Another Implementation Issue - now with added crashing
That's a facepalmable issue.
Thanks, it's back to "normal" (crashing eventually).
But now I can fix that too.

Edit:
ERROR: No overload of 'MovableManager:AddParticle' Matched the arguments (MovableManager, AEmitter)
I'm confident that this code has worked for me before; and I'f it's appearing from where I think it is, the error appears after it creates one!
Edit:
It does.
Image
The very next thing it does is crash.


Fri Mar 12, 2010 4:30 pm
Profile

Joined: Sat Jun 16, 2007 8:04 pm
Posts: 42
Reply with quote
Post Re: Yet Another Implementation Issue - now with added crashing
Oh yes, I forgot to mention that you are creating the emitter (and MOPixel) once, and using the same reference multiple times. Another invalid pointer issue...so that error message is what you get when you try to do that.

Using your last pastebin link: http://pastebin.com/ChyRsiDG

Here are the problems:
Line 2: self.targetpaintergood = CreateAEmitter("Target Painter Good"); ------debug related
Line 5: self.beamparticle = CreateMOPixel("Arcing Energy Particle");
Line 64: MovableMan:AddParticle(self.targetpaintergood);
Line 77: MovableMan:AddParticle(self.beamparticle);

So in short, you can't reuse pointers with Add functions. Which are what Create functions return to you.

About the agetimer thing:
Delete this line: Line 4: self.Agetimer = Timer();
Replace this code: Line 34: self.Agetimer > self.maxtime == true with this: self.Age > self.maxtime
Replace this code: Line 49: self.Agetimer > self.maxtime == false with this: self.Age < self.maxtime
Replace this code: Line 50: self.timeleft = self.maxtime / 1000 - self.Agetimer/1000; with this: self.timeleft = self.maxtime / 1000 - self.Age/1000;
(you can't do self.Agetimer/1000 with timers anyway as far as i know, or any other of those operations)

You don't need to use == true or == false with X < Y because X < Y itself is (evaluates to) true or false. It might also cause confusion on operator precedence. It's a good idea to use parentheses then.

PhantomAGN wrote:
I do not know what the alternative is for line 27's redundancy.

I meant that you ToActored it twice.

Now at line 21: self.angle = ToActor(self.parent):GetAimAngle(true); ---- Redundant?

I meant to replace line 21 with this:

self.angle = self.parent:GetAimAngle(true);

Because you already did this:
Line 19: self.parent = ToActor(actor);

Btw, would ValidMO work with held guns instead of IsDevice? Haven't tried, and I have to get some sleep now so I won't try now. But i bet somebody has some code where they do that check. I don't have more time now to tell you how to fix that AddParticle issue. It would help if you explain how you want the logic to work?


Sat Mar 13, 2010 4:00 am
Profile
User avatar

Joined: Mon Jun 29, 2009 2:40 am
Posts: 610
Location: Deep below The Map of Mars
Reply with quote
Post Re: Yet Another Implementation Issue - now with added crashing
Terrific explanations, thanks a bundle.
Now I need to re-address my targeting and math to see why the painter acts wrong.


Sat Mar 13, 2010 8:52 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 18 posts ]  Go to page Previous  1, 2

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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.051s | 13 Queries | GZIP : Off ]