Basic sticking Lua. You'll need to put in your own pointers, if statements, and effects. The object will rotate with the "wounded" object, and will move like a real wound.
Code:
function Create(self)
self.stickpositionX = 0; -- Just some variables put down (but don't edit them) so we know they exist
self.stickpositionY = 0;
self.stickrotation = 0;
self.target = <pointer to target>; -- You want these four lines here to be set one time,
self.stickpositionX = self.Pos.X-self.target.Pos.X; -- so you put them in Update if you want
self.stickpositionY = self.Pos.Y-self.target.Pos.Y; -- Just make sure they're not set more than one time
self.stickrotation = self.target.RotAngle; -- Unless you want the object to stick to something else
end
function Update(self)
self.Pos = self.target.Pos + Vector(self.stickpositionX,self.stickpositionY):RadRotate(self.target.RotAngle-self.stickrotation);
self.RotAngle = self.target.RotAngle;
self.Vel = self.target.Vel; -- Or you can make this (Vector(0,0))
end
Edit: this will work on something that doesn't have custom wounds, too.
EDit2: Wait, if it it doesn't have a custom wound like Entry/Exit Wound, it can't be wounded at all.