View unanswered posts | View active topics It is currently Fri Dec 27, 2024 8:02 am



Reply to topic  [ 10 posts ] 
 How to run a script when a weapon is fired 
Author Message
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post How to run a script when a weapon is fired
...Without shooting a bullet. I'm sorry; I know for sure this is the stupidest, easiest question in the world, but I just can't seem to figure out how to do it.


Sun Jun 20, 2010 10:16 pm
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post Re: How to run a script when a weapon is fired
Make the gun fire a bullet, but make the bullet invisible and incapable of hitting anything. Apply your script to said bullet.


Sun Jun 20, 2010 10:23 pm
Profile WWW
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post Re: How to run a script when a weapon is fired
Thanks. That's what I was going to do, but I thought there had to be a more elegant solution. Also, how can I make a weapon I create have an infinite clip (like the shovel, for example)?


Sun Jun 20, 2010 10:59 pm
Profile
happy carebear mom
User avatar

Joined: Tue Mar 04, 2008 1:40 am
Posts: 7096
Location: b8bbd5
Reply with quote
Post Re: How to run a script when a weapon is fired
Set the AmmoCount in the magazine to -1.
Be warned the AI can't figure infinite ammo weapons out and will wave it around ineffectually.


Sun Jun 20, 2010 11:03 pm
Profile
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post Re: How to run a script when a weapon is fired
And would setting the RTTRatio to 0 make it so that there are no tracers, or would it just crash? Or, is there a more elegant way to do this?

Sorry for all the questions, I'm trying to make a radio that runs a certain script when I fire, and it's proving very difficult. I will probably have a few more.


Sun Jun 20, 2010 11:31 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: How to run a script when a weapon is fired
RTTRatio = 0 won't crash and it will disable tracers.


Sun Jun 20, 2010 11:33 pm
Profile
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post Re: How to run a script when a weapon is fired
Okay, and since the ratio set to zero, can I remove the tracer code entirely? And also, how do I prevent my radio from spitting out shells every time I use it? >.<

(Sorry for asking so many questions...)


Sun Jun 20, 2010 11:45 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: How to run a script when a weapon is fired
In the round code block, you should see something that says:
Code:
   Shell = MOSParticle
      CopyOf = Casing

Change it to:
Code:
   Shell = None

Or remove it entirely.


Sun Jun 20, 2010 11:59 pm
Profile
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post Re: How to run a script when a weapon is fired
Okay, I am almost done. It doesn't do anything when I click. No bullets, no flash, no shells, no crapping out magazines due to infinite ammo, etc. Now I have only three problems left. Then I'm done!


1. So, I put in this:

Code:
...
AddAmmo = Round

[line 53]   ScriptPath = Epic.rte/Lua/pwn.lua
...

What pwn.lua does (I've tested it) is drop a rocket aiming down at high speed at every enemy on the field. So what my radio should do is pwn everyone with rockets when you use it. However, the loading screen crashes and tells me it has an error at line 53. It said something about being unable to match something. I'm too impatient to load it again, (because for some reason mods load after everything else and it takes forever to bugfix) so I won't find out what it really says for you unless you really need it.

EDIT: I did it again because I didn't have anything else to do; it's "could not match property".

2. My radio's sprite is screwed up. I saved it as a BMP in Photoshop, and the sprite looks fine when I'm holding it facing to the right, but it's a certain weird mix of brown, grey, and bright orange boxes and lines when looked at from the menu or when facing to the left. Did I save the BMP in some particular way that CC doesn't like?

3. One I have 2 fixed, I can add eye candy. I'll find a beeping sound to do when I fire easily, but how can I change the sprite as well for about a second after using it? Normally, it would have a red light, but for a second or so it'd switch to green. I have both BMPs already made.


Mon Jun 21, 2010 12:36 am
Profile
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post Re: How to run a script when a weapon is fired
You know what? I'll put this last question in a new thread, because all these questions aren't what this thread was for.


Mon Jun 21, 2010 1:10 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 10 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.078s | 13 Queries | GZIP : Off ]