View unanswered posts | View active topics It is currently Fri Oct 19, 2018 10:20 am



Reply to topic  [ 9 posts ] 
 Issues with Emitters 
Author Message
User avatar

Joined: Thu Jul 24, 2014 9:26 pm
Posts: 9
Reply with quote
Post Issues with Emitters
Okay. So this needs a bit of backstory maybe to help understand the issues at play, or at least it's helpful in some regard.

Trying to make a set of guns that fire 2 forms of projectile at once. I had (foolishly) thought that inserting RegularRound property twice was working, until I figured out otherwise. As a long time coder I think I should've been more suspicious about the same property filling twice working for anything, but this was done after I discovered TracerRound and RegularRound are fired separately, and not in unison.

To fix this foolish blunder I'd made very early in my CC modding experience, I tried making an AEmitter class modified from that of an RPG that emits both projectiles off the bat and disappears, except that this is royally messing up. Quite frankly, nothing I seem to do makes the projectiles generate in any instance whatsoever, and I'm having doubts that the .ini is even being read properly.

Weird happenings with INI:
-I annotated the old code for the emitter, and forgot to fill in a new one. No objections were made in magazine producing said null emission.
-I modified the Emmiter's look several times, but it persists at either being invisible or destroying itself so fast it can't be seen, despite its new 1.5 second lifetime (defined with 1500 MS to be clear)

I'm not too experience with LUA, I admit, but I'm having persistent issues and confusion on some points. Some things I try seem to work, others just royally screw up and do nothing. Some things screw up and crash the game on bootup (as most errors do) and some errors it just says nothing about.

My request is (relatively) simple:
Anyone able to paste me or write a quick example of working "create quickly and destroy" emitters or an explanation as to what various emitter properties do. I already read the DR wiki on the topic, and it was incomplete and understaffed in explanation. Thanks for your time.


Fri Aug 15, 2014 12:26 am
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post Re: Issues with Emitters
Code:
AddAmmo = AEmitter
   PresetName = MI Gatling Gun AEmitter Shot
   Mass = 2
   HitsMOs = 0
   GetsHitByMOs = 0
   OrientToVel = 0
   SpriteFile = ContentFile
      FilePath = MI.rte/Sprites/flash.bmp
   LifeTime = 1
   FrameCount = 3
   SpriteOffset = Vector
      X = -2
      Y = -6.5
   EntryWound = AEmitter
      CopyOf = Dent Metal
   ExitWound = AEmitter
      CopyOf = Dent Metal
   AtomGroup = AtomGroup
      AutoGenerate = 1
      Material = Material
         CopyOf = Military Stuff
      Resolution = 2
      Depth = 0
   DeepGroup = AtomGroup
      AutoGenerate = 1
      Material = Material
         CopyOf = Military Stuff
      Resolution = 4
      Depth = 1
   DeepCheck = 0
   AddEmission = Emission
      EmittedParticle = MOPixel
         CopyOf = Bullet MI Gunship Gatling Gun
      ParticlesPerMinute = 0
      BurstSize = 2
      Spread = 0
      MaxVelocity = 200
      MinVelocity = 200
      PushesEmitter = 0
   EmissionEnabled = 1
   EmissionsIgnoreThis = 1
   BurstTriggered = 1
   BurstSound = Sound
      AddSample = ContentFile
         FilePath = Base.rte/Sounds/Taka.wav


Ripped straight from my gunship mod. Now, this is spawned with Lua, so I'm not entirely sure about wether OrientToVel should be 1 or 0, because in my code it's just spawned and rotated, making it fire in the same angle of the gun. I think it should though, or otherwise it'd be pointing all the time to the right (needs confirmation).

The code is rather simple, I'm not entirely sure if it's going to work or not. I'll try to help you out more if you want the explanation of why it works or why it doesn't (lol).


Fri Aug 15, 2014 2:35 am
Profile
User avatar

Joined: Thu Jul 24, 2014 9:26 pm
Posts: 9
Reply with quote
Post Re: Issues with Emitters
Dude. Thank you 100,000 times over, this is excellent stuff. Sadly, I'm having the same issues as before, the emissions seem to be producing... nothing. It may be loading nulls and not pointing it out (As this could be just how the engine handles it, I've worked with code long enough to say I could see it happening easily) So I'm gonna post the current code, let me know if anything leaps out as an issue. (Pun intended? Maybe.)



MAJOR EDIT: Think I just realized I was defining MOPixel types under the rounds, then citing the rounds as emission type instead of the MOPixels. Your code (and to some extent, my old crap code) were not the cause, just my pour citation of the particle types and LUA not whining over it for whatever reason. Also changed code to spoiler to de-spam post.


Fri Aug 15, 2014 9:28 am
Profile
happy carebear mom
User avatar

Joined: Tue Mar 04, 2008 1:40 am
Posts: 7089
Location: b8bbd5
Reply with quote
Post Re: Issues with Emitters
It's worth noting that ini editing, the "old way" of doing things, does not interact with Lua whatsoever, adding scripts to things is where you'd use Lua. You could probably make your life easier by attaching a Lua script to some dummy round (currently you fire an AEmitter but you could easily fire just an MOPixel with this script attached) that spawns the two particles that you like, but I wouldn't remember how to get the particle's heading and velocity to copy to the new particles.


Fri Aug 15, 2014 2:17 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Wed Sep 05, 2007 4:14 am
Posts: 3966
Location: Canadida
Reply with quote
Post Re: Issues with Emitters
Pull self.Vel, and on defining the particle you want to make, as say "particle", just do something like "particle.Vel = self.Vel".

You don't need a script at all, anyways.


Fri Aug 15, 2014 6:32 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post Re: Issues with Emitters
Remember to use the code tags for code :P

So did you get it working in the end?


Fri Aug 15, 2014 10:12 pm
Profile
User avatar

Joined: Thu Jul 24, 2014 9:26 pm
Posts: 9
Reply with quote
Post Re: Issues with Emitters
All this talk with LUA vs .ini... really no difference as long as it meets the same end result.

Code seemed really spammy to post, so maybe next time I'll try code inside of spoilers.

So the issue mentioned in major edit was sorted out nicely, and after discovering a large firing gap (which was quickly remedied with setting velocity to 1 on original round, so it doesn't produce a large space via travel before emitting the REAL meat of the weapon, and not 0 because it needs some form of velocity to convert into a direction for the emission) and fixing said firing gap, the weaponry is working as intended. Had to do some tweaking with shotguns using Spread property (Which is surprisingly sensitive, I'm using 1/25th of the original ShakeRange) and then some tweaking with ballistics and units to accomadate the new level of firepower in circulation, it's wonderful.

Just now did a slight tweak to remove AIFireVel property from the rounds (useless copy bit possibly carried over from RPG) and hoping this fixes my latest obstacle, which is the AI no longer firing the weapons, likely due to an extreme level of confusion as to how they work in their prediction... though it could also be related to using Base.rte/Null.bmp, and they surprisingly calculate for actual pixel filler when aiming the round, in which case there is no proper angle to fire for the AEmmiter to hit on target. I might see about introducing a new form of Null.bmp that has a center pixel filled in or something after this test is ran.

EDIT: Both attempts at fixing this issue failed. Next guess is that AI knows that the AEmitter has only 1 lifetime. So I'll need to extend the lifetime and manually make the rounds expire using LUA code at the exact same interval. With any luck that'll fool the AI into shooting it properly. I did notice that they only discharge their weapons at absolute point blank rank, as in inside their gun point blank, definite hint.

EDIT2: Changed lifespan to 10000 vs 1, then wrote a REALLY simple script that the AEmmiter class calls that just does Self.Gib instantly. AI wasted 0 time hammering me into the floor with pistol rounds.


Sat Aug 16, 2014 9:27 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post Re: Issues with Emitters
The correct way to use the gib method is "self:GibThis()". Why did you remove AIFireVel though? Wouldn't that have fixed your problem?


Sun Aug 17, 2014 8:38 am
Profile
User avatar

Joined: Sun Jan 28, 2007 10:32 pm
Posts: 1608
Location: UK
Reply with quote
Post Re: Issues with Emitters
Retaining AIFireVel and adding AILifeTime would have solved the problem without needing to involve scripting, yes. :roll:


Sun Aug 17, 2014 7:50 pm
Profile YIM
Display posts from previous:  Sort by  
Reply to topic   [ 9 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.019s | 13 Queries | GZIP : Off ]