Attach an Emitter to a PCO?

Ask questions, discuss ideas, get answers
Post Reply
Diamondback
Posts: 589
Joined: Mon Oct 01, 2012 3:13 pm
Location: Canada
Contact:

Attach an Emitter to a PCO?

Post by Diamondback »

Hey, so basically I would like to create some sort of electric lights in game. How it would work is I would have an Emitter tied to a PCO. The Emitter would be the lights, or light effect. I would have the Emitter lights placed in a dark place (i.e., an underground bunker). When the power console (the PCO to which the Emitters are tied to) is destroyed, or damaged beyond a certain point, the lights shut down (the Emitter "dies").

Apache, can Emitters be tied to PCOs from your experience?
See my Strasbourg map project here.
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Re: Attach an Emitter to a PCO?

Post by freddy »

Hmm im really not good with this, but emitters is (or can be?) controlled by a Effect?

If so then you should be able to build it like

Code: Select all

ObjectTemplate.addArmorEffect 100 em_your_light_effect 0/00/0
ObjectTemplate.addArmorEffect 20 em_something_else_to_cancel_the _former_effect 0/00/0
100= no damage to armor in % and when it reach 20 that effect cancel out the first one. Its just a theory i dont have experience with this.
Diamondback
Posts: 589
Joined: Mon Oct 01, 2012 3:13 pm
Location: Canada
Contact:

Re: Attach an Emitter to a PCO?

Post by Diamondback »

I will try that, thanks. Doing an Emitter that looks like a light will be the hardest part though. I'll be looking at Apache's BF Heroes mod to see if I can find anything.
See my Strasbourg map project here.
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Attach an Emitter to a PCO?

Post by Apache Thunder »

The closest I got to attaching light sprites to a mobile PCO was via the treeMesh system and even then it was kind of janky on how I did it. Not very optimized because I had to work around a bug with the treeMesh max scripts. Even the MDT stuff seems to break treeMesh sprites. Even when editing existing treeMeshes. The sprites only show up at a very narrow angle after editing/creating them with said scripts. So I had to create headlight sprites by creating copies of the treeMesh in code but rotated at different angles to cover all the missing angles. It's not a very optimized way of doing it and I feel it could slow the game down in some circumstances. This is also why I didn't use the treeMesh system at all for handling the trees for my bfheroes mod. Battlefield Heroes actually was the only game engine since bf1942 where the treeMesh sprites made a sorta comeback. They made use of sprites for the trees (when at a high enough detail setting in graphic settings) and in theory this would translate perfectly back to bf1942. But said problems with the max scripts means I could never properly port them and have them actually work properly. :(

There's no practical way of doing this via the effect system since sprites don't behave the same way as treeMesh sprites. Unlike particles, effect sprites don't like being fixed to a specific location on a moving emitter. They have to have some kind of intial movement or be fixed to a specific location in world space. they will never remain fixed to the host object.

The best system in theory was the lensflare system. Rallisport Challenge the first game to use the Refractor 2 game engine used that for dealing with vehicle headlights. But as we know, Dice decided to bork that system. The only lensflare stuff that remains is the stuff pertaining to the sun lensflare stuff. but they did something to disable it. Perhaps that's an easy EXE edit fix away though. but lensflares on vehicles? Not sure if there's enough of the system in place to handle that assuming it's ever re-enabled.

I would consider coming out of retirement for a few more updates to my mods if the lenslare system is ever revived. For example, I've been wanting to merge my bfheroes mod into bf1942 (and strip out most unused assets) and release as a standalone game. But really have no motivation to do so. Having the ability to use the lensflare system would motivate me to do it for sure. :P
ImageImageImage
I have cameras in your head!
Post Reply