View unanswered posts | View active topics It is currently Sat Dec 28, 2024 6:27 pm



This topic is locked, you cannot edit posts or make further replies.  [ 28 posts ]  Go to page Previous  1, 2
 Throwing knives 
Author Message
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Post 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)


Fri Feb 12, 2010 6:03 am
Profile
User avatar

Joined: Fri Jan 01, 2010 4:37 am
Posts: 112
Location: Why do you wanna know? Are you a serial killer?!?
Post Re: Throwing knives
How are the knives coming along?


Wed Feb 17, 2010 5:48 am
Profile
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Post Re: Throwing knives
dist.Direction should be dist.AbsRadAngle methinks.


Wed Feb 17, 2010 6:04 am
Profile WWW
User avatar

Joined: Fri Dec 22, 2006 4:20 am
Posts: 4772
Location: Good news everyone!
Post 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.


Wed Feb 17, 2010 1:50 pm
Profile WWW
User avatar

Joined: Fri Dec 22, 2006 4:20 am
Posts: 4772
Location: Good news everyone!
Post Re: Throwing knives
For some reason it refuses to work, but here it is for now.


Attachments:
ThrownKnives.rte.zip [21.35 KiB]
Downloaded 197 times
Fri Feb 19, 2010 5:27 am
Profile WWW
User avatar

Joined: Sat Mar 28, 2009 2:33 pm
Posts: 718
Post 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


Fri Feb 19, 2010 2:32 pm
Profile
User avatar

Joined: Fri Jan 01, 2010 4:37 am
Posts: 112
Location: Why do you wanna know? Are you a serial killer?!?
Post 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?


Wed Feb 24, 2010 3:14 am
Profile
User avatar

Joined: Fri Jan 01, 2010 4:37 am
Posts: 112
Location: Why do you wanna know? Are you a serial killer?!?
Post 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?? :???:


Sun Mar 07, 2010 11:06 pm
Profile
User avatar

Joined: Fri Dec 22, 2006 4:20 am
Posts: 4772
Location: Good news everyone!
Post 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.


Tue Mar 09, 2010 8:21 am
Profile WWW

Joined: Fri Aug 13, 2010 2:18 pm
Posts: 2
Post Re: Throwing knives
Yeah that is very possible. Let me make you a throwing knife.

throwing knife


Last edited by andronicus on Fri Aug 13, 2010 7:48 pm, edited 1 time in total.



Fri Aug 13, 2010 2:56 pm
Profile
User avatar

Joined: Sun Aug 09, 2009 9:26 am
Posts: 1633
Post 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.


Fri Aug 13, 2010 7:42 pm
Profile
User avatar

Joined: Mon Oct 19, 2009 9:04 am
Posts: 302
Location: Under Your Bed
Post Re: Throwing knives
Yeah. This should probaly be locked or deleted. Whatever


Thu Aug 19, 2010 12:10 pm
Profile YIM
happy carebear mom
User avatar

Joined: Tue Mar 04, 2008 1:40 am
Posts: 7096
Location: b8bbd5
Post Re: Throwing knives
Joesycop wrote:
locked

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


Thu Aug 19, 2010 12:45 pm
Profile
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.   [ 28 posts ]  Go to page Previous  1, 2

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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.052s | 15 Queries | GZIP : Off ]