View unanswered posts | View active topics It is currently Fri Dec 27, 2024 9:18 am



Reply to topic  [ 6 posts ] 
 Ok... This ain't funny anymore. 
Author Message
User avatar

Joined: Sun May 11, 2008 12:50 pm
Posts: 899
Reply with quote
Post Ok... This ain't funny anymore.
I keep getting errors that look like this:
Image
Just a ton of symbols and words with no meaning what so ever. At first I thought it was funny and ignored it, but its really starting to get on my nerves.
This is what triggers it:
Code:
function Create(self)
   self.curDist = 20;

   local i = Vector(0,0);
   i.X = math.cos(self.RotAngle) * self.curDist * -1;
   i.Y = math.sin(self.RotAngle) * self.curDist;
   local ParentID = SceneMan:CastMORay(self.Pos, i, self.ID, -1, false, 0);
   if ParentID ~= 255 then
      local j = MovableMan:GetRootMOID(ParentID);
      self.Parent = MovableMan:GetMOFromID(j);
      if self.Parent:IsActor() then

         for i = 0, MovableMan:GetMOIDCount() do
            if MovableMan:GetRootMOID(i) == self.Parent.ID and MovableMan:GetMOFromID(i).PresetName == "Grapple Gun" then
               self.gun = MovableMan:GetMOFromID(i);
            end
         end

         if ToHeldDevice(self.gun):IsActivated() and ToHeldDevice(self.gun):IsFull() ~= true then
            local Smoke = CreateAEmitter("Smoke Emitter");
            Smoke.Pos = self.Pos;
            Smoke.RotAngle = ToActor(self.Parent):GetAimAngle(true);
            MovableMan:AddParticle(Smoke);
         end
      end
   end
   self.Lifetime = 1;
end


Or more specifically, this:
Code:
ToHeldDevice(self.gun):IsFull() ~= true


What I have here is a MOSRot emitted off of a gun. It finds the actor I'm using and its gun, runs the script, and deletes. All in one update.
What I'm trying to do with that line is fire some effect particles when the gun is fired, but if you keep holding the fire button it shoots the effects out non stop. This is where the broken line comes in, it limits the particle creation to as long as the gun still has ammo (A few frames). Is there is any way to limit the creation without using the broken part, or fixing it so the broken part still works?


Fri Dec 11, 2009 3:44 pm
Profile WWW
User avatar

Joined: Mon Jul 16, 2007 9:50 am
Posts: 1512
Location: Tallahassee, FL
Reply with quote
Post Re: Ok... This ain't funny anymore.
Man... that's new to me. Does it not do it when the IsFull() line isn't there? Maybe there's just something inherently wrong with it.


Fri Dec 11, 2009 5:20 pm
Profile YIM
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post Re: Ok... This ain't funny anymore.
Try pming Grif. I think that banned users can pm, but I'm not sure.


Sat Dec 12, 2009 4:30 am
Profile WWW
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post Re: Ok... This ain't funny anymore.
They can.
Anyway, for those that haven't encountered errors like this before, its generally because something is being called on an object in game, using functions that it holds (or doesnt hold), and it breaking.
Roon, you should probably be using ToHDFirearm, incase HeldDevices dont have IsFull and all that jazz, though they should, according to the wiki.
As I said in PM, try splitting up the check.
I might tinker with it tonight, but probably not.


Sat Dec 12, 2009 8:52 am
Profile WWW
User avatar

Joined: Sun May 11, 2008 12:50 pm
Posts: 899
Reply with quote
Post Re: Ok... This ain't funny anymore.
Thanks for the help guys. Both splitting the checks and using ToHDFirearm didn't work. I got it working by emitting it off of the muzzle flash and applying some hacky lua to get it doing what I want.


Sat Dec 12, 2009 11:41 am
Profile WWW
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post Re: Ok... This ain't funny anymore.
Well, it's a workaround. Be nice to find the root of it though.


Sat Dec 12, 2009 1:21 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

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.058s | 13 Queries | GZIP : Off ]