View unanswered posts | View active topics It is currently Mon Jan 06, 2025 10:16 pm



Reply to topic  [ 7 posts ] 
 Attaching script to bullet (cannot match property) 
Author Message
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post 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.


Mon Jun 21, 2010 3:10 am
Profile
User avatar

Joined: Mon Apr 13, 2009 12:27 pm
Posts: 813
Location: Yogyakarta, Indonesia. A slice o' paradise.
Reply with quote
Post Re: Attaching script to bullet (cannot match property)
I already answered twice.


Mon Jun 21, 2010 4:16 am
Profile YIM WWW
User avatar

Joined: Sat Nov 03, 2007 9:44 pm
Posts: 1916
Location: Flint Hills
Reply with quote
Post 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.


Mon Jun 21, 2010 4:22 am
Profile
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post 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...


Mon Jun 21, 2010 12:31 pm
Profile
User avatar

Joined: Mon Apr 13, 2009 12:27 pm
Posts: 813
Location: Yogyakarta, Indonesia. A slice o' paradise.
Reply with quote
Post 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. :D


Mon Jun 21, 2010 2:50 pm
Profile YIM WWW
User avatar

Joined: Sat Nov 03, 2007 9:44 pm
Posts: 1916
Location: Flint Hills
Reply with quote
Post 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.


Mon Jun 21, 2010 6:31 pm
Profile
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post 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. :D

Here it is! :grin: http://forums.datarealms.com/viewtopic.php?f=61&t=16863&p=357909#p357909


Mon Jun 21, 2010 7:04 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: Google [Bot]


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.060s | 14 Queries | GZIP : Off ]