Shields not turning off

Ask questions, discuss ideas, get answers
User avatar
BotHunter
Posts: 480
Joined: Thu Jan 10, 2013 11:22 pm
Contact:

Re: Shields not turning off

Post by BotHunter »

Here is the code for the effect:

Code: Select all

rem *** e_White_rays_01 ***
ObjectTemplate.create EffectBundle e_White_rays_01
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.loadSoundScript ../Common/Sounds/fire.ssc
rem -------------------------------------

ObjectTemplate.addTemplate Em_Plasma01

ObjectTemplate.addTemplate Em_White_rays_01
ObjectTemplate.setPosition 0/0/0

rem ObjectTemplate.addTemplate Em_White_rays_01Smoke
rem ObjectTemplate.setPosition 0/0/0
ObjectTemplate.timeToLive CRD_NONE/-1/0/0
rem -------------------------------------

rem *** Em_White_rays_01 ***
ObjectTemplate.create Emitter Em_White_rays_01Smoke
ObjectTemplate.template Fx_White_rays_01Smoke
ObjectTemplate.looping 1
ObjectTemplate.addEmitterSpeed 1
ObjectTemplate.emitterSpeedScale 1
ObjectTemplate.lodDistance 700
ObjectTemplate.timeToLive CRD_NONE/1/0/0
ObjectTemplate.intensity CRD_UNIFORM/11/20/0

beginrem
ObjectTemplate.relativePositionInDof CRD_UNIFORM/0/0.1/1
ObjectTemplate.relativePositionInRight CRD_UNIFORM/0.1/-0.1/0
ObjectTemplate.positionalSpeedInDof CRD_UNIFORM/0/0.05/1
ObjectTemplate.positionalSpeedInRight CRD_UNIFORM/0/0.05/1
endrem
ObjectTemplate.startRotation CRD_NONE/1/0/0

rem *** Fx_White_rays_01 ***
ObjectTemplate.create SpriteParticle Fx_White_rays_01Smoke
ObjectTemplate.timeToLive CRD_UNIFORM/1/1/0
ObjectTemplate.size CRD_UNIFORM/0.2/0.3/0
ObjectTemplate.gravityModifier CRD_NONE/-0.1/0/0
ObjectTemplate.sizeOverTime 0/2.51985|100/1.89996
ObjectTemplate.texture e_muzs1_I
ObjectTemplate.initRotation CRD_EXPONENTIAL/0/180/1
ObjectTemplate.destBlendMode BMOne
ObjectTemplate.rotationSpeed CRD_UNIFORM/0/50/1
ObjectTemplate.rotationSpeedOverTime 0/0|100/1
ObjectTemplate.colorRGBAOverTime 0/255/254/211/204|32/255/255/223/177|45/145/138/138/167|79/24/0/0/216|100/0/0/0/0



rem *** Em_White_rays_01 ***
ObjectTemplate.create Emitter Em_White_rays_01
ObjectTemplate.template Fx_White_rays_01
ObjectTemplate.looping 1
ObjectTemplate.addEmitterSpeed 1
ObjectTemplate.emitterSpeedScale 1
ObjectTemplate.lodDistance 700
ObjectTemplate.timeToLive CRD_NONE/1/0/0
ObjectTemplate.intensity CRD_UNIFORM/2/4/0
ObjectTemplate.relativePositionInDof CRD_UNIFORM/0/0.1/1
ObjectTemplate.relativePositionInRight CRD_UNIFORM/0.1/-0.1/0
ObjectTemplate.positionalSpeedInDof CRD_UNIFORM/0/0.05/1
ObjectTemplate.positionalSpeedInRight CRD_UNIFORM/0/0.05/1
ObjectTemplate.startRotation CRD_NONE/1/0/0



rem *** Fx_White_rays_01 ***
ObjectTemplate.create SpriteParticle Fx_White_rays_01
ObjectTemplate.timeToLive CRD_UNIFORM/4/6/0
ObjectTemplate.size CRD_NONE/2/0/0
ObjectTemplate.gravityModifier CRD_NONE/0/0/0
ObjectTemplate.sizeOverTime 0/0.1|100/1
ObjectTemplate.texture White_rays_01
ObjectTemplate.useMipMaps 1
ObjectTemplate.initRotation CRD_UNIFORM/1/180/1
ObjectTemplate.XYSizeRatio CRD_NONE/1/0/0
ObjectTemplate.srcBlendMode BMSourceAlpha
ObjectTemplate.destBlendMode BMOne


rem ObjectTemplate.rotationSpeed CRD_UNIFORM/200/300/1
ObjectTemplate.colorRGBAOverTime 0/255/255/255/255|70/255/255/255/255|100/255/255/255/0






rem *** Em_Plasma01 ***
ObjectTemplate.create Emitter Em_Plasma01
ObjectTemplate.template Fx_Plasma01
ObjectTemplate.looping 1
ObjectTemplate.addEmitterSpeed 1
ObjectTemplate.emitterSpeedScale 1
ObjectTemplate.lodDistance 700
ObjectTemplate.timeToLive CRD_NONE/1/0/0
ObjectTemplate.intensity CRD_UNIFORM/2/4/0
ObjectTemplate.relativePositionInDof CRD_UNIFORM/0/0.1/1
ObjectTemplate.relativePositionInRight CRD_UNIFORM/0.1/-0.1/0
ObjectTemplate.positionalSpeedInDof CRD_UNIFORM/0/0.05/1
ObjectTemplate.positionalSpeedInRight CRD_UNIFORM/0/0.05/1
ObjectTemplate.startRotation CRD_NONE/1/0/0



rem *** Fx_Plasma01 ***
ObjectTemplate.create SpriteParticle Fx_Plasma01
ObjectTemplate.timeToLive CRD_UNIFORM/4/6/0
ObjectTemplate.size CRD_NONE/2/0/0
ObjectTemplate.gravityModifier CRD_NONE/0/0/0
ObjectTemplate.sizeOverTime 0/2|100/.1
ObjectTemplate.texture Plasma01
ObjectTemplate.useMipMaps 1
ObjectTemplate.initRotation CRD_UNIFORM/1/180/1
ObjectTemplate.XYSizeRatio CRD_NONE/1/0/0
ObjectTemplate.srcBlendMode BMSourceAlpha
ObjectTemplate.destBlendMode BMOne


rem ObjectTemplate.rotationSpeed CRD_UNIFORM/200/300/1
ObjectTemplate.colorRGBAOverTime 0/255/255/255/0|20/255/255/255/255|80/255/255/255/255|100/255/255/255/0
Can you show me how I would add the shadow as an animation?

EDIT: Also, when running multiplayer, this effect shows fine on the host and weird on all the other PCs. whats happening?
Walk quietly and carry a sniper rifle
User avatar
Apache Thunder
Posts: 1213
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Shields not turning off

Post by Apache Thunder »

I would have to bet it's because you have "addEmitterSpeed" enabled on all your emitters. This results in the inertia of the host object adding to the speed/inertia of the sprites emitted. It looks off in Multiplayer perhaps because you have broken network info on the host PCO? Even if the object is stationary, the addEmitterSpeed would have a noticable impact on the sprites/particles emitted. Here's my revised coding. I've sorted it so all sprites are created after the emitters and removed remmed out code to save space.


I added "ObjectTemplate.startAtCreation 1" to your emitters. I've also removed the addEmitterSpeed and emitterSpeedScale commands. See if the changes help with your problems:

Code: Select all

rem *** e_White_rays_01 ***
ObjectTemplate.create EffectBundle e_White_rays_01
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.loadSoundScript ../Common/Sounds/fire.ssc
rem -------------------------------------
ObjectTemplate.addTemplate Em_Plasma01
ObjectTemplate.addTemplate Em_White_rays_01
rem -------------------------------------
ObjectTemplate.timeToLive CRD_NONE/-1/0/0


rem *** Em_White_rays_01 ***
ObjectTemplate.create Emitter Em_White_rays_01Smoke
ObjectTemplate.template Fx_White_rays_01Smoke
ObjectTemplate.looping 1
ObjectTemplate.startAtCreation 1
ObjectTemplate.lodDistance 700
ObjectTemplate.timeToLive CRD_NONE/1/0/0
ObjectTemplate.intensity CRD_UNIFORM/11/20/0
ObjectTemplate.startRotation CRD_NONE/1/0/0

rem *** Em_White_rays_01 ***
ObjectTemplate.create Emitter Em_White_rays_01
ObjectTemplate.template Fx_White_rays_01
ObjectTemplate.looping 1
ObjectTemplate.startAtCreation 1
ObjectTemplate.lodDistance 700
ObjectTemplate.timeToLive CRD_NONE/1/0/0
ObjectTemplate.intensity CRD_UNIFORM/2/4/0
ObjectTemplate.relativePositionInDof CRD_UNIFORM/0/0.1/1
ObjectTemplate.relativePositionInRight CRD_UNIFORM/0.1/-0.1/0
ObjectTemplate.positionalSpeedInDof CRD_UNIFORM/0/0.05/1
ObjectTemplate.positionalSpeedInRight CRD_UNIFORM/0/0.05/1
ObjectTemplate.startRotation CRD_NONE/1/0/0


rem *** Em_Plasma01 ***
ObjectTemplate.create Emitter Em_Plasma01
ObjectTemplate.template Fx_Plasma01
ObjectTemplate.looping 1
ObjectTemplate.startAtCreation 1
ObjectTemplate.lodDistance 700
ObjectTemplate.timeToLive CRD_NONE/1/0/0
ObjectTemplate.intensity CRD_UNIFORM/2/4/0
ObjectTemplate.relativePositionInDof CRD_UNIFORM/0/0.1/1
ObjectTemplate.relativePositionInRight CRD_UNIFORM/0.1/-0.1/0
ObjectTemplate.positionalSpeedInDof CRD_UNIFORM/0/0.05/1
ObjectTemplate.positionalSpeedInRight CRD_UNIFORM/0/0.05/1
ObjectTemplate.startRotation CRD_NONE/1/0/0

rem *** Fx_White_rays_01 ***
ObjectTemplate.create SpriteParticle Fx_White_rays_01Smoke
ObjectTemplate.timeToLive CRD_NONE/1/0/0
ObjectTemplate.size CRD_UNIFORM/0.2/0.3/0
ObjectTemplate.gravityModifier CRD_NONE/-0.1/0/0
ObjectTemplate.sizeOverTime 0/2.51985|100/1.89996
ObjectTemplate.texture e_muzs1_I
ObjectTemplate.initRotation CRD_EXPONENTIAL/0/180/1
ObjectTemplate.destBlendMode BMOne
ObjectTemplate.rotationSpeed CRD_UNIFORM/0/50/1
ObjectTemplate.rotationSpeedOverTime 0/0|100/1
ObjectTemplate.colorRGBAOverTime 0/255/254/211/204|32/255/255/223/177|45/145/138/138/167|79/24/0/0/216|100/0/0/0/0

rem *** Fx_White_rays_01 ***
ObjectTemplate.create SpriteParticle Fx_White_rays_01
ObjectTemplate.timeToLive CRD_UNIFORM/4/6/0
ObjectTemplate.size CRD_NONE/2/0/0
ObjectTemplate.gravityModifier CRD_NONE/0/0/0
ObjectTemplate.sizeOverTime 0/0.1|100/1
ObjectTemplate.texture White_rays_01
ObjectTemplate.useMipMaps 1
ObjectTemplate.initRotation CRD_UNIFORM/1/180/1
ObjectTemplate.XYSizeRatio CRD_NONE/1/0/0
ObjectTemplate.srcBlendMode BMSourceAlpha
ObjectTemplate.destBlendMode BMOne
ObjectTemplate.colorRGBAOverTime 0/255/255/255/255|70/255/255/255/255|100/255/255/255/0

rem *** Fx_Plasma01 ***
ObjectTemplate.create SpriteParticle Fx_Plasma01
ObjectTemplate.timeToLive CRD_UNIFORM/4/6/0
ObjectTemplate.size CRD_NONE/2/0/0
ObjectTemplate.gravityModifier CRD_NONE/0/0/0
ObjectTemplate.sizeOverTime 0/2|100/.1
ObjectTemplate.texture Plasma01
ObjectTemplate.useMipMaps 1
ObjectTemplate.initRotation CRD_UNIFORM/1/180/1
ObjectTemplate.XYSizeRatio CRD_NONE/1/0/0
ObjectTemplate.srcBlendMode BMSourceAlpha
ObjectTemplate.destBlendMode BMOne
ObjectTemplate.colorRGBAOverTime 0/255/255/255/0|20/255/255/255/255|80/255/255/255/255|100/255/255/255/0
Broken network template code might also be causing your problems. Check that you have created the network template that matches what you have for the PCO (ObjectTemplate.setNetworkableInfo Shield_Bubble_Info)

Remember, network templates are case sensitive. If you have lower case letters instead of capital letters in the names of your network templates but use the opposite and/or inconsistent in the setNeworkableInfo command, it would result in the game not finding the templates that command is asking for. I've noticed that net code is case sensitive. So make sure it matches EXACTLY with what you made in the Network.con file of your PCO.
ImageImageImage
I have cameras in your head!
User avatar
BotHunter
Posts: 480
Joined: Thu Jan 10, 2013 11:22 pm
Contact:

Re: Shields not turning off

Post by BotHunter »

It don't work. Also, i found that if I shoot the shield just until the effect stops, then I stop shooting, it will die about 5-10 seconds after that.
Walk quietly and carry a sniper rifle
User avatar
BotHunter
Posts: 480
Joined: Thu Jan 10, 2013 11:22 pm
Contact:

Re: Shields not turning off

Post by BotHunter »

One question, How did you do so much work on the code without being able to test it, and have it work flawlessly when you handed it over to me?
Walk quietly and carry a sniper rifle
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Shields not turning off

Post by Swaffy »

About the shield dying 5-10 seconds after killing it, have you tried to add a null standardMesh as the wreck object? Kind of like having a 3D model but with nothing there.

You know, instead of trying to remove the wreck all together which might not work properly, just use a blank mesh in place of it...
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
Apache Thunder
Posts: 1213
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Shields not turning off

Post by Apache Thunder »

Lol I just know the code that well I guess. Though without testing there's still a chance of failure. I've memorized a lot of the coding and just type things up from memory. Though the more complicated or more obscure stuff I go back and look at existing code for reference. I rarely cut and paste the smaller things. It's mostly the PCO code I copy and paste then fix up to whatever it is I'm making.

I am to assume your issues with the effects looking weird in multiplayer have been fixed? :D

Yeah do what Swaffy has suggested and set up a lodObject on your PCO. Perhaps instead of using the armor effect system you can have the effect addTemplated to the main bundle on the lodObject and the wreck object would be blank.

I've coded that up for you:

Code: Select all

ObjectTemplate.create PlayerControlObject ShieldDome
ObjectTemplate.setNetworkableInfo Shield_Bubble_Info
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.cullRadiusScale 3
rem ObjectTemplate.addArmorEffect 320 e_White_rays_01 0/8.31/0
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.hasResponsePhysics 1
ObjectTemplate.speedMod 0
ObjectTemplate.hasArmor 1
ObjectTemplate.hitPoints 320
ObjectTemplate.maxHitPoints 320
ObjectTemplate.material 51
ObjectTemplate.drag 1.0
ObjectTemplate.inertiaModifier 0/0/0
ObjectTemplate.mass 20
ObjectTemplate.criticalDamage 100
ObjectTemplate.hpLostWhileCriticalDamage 5
ObjectTemplate.setSoldierExitLocation -2.5/0/0 0/0/0
ObjectTemplate.damageFromWater 0
ObjectTemplate.setMinimapIcon "empty.tga"
ObjectTemplate.timeToLiveAfterDeath 0
ObjectTemplate.fadeAtTimeToLiveAfterDeath 0
ObjectTemplate.noCollisionAsDestroyed 1
rem ----------------------------------
ObjectTemplate.addTemplate lodShieldDome

ObjectTemplate.create LodObject lodShieldDome
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.hasResponsePhysics 1
ObjectTemplate.hasMobilePhysics 1
rem -----------------------------------------
ObjectTemplate.addTemplate ShieldDomeComplex
ObjectTemplate.addTemplate ShieldDomeWreckDummy
rem -----------------------------------------
ObjectTemplate.lodSelector ShieldPCOSelector


ObjectTemplate.create Bundle ShieldDomeComplex
ObjectTemplate.hasCollisoinPhysics 1
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasResponsePhysics 1
rem ------------------------------------------
ObjectTemplate.addTemplate ShieldBlock
ObjectTemplate.addTemplate e_glowShield
ObjectTemplate.setPosition 0/-4/0
ObjectTemplate.addTemplate e_White_rays_01
ObjectTemplate.setPosition 0/8.31/0
rem ----------------------------------
ObjectTemplate.addTemplate DummyEngine

ObjectTemplate.create DummyObject ShieldDomeWreckDummy

LodSelectorTemplate.create DistCompareSelector2 ShieldPCOSelector
LodSelectorTemplate.hasDestroyedLod 1
(I had only looked at an existing vehicle to check that I used the correct lodSelector type. Otherwise the rest I type up from memory. :D )

Replace the PCO template with the code above and it should fix your PCO to use the LodSystem. Hopefully the effects will turn off correctly for you if a wreck object is available for the game to switch to when the PCO dies.

Currently my arch enemy is typos. So every now and then a typo escapes me and my code doesn't work. But I usually spot the problem quickly most of the time. The fastest way to fix crashes is knowing how to use the debugger and what to look for in the log files it generates. ;)
Swaffy wrote:have you tried to add a null standardMesh as the wreck object?

Actually you don't need a geometry at all. In the code above I created a "DummyObject" for the LodObject to use. It doesn't have any more coding to it. DummyObject is an unused object class in BF1942 and I have used it in quite a few of my PCOs and it works great for things like this where I want a dummy wreck object or otherwise need to use a invisible object with no extra coding. :D

As for a quick geometry to "test" the positions of invisible objects. Create one of these bad boys. You won't even have to touch Gmax/3DS Max to make simple visible geometries for quick testing:

Code: Select all

GeometryTemplate.create SimpleGeom DebugMesh_m1
GeometryTemplate.type Sphere
GeometryTemplate.scale 1
GeometryTemplate.tesselation 8/8
GeometryTemplate.color 1/1/1
GeometryTemplate.shader command can be used to apply a RS file shader to the geometry if you desire having a texture on your SimpleGeom.

Example usage:

Code: Select all

GeometryTemplate.create SimpleGeom DiscoTrack1_m1
GeometryTemplate.shader bf1942/levels/Dystopia_City/Objects/Disco/Music/DiscoTracks/Track1
GeometryTemplate.scale 1
GeometryTemplate.tesselation 2/2
GeometryTemplate.type Plane
GeometryTemplate.color 0/0/0
In that example I have one of the SimpleGeom meshes load a Shader that references a BIK texture. I had decided to put the RS file in a location other then the usual standardMesh directory. So you can load RS files from pretty much anywhere if you want.

It's what I use to add "music" as a texture on my Disco JukeBox PCO on the disco building I improved in the interstate mode. In that example the "DiscoTracks" is the RS file and "Track1" is the material in the RS file. Path through the RS file as if it's a folder. The material name is the destination the shader command seeks. Since there's no SM file with hardcoded material names to worry about. I can name my materials anything I want. ;)
ImageImageImage
I have cameras in your head!
User avatar
BotHunter
Posts: 480
Joined: Thu Jan 10, 2013 11:22 pm
Contact:

Re: Shields not turning off

Post by BotHunter »

It didn't work :evil:
But I don't think it is the wreck that is the issue because the visible shield effect (the visible dome) sticks around for that 5-10 seconds too as well as the collision mesh. would it help for me to upload the mod? Thank you for all your work on it! :) :)
Walk quietly and carry a sniper rifle
User avatar
Apache Thunder
Posts: 1213
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Shields not turning off

Post by Apache Thunder »

Sure I can take a look at it PM me a link. Though I may not be able to get anything done today. :P
ImageImageImage
I have cameras in your head!
User avatar
Vilespring
Posts: 740
Joined: Sat Nov 24, 2012 5:47 am
Location: Somewere in the United States

Re: Shields not turning off

Post by Vilespring »

Could I take the files too? I can make the axis tank fire like the allies one, like it used to! The video showed that they fire at the same time, again. :(
A picture is worth a thousand words, but takes up three thousand times the memory.

Area 51: http://battlefieldarea51mod.weebly.com/

Image
"I didn't steal your pizza"
User avatar
Apache Thunder
Posts: 1213
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Shields not turning off

Post by Apache Thunder »

Alright. Found a way to get my hands on some Soda. I don't mod much without having any soda, so today you're in luck. :D
ImageImageImage
I have cameras in your head!
Post Reply