Author Topic: Crash on Mountimage @ 0 or UnMountImage @ 0.  (Read 1988 times)

that means that when the burst cannon is unmounted something causes it to be mounted again

and then unmounted again

Here is the code I have.

Code: [Select]
function burstcannonImage::onMount(%this,%obj,%slot)
{
  parent::onMount(%this,%obj,%slot);
  if(%obj.getMountedImage(0).getName() $= "rocketlauncherImage") { %obj.unMountImage(0); } //burstcannonNullImage
}

function burstcannonImage::onUnMount(%this,%obj,%slot)
{
//  parent::onUnMount(%this,%obj,%slot);
//  %obj.unMountImage(1);
  %obj.mountImage(rocketlauncherImage,0);
}

package burstcannonPackage
{
function servercmdDropTool(%this,%slot)
{
if(isobject(%this.player.tool[%slot]) && %this.player.tool[%slot].getname() $= "burstcannonImage")
{
parent::servercmdDropTool(%this,%slot);

if(isobject(%this.player.getmountedimage(0)) && %this.player.getmountedimage(0).getname() $= "rocketlauncherImage")
{
%this.player.schedule(5,unmountimage,0);
}
return;
}
parent::servercmdDropTool(%this,%slot);
}
};
activatepackage(burstcannonPackage);

I'll try to hunt out any logic errors, but I would appreciate if you happen to find any issues as well.

Note: The rocket launcher image is a test image for the secondary image.

going to randomly suggest commenting this out if(%obj.getMountedImage(0).getName() $= "rocketlauncherImage") { %obj.unMountImage(0); } //burstcannonNullImage

Oh, I think I see what you mean.

OnMount, check for image 2, if image 2, unmount.
On unmount, mount image 2.
OnMount, check for image 2, if image 2, unmount.

Basically while(1); in a nutshell.

I'll check into it.

yeah, it's not a solid, obvious loop
function derp() { blah(); }
function blah() { derp(); }


but it still looks suspicious.

Wow, this is very aggravating.

I commented out both of the lines in the OnMount function and I'm still getting crashed. I'm going to trace again, though it may say the same thing.

Edit: Look familiar?
Entering burstcannonImage::onUnMount(1309, 13844, 0)
« Last Edit: July 19, 2012, 07:58:21 PM by FrogFreak »

if(%obj.getMountedImage(0).getName() $= "rocketlauncherImage") { %obj.unMountImage(0); }

what the hell do you need that for

also why do you really need two images for one weapon like that

that packaged function looks suspicious as well, try moving the check above the parent.

I guess I don't really need a second image...

no really what are you trying to do

if you're trying to make alternate firing modes try making a binary switch with setimageAmmo and transitionOnAmmo/NoAmmo

No, I'll run it down.

When a player equips this weapon, it acts like a normal weapon. However, when you unequip it, the weapon will remain mounted until the weapon is swapped or dropped.