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



Reply to topic  [ 7 posts ] 
 Some lua scripts. 
Author Message
User avatar

Joined: Thu Jan 05, 2012 8:18 am
Posts: 76
Location: In a Sauna, roasting to death
Reply with quote
Post Some lua scripts.
This time i'm looking for two lua scripts.

First is probaply a simple one. A Script that is attached to a bullet, and makes the bullet instantly kill the victim. (a.k.a. Insta-kill)

The second one might be a bit more complicated. a Script that, when attached to a bullet, will make the victim slowly lose health overtime. (also known as poison)

Edit: probaply should have posted in reguests...


Sun Mar 11, 2012 11:39 am
Profile
User avatar

Joined: Wed Jul 06, 2011 5:11 pm
Posts: 226
Reply with quote
Post Re: Some lua scripts.
For the first script, you could just look at the round for the Heavy Sniper Rifle the coalition uses. There's some lua in there as well as .ini code.

And for the second script, isn't that what wounds do already?


Sun Mar 11, 2012 4:21 pm
Profile
User avatar

Joined: Thu Jan 05, 2012 8:18 am
Posts: 76
Location: In a Sauna, roasting to death
Reply with quote
Post Re: Some lua scripts.
Pantera1993 wrote:


And for the second script, isn't that what wounds do already?


Yes, but to cause a wound, you would need to deal damage to the victim.
I'm looking for a way to `poison´ the victim without dealing any other kind of damage to him.

and doesn't the Heavy Sniper lua only add the effects and spawn the particle?


Sun Mar 11, 2012 4:41 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Mon Jul 12, 2010 5:39 am
Posts: 4558
Reply with quote
Post Re: Some lua scripts.
Take a look at the dart gun from Weegee's Citadel scene/mod. It slowly poisons its target, and I'm sure it can be tweaked to poison them faster or quicker.

Make sure you get permission first, though.


Sun Mar 11, 2012 5:57 pm
Profile WWW
User avatar

Joined: Thu Jan 05, 2012 8:18 am
Posts: 76
Location: In a Sauna, roasting to death
Reply with quote
Post Re: Some lua scripts.
Miggles wrote:
Take a look at the dart gun from Weegee's Citadel scene/mod. It slowly poisons its target, and I'm sure it can be tweaked to poison them faster or quicker.

Make sure you get permission first, though.


It Didn't work.
The darts just dissapeared when they hit an actor.
No poison.

Well, enough about that. I have been trying to learn lua, and i believe that in a few weeks, ill be able to fix it myself.

Does anybody know the insta-kill lua script?


Mon Mar 12, 2012 5:15 pm
Profile
User avatar

Joined: Tue Nov 17, 2009 7:38 pm
Posts: 909
Location: France
Reply with quote
Post Re: Some lua scripts.
Dex98 wrote:
Does anybody know the insta-kill lua script?


That should work, although I didn't test it:

Code:
function Update(self)
   local ray = SceneMan:CastMORay(self.Pos , self.Vel*1.25*TimerMan.DeltaTimeSecs*FrameMan.PPM , self.ID , 0, false , 0);
   if ray ~= 255 then
      local mo = MovableMan:GetMOFromID(ray);
      mo:GetRootParent:GibThis();
      self.ToDelete = true;
   end
end

Tell me if you get any errors.


Mon Mar 12, 2012 7:40 pm
Profile
User avatar

Joined: Wed Jul 06, 2011 5:11 pm
Posts: 226
Reply with quote
Post Re: Some lua scripts.
Dex98 wrote:
Pantera1993 wrote:

...and doesn't the Heavy Sniper lua only add the effects and spawn the particle?


Well, I meant just looking at the mechanics of the round in general. It works by firing an emitter which shoots the "round" right after being created. It's a better way to create a powerful round than editing the parameters in the code for a regular round (prevents pushing the actor around caused by heavier rounds).


Wed Mar 14, 2012 2:24 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

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