Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Fri Apr 19, 2024 7:02 pm
All times are UTC + 0
Railgun disengages after firing [support request]
Moderators: Global Moderators, Red Alert 2 Moderators
Post new topic   Reply to topic Page 1 of 1 [9 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
Millennium
Commander


Joined: 09 Mar 2008
Location: Osaka (JP)/Hong Kong/Germany

PostPosted: Sat May 23, 2015 5:46 pm    Post subject:  Railgun disengages after firing [support request] Reply with quote  Mark this post and the followings unread

A common problem I've encountered with units with railgun weapons is that they would fire once, then disengage/stop firing after, acquiring a new target or requiring one to manually order them to fire again, much like if the unit has FireOnce=yes set. It occurs on some units and weapons, not on others, and I never managed to pinpoint the cause/system behind what causes it on some units, but not on others.

I've now made a unit that I find it particularly annoying on and would like to find out how to fix it. Maybe someone in the community has an idea about what causes it? Here is the code to the weapon/railgun particle system/particle. Maybe there is a bug somewhere in there?

Code:

;------------------------------------------------------------------------------
; ECM Tank - Use against vehicles/buildings.
[TankJammerKit]
Damage=0
ROF=120
Range=10
Speed=100
Projectile=InvisibleAll
Warhead=TankJammerWH      ;EMEffect
Report=CommCenterLoop
Bright=yes
IsRailgun=true
AttachedParticleSystem=HackFXSys

;------------------------------------------------------------------------------
[HackFXSys]
BehavesLike=Railgun
HoldsWhat=HackFXPart
Spawns=yes
SpawnFrames=1
SpawnRadius=1
Slowdown=.002 ; Can be any number, .002 is a good value
ParticleCap=7
SpawnCutoff=10
SpawnTranslucencyCutoff=11

SpiralRadius=15
ParticlesPerCoord=.05
SpiralDeltaPerCoord=.03
MovementPerturbationCoefficient=.4
PositionPerturbationCoefficient=30
VelocityPerturbationCoefficient=.6

;------------------------------------------------------------------------------
[HackFXPart]
BehavesLike=Smoke
MaxEC=30
Image=HACKFX
Translucency=25
Velocity=5.0
Deacc=.05
WindEffect=0
DeleteOnStateLimit=yes
EndStateAI=20
StateAIAdvance=3


HACKFX itself is a 2-frame animation.

_________________
Mao Zedong wrote:

Our mission, unfinished, may take a thousand years.  

Back to top
View user's profile Send private message
ApolloTD
Commander


Joined: 19 Nov 2003

PostPosted: Sat May 23, 2015 7:05 pm    Post subject: Reply with quote  Mark this post and the followings unread

Railguns have to wait until the particle dissipates to fire again, until this happens it won't fire again. This is just the way particles work on the game.

Your particle codes are clearly copy and pasted, spawn codes not needed and may only add lag by increased instances.

Endstateai is all wrong, you were supposed to put frame count as current waits to 20 frames to be met and you set each frame to wait 3 frames prior to change to next frame.

You should have read the particle tutorials first Wink

Back to top
View user's profile Send private message
Millennium
Commander


Joined: 09 Mar 2008
Location: Osaka (JP)/Hong Kong/Germany

PostPosted: Sat May 23, 2015 7:17 pm    Post subject: Reply with quote  Mark this post and the followings unread

Copypasted from a guide to making SHP railgun particles, no less!

So to clarify, the Attack mission gets interrupted because the weapon is unable to fire again? I thought MaxEC would be enough to handle that. I will apply your corrections and then see what happens.

I know the same issue of particle dissipation in TS caused the unit to be unable to fire again EVER.

Edit:
Okay, this seems to have solved the issue! Using ForceFire on the ground still sometimes produces the effect (sometimes, even more strange, the unit will fire twice before stopping), but firing on units/buildings seems to work now.

_________________
Mao Zedong wrote:

Our mission, unfinished, may take a thousand years.  

Back to top
View user's profile Send private message
Graion Dilach
Defense Minister


Joined: 22 Nov 2010
Location: Iszkaszentgyorgy, Hungary

PostPosted: Sat May 23, 2015 7:34 pm    Post subject: Reply with quote  Mark this post and the followings unread


_________________
"If you didn't get angry and mad and frustrated, that means you don't care about the end result, and are doing something wrong." - Greg Kroah-Hartman
=======================
Past C&C projects: Attacque Supérior (2010-2019); Valiant Shades (2019-2021)
=======================
WeiDU mods: Random Graion Tweaks | Graion's Soundsets
Maintainance: Extra Expanded Enhanced Encounters! | BGEESpawn
Contributions: EE Fixpack | Enhanced Edition Trilogy | DSotSC (Trilogy) | UB_IWD | SotSC & a lot more...

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID
Millennium
Commander


Joined: 09 Mar 2008
Location: Osaka (JP)/Hong Kong/Germany

PostPosted: Sat May 23, 2015 7:54 pm    Post subject: Reply with quote  Mark this post and the followings unread

I'm afraid the content of that link does not contain correct information either... maybe you should have read it before posting it.

None of this indicates that EndStateAI preferable to using MaxEC, nor that EndStateAI is even useable on a ParticleSystem which BehavesLike=Railgun... I will make an effort to edit the guide on ModEnc to clarify this.

Basically I was aware that this was caused by the particles failing to expire according to their MaxEC, but I did not realize MaxEC was entirely unfunctional on this kind of particle.

_________________
Mao Zedong wrote:

Our mission, unfinished, may take a thousand years.  

Back to top
View user's profile Send private message
Graion Dilach
Defense Minister


Joined: 22 Nov 2010
Location: Iszkaszentgyorgy, Hungary

PostPosted: Sat May 23, 2015 8:19 pm    Post subject: Reply with quote  Mark this post and the followings unread

"In reality, particles get a random lifetime bonus when they're created - particles with BehavesLike=Railgun get a random bonus of [1..10] frames, other particles get a random bonus of [1..MaxEC] frames."

You're using Smoke particles. MaxEC=30. This means that your particle will get an avg of 45 as EC value.

It also tells everything Apollo said about AIState.

Who can't read, again?

_________________
"If you didn't get angry and mad and frustrated, that means you don't care about the end result, and are doing something wrong." - Greg Kroah-Hartman
=======================
Past C&C projects: Attacque Supérior (2010-2019); Valiant Shades (2019-2021)
=======================
WeiDU mods: Random Graion Tweaks | Graion's Soundsets
Maintainance: Extra Expanded Enhanced Encounters! | BGEESpawn
Contributions: EE Fixpack | Enhanced Edition Trilogy | DSotSC (Trilogy) | UB_IWD | SotSC & a lot more...

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID
GenesisAria
Cyborg Firebomber


Joined: 10 Mar 2015
Location: Canaderp

PostPosted: Sun May 24, 2015 1:41 am    Post subject: Reply with quote  Mark this post and the followings unread

You're always better off starting with existing things you know work, like the TS railgun sys and then modifying it from there.  Then you can see what is working and what isn't as you change things.

I could have probably helped you figure this one out (if you were ever on skype), as i'd already made an awesome smokey railgun system.  And my smoke anims are LGRYSMK1 so they even last a fair bit of time. I've had no issues with it.

_________________
????????           MyAnimeList            my Last.fm

Back to top
View user's profile Send private message
Millennium
Commander


Joined: 09 Mar 2008
Location: Osaka (JP)/Hong Kong/Germany

PostPosted: Sun May 24, 2015 2:17 am    Post subject: Reply with quote  Mark this post and the followings unread

Graion Dilach wrote:
"In reality, particles get a random lifetime bonus when they're created - particles with BehavesLike=Railgun get a random bonus of [1..10] frames, other particles get a random bonus of [1..MaxEC] frames."

You're using Smoke particles. MaxEC=30. This means that your particle will get an avg of 45 as EC value.

It also tells everything Apollo said about AIState.

Who can't read, again?


You.

ModEnc wrote:

Most of these flags only apply to particles in ParticleSystems with certain behaviours. Namely, "AIState" advances are only done for ParticleSystems with {{tt|1=BehavesLike=Smoke}} or {{tt|1=BehavesLike=Gas}}. Other behaviours only increment the ExpirationCounter and expire particles if it reaches the limit.

ParticleSystems.

Aside from your wicked attitude though, the main issue here is really that these articles have been written and re-written by several people over a long period of time and some information may not be updated or in tune with other parts of the text. That makes them contradictory and prone to causing misunderstandings.

_________________
Mao Zedong wrote:

Our mission, unfinished, may take a thousand years.  

Back to top
View user's profile Send private message
ApolloTD
Commander


Joined: 19 Nov 2003

PostPosted: Sun May 24, 2015 6:11 am    Post subject: Reply with quote  Mark this post and the followings unread

Sigh, the misconceptions... There is a very detailed tutorial here on particles that explains on more basic detail the workings and you should read them all than only a few.
I'd search it and link but at mercy of mobile now.
Gamemate's old shp railgun particle code is bad tutorial as hardly explains as its from 2004 random code trialing and sadly it lags bad etc being unoptimally coded.

Thus bad particle coding can jam a unit weapon permanently at worst.

The reason maxec not apply here is setting deleteonstatelimit thus erases meeting endstate than wait maxec, this is necessary when multiple subparticles in system, namely smoke for example and here you have no reason to use maxec since shp art defines end.

Endstate is always used with shp art particles.

The only way you get optimal code is to learn meaning of code, these code giveouts can be detrimental if not adjust.  Rolling Eyes

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [9 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.1837s ][ Queries: 11 (0.0078s) ][ Debug on ]