Data Realms Fan Forums http://45.55.195.193/ |
|
Attaching script to bullet (cannot match property) http://45.55.195.193/viewtopic.php?f=1&t=19048 |
Page 1 of 1 |
Author: | Awesomeness [ Mon Jun 21, 2010 3:10 am ] |
Post subject: | Attaching script to bullet (cannot match property) |
I have been making a radio which drops missiles from the sky on all enemies. What should happen is the invisible bullet the radio fires calls the Lua code, making it seem like the player is using the radio. Here is the part of the .ini where the Lua script is called from: (You can see the comment near the top where the error is) Code: AddAmmo = Round PresetName = Round OG //Currently I've commented this out because it just crashes on loading //because it "could not match property" //ScriptPath = Epic.rte/Lua/pwn.lua ParticleCount = 1 Particle = MOPixel PresetName = Particle OG Mass = 0 RestThreshold = 500 LifeTime = 1 Sharpness = 0 HitsMOs = 1 GetsHitByMOs = 0 Color = Color R = 143 G = 143 B = 143 Atom = Atom Material = Material CopyOf = Bullet Metal TrailColor = Color R = 155 G = 155 B = 155 TrailLength = 0 Shell = none FireVelocity = 0 Separation = 5 And here is the Lua script I made: Code: function Create(self) for actor in MovableMan.Actors do if actor.Team == 1 then local rocket = CreateACRocket("Rocket MK1") rocket.Pos = Vector(actor.Pos.X,actor.Pos.Y-300) rocket.Vel = Vector(0,50) rocket.RotAngle = 3.1416 MovableMan:AddActor(rocket) end end end Are there any obvious mistakes in this? I really hope so, because I'm not getting anywhere. Sorry for so many questions on this. This is the last one. |
Author: | carriontrooper [ Mon Jun 21, 2010 4:16 am ] |
Post subject: | Re: Attaching script to bullet (cannot match property) |
I already answered twice. |
Author: | Azukki [ Mon Jun 21, 2010 4:22 am ] |
Post subject: | Re: Attaching script to bullet (cannot match property) |
To do what he said, and put the script on the particle instead of the round, you should move it down to below TrailLength, and a add one tab, so it looks like this. You could also just plop it in between other variables belonging to the MOPixel Particle, such as Mass, Sharpness, and LifeTime, but that doesn't look as tidy. Code: AddAmmo = Round PresetName = Round OG ParticleCount = 1 Particle = MOPixel PresetName = Particle OG Mass = 0 RestThreshold = 500 LifeTime = 1 Sharpness = 0 HitsMOs = 1 GetsHitByMOs = 0 Color = Color R = 143 G = 143 B = 143 Atom = Atom Material = Material CopyOf = Bullet Metal TrailColor = Color R = 155 G = 155 B = 155 TrailLength = 0 ScriptPath = Epic.rte/Lua/pwn.lua Shell = none FireVelocity = 0 Separation = 5 You see, it's all about the tabbing. Or at least evidenced by the tabbing. The round is the base object you're creating, but really, you're making a bunch of stuff for that round too. The PresetName, ParticleCount, Particle, Shell, FireVelocity, EjectionVelocity, and Separation are all being defined for the Round. The PresetName, Mass, RestThreshold, Lifetime, Sharpness, HitsMOs, GetsHitByMOs, Color, Atom, and ScriptPath, are all being defined for the Particle MOPixel. R, G, and B are all defined for the Color. Material, TrailColor, and TrailLength are all defined for the Atom. That material is defined as being a copy of a preexisting "Bullet Metal" R, G, and B are all defined for the TrailColor of the atom. Notice that all of those lists above each have their own set of indentation, and they all follow a less-indented line, which is the definition of the thing they describe. This is how CC's .ini files are all structured. In making a round, you made a TrailColor, which you needed for your Atom, which you needed for your MOPixel, which you needed for your Round! You also made a Color for your MOPixel for your Round. And, of course, you made the MOPixel for your Round. Because it needed a Particle. I don't mean to tell you your business, but I think your round also wants a shell. |
Author: | Awesomeness [ Mon Jun 21, 2010 12:31 pm ] |
Post subject: | Re: Attaching script to bullet (cannot match property) |
Azukki wrote: I don't mean to tell you your business, but I think your round also wants a shell. Actually, it doesn't, surprising enough! I'm making a radio. Sorry, CarrionTrooper... |
Author: | carriontrooper [ Mon Jun 21, 2010 2:50 pm ] |
Post subject: | Re: Attaching script to bullet (cannot match property) |
No prob dude, next time keep track of the threads you posted in on. So the forum might be cleaner (no multiple threads about the same thing). Good luck with the radio, I'm waiting for its release. |
Author: | Azukki [ Mon Jun 21, 2010 6:31 pm ] |
Post subject: | Re: Attaching script to bullet (cannot match property) |
Awesomeness wrote: Actually, it doesn't, surprising enough! I'm making a radio. You could make note symbols come out if it's a radio in the musical sense, or little lines to indicate the source of a dialog/audio, like the effect TLB used to show which actor is talking in Prison Break 2. Then again, those could both just as easily be the Particle of the round also. A device that doesn't expel any meaningful particles just kinda seems like missed opportunity to me. Oh well, I won't bother you about it any more, it's your mod, do as you will. |
Author: | Awesomeness [ Mon Jun 21, 2010 7:04 pm ] |
Post subject: | Re: Attaching script to bullet (cannot match property) |
carriontrooper wrote: No prob dude, next time keep track of the threads you posted in on. So the forum might be cleaner (no multiple threads about the same thing). Good luck with the radio, I'm waiting for its release. Here it is! http://forums.datarealms.com/viewtopic.php?f=61&t=16863&p=357909#p357909 |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |