Jump to content
A.Cyprus

Removing damage via setParticleFire

Recommended Posts

Gentlemen

Having fruitlessly searched the forums and feedback tracker for clues already, I now turn to you for help in understanding where I am going wrong, or perhaps some advice on where I can go next.

Without going into great detail, I am scripting some fire particle effects for a MP mission. I do not want these fires to damage the players (or agents). This is because I would rather handle the burn effects and damage upon them in my own specific ways. However, this is not working in a dedicated server environment.

Expand the spoiler to see the details, or skip the the question below it.

A very simple example of creating a fire is below. I executed this in the debug console of an Editor mission to test the particle effects. uk1 is the object name of my player unit:

[color="#FF8040"][color="#1874CD"]_fire[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#7A7A7A"]"#particlesource"[/color] [color="#191970"][b]createVehicle[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]getPosATL[/b][/color] uk1 [color="#191970"][b]vectorAdd[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#FF0000"]10[/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]0[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#1874CD"]_fire[/color] [color="#191970"][b]setParticleClass[/b][/color] [color="#7A7A7A"]"MediumDestructionFire"[/color][color="#8B3E2F"][b];[/b][/color][/color]

Made with KK's SQF to BBCode Converter

The fire above invokes damage on my player when I enter it, I assume the magnitude and rate being defined in the particle config.

To remove the damage, I added a third line thus:

[color="#FF8040"][color="#1874CD"]_fire[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#7A7A7A"]"#particlesource"[/color] [color="#191970"][b]createVehicle[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]getPosATL[/b][/color] uk1 [color="#191970"][b]vectorAdd[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#FF0000"]10[/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]0[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#1874CD"]_fire[/color] [color="#191970"][b]setParticleClass[/b][/color] [color="#7A7A7A"]"MediumDestructionFire"[/color][color="#8B3E2F"][b];[/b][/color]
[color="#1874CD"]_fire[/color] [color="#191970"][b]setParticleFire[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color][/color]

Made with KK's SQF to BBCode Converter

This works fine when previewing in the Editor. However...

Here's the part that's challenging me. I would like to remove damage in a MP dedicated server environment. Executing the above script in different conditions are shown below:

[table="width: 500" class: grid]

[tr]

[td]Server[/td]

[td]Scope[/td]

[td]Result[/td]

[/tr]

[tr]

[td]1. Editor Preview[/td]

[td]Local Exec[/td]

[td]No Damage[/td]

[/tr]

[tr]

[td]2. Dedicated[/td]

[td]Local Exec[/td]

[td]No Damage[/td]

[/tr]

[tr]

[td]3. Dedicated[/td]

[td]Server Exec[/td]

[td]Damage[/td]

[/tr]

[/table]

My mission is currently executing in scope #3.

My question is how I can I achieve this and still avoid the damage being applied?

Is setParticleFire functioning properly in this situation? I would have assumed any objects I 'createVehicle' on the server retain their properties when synched to the clients (although I have had trouble with lightpoints).

Should I be using createVehicle at all in this case? I note the example on the setParticleFire wiki page uses createVehicleLocal. If I do this, I assume I would have to BIS_fnc_MP the script on every client, something I would like to avoid to save on performance. I am already having to do so for lightpoints.

Many thanks.

Share this post


Link to post
Share on other sites

Anybody have any ideas?

A quick followup with observations from me.

(code in the spoiler)

[color="#FF8040"]createFire [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b]{[/b][/color]
   [color="#1874CD"]_fire[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#7A7A7A"]"#particlesource"[/color] [color="#191970"][b]createVehicle[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]getPosATL[/b][/color] uk1 [color="#191970"][b]vectorAdd[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#FF0000"]10[/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]0[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b];[/b][/color]
   [color="#1874CD"]_fire[/color] [color="#191970"][b]setParticleClass[/b][/color] [color="#7A7A7A"]"MediumDestructionFire"[/color][color="#8B3E2F"][b];[/b][/color]
   [color="#1874CD"]_fire[/color] [color="#191970"][b]setParticleFire[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]

createFireLocal [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b]{[/b][/color]
   [color="#1874CD"]_fire[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#7A7A7A"]"#particlesource"[/color] [color="#191970"][b]createVehicleLocal[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]getPosATL[/b][/color] uk1 [color="#191970"][b]vectorAdd[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#FF0000"]10[/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]0[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b];[/b][/color]
   [color="#1874CD"]_fire[/color] [color="#191970"][b]setParticleClass[/b][/color] [color="#7A7A7A"]"MediumDestructionFire"[/color][color="#8B3E2F"][b];[/b][/color]
   [color="#1874CD"]_fire[/color] [color="#191970"][b]setParticleFire[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]

mpExecFire [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b]{[/b][/color]
   [color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color] [color="#7A7A7A"]"createFire"[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_MP[color="#8B3E2F"][b];[/b][/color]
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]

mpExecFireLocal [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b]{[/b][/color]
   [color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color] [color="#7A7A7A"]"createFireLocal"[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_MP[color="#8B3E2F"][b];[/b][/color]
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
[/color]

Made with KK's SQF to BBCode Converter

On a dedicated server, running:

call mpExecFire yields damage.

calll mpExecFireLocal does not.

I'd still rather avoid BIS_fnc_MP calls. Anybody have any advice, please?

Share this post


Link to post
Share on other sites

Coming back to this one after some vacation time. Haven't been able to reach a working multiplayer solution without running local on each client. Is anybody able to help, please?

Share this post


Link to post
Share on other sites

I have no experience on particles whatsoever, but it seems you might have hit an engine bug (or feature?) here. Modifying the fire properties seems not to be broadcasted once the object has been created?

But do you really need to use "MediumDestructionFire"? Maybe you can define your own particle effect that has the same visuals, but not the damage effect.

It may look different, but not too complicated: https://community.bistudio.com/wiki/ParticleTemplates

Share this post


Link to post
Share on other sites

Thanks for the reply.

I have no experience on particles whatsoever, but it seems you might have hit an engine bug (or feature?) here. Modifying the fire properties seems not to be broadcasted once the object has been created?

I had similar thoughts and was hoping to get some dev attention, I guess I'd need to post on the feedback tracker for that.

But do you really need to use "MediumDestructionFire"? Maybe you can define your own particle effect that has the same visuals, but not the damage effect.

I used that class for demonstration in this post. I'm actually using a number of different particle classes in the mission, all behave as above. It's a good suggestion, and I could look at recreating them but it would be a lot of work for me given how many I'm using for the effects I need, and probably wouldn't look as great. I'm not too familiar with that area of scripting either. :(

Share this post


Link to post
Share on other sites
[color="#FF8040"][color="#006400"][i]//---setting up[/i][/color]

[color="#191970"][b]if[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]isServer[/b][/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]then[/b][/color] [color="#8B3E2F"][b]{[/b][/color]
myFire [color="#8B3E2F"][b]=[/b][/color] [color="#7A7A7A"]"#particlesource"[/color] [color="#191970"][b]createVehicle[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]getPosATL[/b][/color] playerserver [color="#191970"][b]vectorAdd[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#FF0000"]10[/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]0[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b];[/b][/color]
myFire [color="#191970"][b]setParticleClass[/b][/color] [color="#7A7A7A"]"MediumDestructionFire"[/color][color="#8B3E2F"][b];[/b][/color]
[color="#006400"][i]//set persistent call to remove fire damage[/i][/color]
[color="#8B3E2F"][b][[/b][/color]myFire[color="#8B3E2F"][b],[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]0[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]remoteExecCall[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"setParticleFire"[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color] [color="#191970"][b]netId[/b][/color] myFire[color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]

[color="#006400"][i]//---removal[/i][/color]

[color="#006400"][i]//remove persistent call[/i][/color]
[color="#191970"][b]remoteExecCall[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]""[/color][color="#8B3E2F"][b],[/b][/color] [color="#191970"][b]netId[/b][/color] myFire[color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#006400"][i]//remove fire[/i][/color]
[color="#191970"][b]deleteVehicle[/b][/color] myFire[color="#8B3E2F"][b];[/b][/color][/color]

Made with KK's SQF to BBCode Converter

Share this post


Link to post
Share on other sites

Hey KK, thanks for helping. Apologies for only responding now - I've been away.

 

I just tried this on a dedicated server running vanilla, and the fire kills my character when I walk through it. :(

 

 

 

 

Edit:

 

To investigate, I moved the setParticleFire command into a new clientside function, with a hint at the start. Using remoteExecCall did not show the hint, which explains why the fire is still giving damage. Using BIS_fnc_MP instead of remoteExecCall, did show the hint and removed the damage too.

 

So the concept is sound but remoteExecCall itself isn't working. I'm not sure why, unless CfgRemoteExec is not applicable to the production branch yet.

 

 

 

I guess the conclusion to my original quesion is to use remote calls after all, which I had hoped to avoid.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×