Author Topic: Lilboarder's Help Topic  (Read 1552 times)

What I just posted is for bricks, are you trying to get it from the spawn?
I am trying to get it from the item directly. The raycast comes in contact with all items.
Edit: I made the raycast come in contact with the brick, but doesn't do anything either. I'd prefer to have it hit the item, but either way is fine.
« Last Edit: May 23, 2009, 01:57:17 PM by lilboarder32 »

Could you give me an example of the function used to detect collision with spacecasts? It'd help a lot.

Here is one that opens JVS doors:
Code: [Select]
package Alohamora
{
function AlohamoraImage::onHitObject(%this,%obj,%slot,%col,%pos,%normal)
{
if((%col.getType() & $TypeMasks::FxBrickObjectType))
{
if(%col.doorID() > -1)
{
%col.doorOpen(0,0,"",%obj.client);

%col.schedule(3000, "doorClose");
Parent::onHitObject(%this,%obj,%slot,%col,%pos,%normal);
}
}
else
{
Parent::onHitObject(%this,%obj,%slot,%col,%pos,%normal);
}
}
};
activatePackage(Alohamora);
I will also post Space Guy's Spacecasts support if thats what you mean.

If you could just send me the add-on that'd help a lot as I would be able to see exactly what you're doing and what's happening.

K, heres the server.cs.

I don't think you should be using spacecasts for this. You don't need a package for oncollision either.
Working on it, but it's being stubborn. I'll get back to you when it's fixed.

Code: [Select]
function WhateverImage::onHitObject(%this, %obj, %col, %fade, %pos, %normal)
{
   for(%loop = 0; %loop < %obj.getDatablock().maxTools; %loop++)
   {
      %tool = %obj.tool[%loop];
      if(%tool == 0)
      {
         %itemdata = %col.getDataBlock();
         %obj.tool[%loop] = %itemdata;
         %obj.weaponCount++;
         messageClient(%obj.client,'MsgItemPickup','',%loop,%itemdata);
         break;
      }
   }
}
That should work nicely.
« Last Edit: May 26, 2009, 03:20:48 AM by Destiny/Zack0Wack0 »

Didn't work for me... =/

Woops, sorry I put onRaycastHitObject instead of onHitObject.
It's fixed now.

Woops, sorry I put onRaycastHitObject instead of onHitObject.
It's fixed now.
Ya, I saw that and I fixed it myself, but still doesn't work. Is it targeting the item or brick? I tried both of those, but neither worked.

Here's what I have.
I changed several things from the original, including not using spacecasting because to be honest it's not needed for melee weapons.

You have the projectile onCollision, yet theres no specified projectile model. Does it still fire out an invisible projectile? Or what?