Data Realms Fan Forums
http://45.55.195.193/

How to run a script when a weapon is fired
http://45.55.195.193/viewtopic.php?f=73&t=19044
Page 1 of 1

Author:  Awesomeness [ Sun Jun 20, 2010 10:16 pm ]
Post subject:  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.

Author:  TheLastBanana [ Sun Jun 20, 2010 10:23 pm ]
Post subject:  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.

Author:  Awesomeness [ Sun Jun 20, 2010 10:59 pm ]
Post subject:  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)?

Author:  Duh102 [ Sun Jun 20, 2010 11:03 pm ]
Post subject:  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.

Author:  Awesomeness [ Sun Jun 20, 2010 11:31 pm ]
Post subject:  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.

Author:  CaveCricket48 [ Sun Jun 20, 2010 11:33 pm ]
Post subject:  Re: How to run a script when a weapon is fired

RTTRatio = 0 won't crash and it will disable tracers.

Author:  Awesomeness [ Sun Jun 20, 2010 11:45 pm ]
Post subject:  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...)

Author:  CaveCricket48 [ Sun Jun 20, 2010 11:59 pm ]
Post subject:  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.

Author:  Awesomeness [ Mon Jun 21, 2010 12:36 am ]
Post subject:  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.

Author:  Awesomeness [ Mon Jun 21, 2010 1:10 am ]
Post subject:  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.

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