Data Realms Fan Forums
http://45.55.195.193/

Throwing knives
http://45.55.195.193/viewtopic.php?f=75&t=17788
Page 2 of 2

Author:  Grif [ Fri Feb 12, 2010 6:03 am ]
Post subject:  Re: Throwing knives

make your throwing knife a regular tdexplosive with an infinite triggerdelay

on impact it gibs into a globalaccscalar = 0 mosrotating with the following code

function Create(self)
for actor in MovableMan.Actors do
local curdist = 50;
local dist = SceneMan:ShortestDistance(self.Pos,actor.Pos);
if dist.Magnitude < curdist then
self.target = actor;
self.RotAngle = dist.Direction; --not actually sure if this works
end
end
if self.target then
self.diffx,self.diffy = self.target.Pos.X - self.Pos.X,self.target.Pos.Y - self.Pos.Y;
end
end

function Update(self)
if MovableMan:IsActor(self.target) == true then
self.Pos.X = self.target.Pos.X - self.diffx;
self.Pos.Y = self.target.Pos.Y - self.diffy;
end
end

should work but it's all untested pseudocode so don't expect it to

and the comment is in there because sceneman.shortestdistance returns a polar vector, one of the arguments for which is magnitude, but I'm not sure if the other is .Dir or .Direction (it should be both but hey, who knows)

Author:  Potatamoto [ Wed Feb 17, 2010 5:48 am ]
Post subject:  Re: Throwing knives

How are the knives coming along?

Author:  Geti [ Wed Feb 17, 2010 6:04 am ]
Post subject:  Re: Throwing knives

dist.Direction should be dist.AbsRadAngle methinks.

Author:  CrazyMLC [ Wed Feb 17, 2010 1:50 pm ]
Post subject:  Re: Throwing knives

I've been slacking because of lack of Lua knowledge, though now that Grif has donated some code I can try to put something together.

Author:  CrazyMLC [ Fri Feb 19, 2010 5:27 am ]
Post subject:  Re: Throwing knives

For some reason it refuses to work, but here it is for now.

Attachments:
ThrownKnives.rte.zip [21.35 KiB]
Downloaded 182 times

Author:  lafe [ Fri Feb 19, 2010 2:32 pm ]
Post subject:  Re: Throwing knives

CrazyMLC wrote:
For some reason it refuses to work, but here it is for now.

I made recursively gibing knives here;
download/file.php?id=31288

Author:  Potatamoto [ Wed Feb 24, 2010 3:14 am ]
Post subject:  Re: Throwing knives

Thanks, Lafe but I'd rather just have it kill instantly rather than gibbing and spraying blood everywhere.
EDIT: By the way once they're done, could you make them a gun so you don't run out of them?

Author:  Potatamoto [ Sun Mar 07, 2010 11:06 pm ]
Post subject:  Re: Throwing knives

CrazyMLC wrote:
For some reason it refuses to work, but here it is for now.

Correct me if I'm wrong but would you be able to do some copy/paste of some scripts in other bombs? Like the stick grenades in the ronin faction. You could copy that and then just add all the sparkle magic you need to. Would that make you be able to throw them?? :???:

Author:  CrazyMLC [ Tue Mar 09, 2010 8:21 am ]
Post subject:  Re: Throwing knives

Possibly. I got everything other than the sparkle magics to work, so we'll have to see.
I'll have to go over the Lua some more to see what is wrong since the console isn't giving me any errors.

Author:  andronicus [ Fri Aug 13, 2010 2:56 pm ]
Post subject:  Re: Throwing knives

Yeah that is very possible. Let me make you a throwing knife.

throwing knife

Author:  Benpasko [ Fri Aug 13, 2010 7:42 pm ]
Post subject:  Re: Throwing knives

You DO realize that the last post in this topic was 6 months ago? I think any interest in this would have died by now.

Author:  Joesycop [ Thu Aug 19, 2010 12:10 pm ]
Post subject:  Re: Throwing knives

Yeah. This should probaly be locked or deleted. Whatever

Author:  Duh102 [ Thu Aug 19, 2010 12:45 pm ]
Post subject:  Re: Throwing knives

Joesycop wrote:
locked

I'll take that as a request and fulfill it.

Page 2 of 2 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/