Jump to content
Nirrti

Having a bit of an issue with particles not showing up to all players.

Recommended Posts

So I have no idea if this is the right place to post this, but I figured I'd find someone smarter than myself to help me with this.

 

So I'm trying to script a jetpack, and I've got it working like I want apart from the fact that the particles, as they are with Arma 3 engine, are clientside only, and I kind of need them to be visible to other clients as well so that the player using it is a bit easier to spot.

 

 

This is my current script for making the particlearray,  but it isn't visible to other players, and I'm using line command "nul = [player] call jetpacksmoke;" to fire the particle script, in the jetpack script. I've got "jetpacksmoke = compile preprocessFileLineNumbers "scripts\jetpacksmoke.sqf";" in the init.sqf as well.

private ["_obj"];

_obj = _this select 0;    //object

publicVariable "jetpacksmoke";
if (not isDedicated) then {

_smoke = "#particlesource" createVehicle getPosATL _obj;
_smoke setParticleRandom [0, [0.25, 0.25, 0], [0.2, 0.2, 0], 0, 0.25, [0, 0, 0, 0.1], 0, 0];
_smoke setParticleParams [["\Ca\Data\ParticleEffects\FireAndSmokeAnim\SmokeAnim.p3d", 8, 3, 1], "", "Billboard", 1, 6, [0, 0, 0], [0, 0, 1.5], 0, 10, 7.9, 0.066, [0.25, 5], [[0.33, 0.33, 0.33, 0.8], [0.66, 0.66, 0.66, 0.4], [1, 1, 1, 0]], [0.125], 1, 0, "", "", _obj];
_smoke setDropInterval 0.05;

sleep 0.5;

deletevehicle _smoke;
};

true

It shows up for the user using the jetpack, but it, as explained, doesn't show it to other players, anyone familiar with the MP compatible particle stuff able to help?

Share this post


Link to post
Share on other sites

It's probably a video settings issue. The lower the particles setting they have, the fewer particles will be displayed.

The players who can't see them probably have a lower particles quality setting than you.

Share this post


Link to post
Share on other sites
4 minutes ago, Tankbuster said:

It's probably a video settings issue. The lower the particles setting they have, the fewer particles will be displayed.

The players who can't see them probably have a lower particles quality setting than you.

Nah, that isn't the case, because they can't see the particles even there's nothing else going on, and everyone is running the game at fairly high settings. I'm fairly certain this has nothing to do with that and more to do with the issue that I can't get the particles to be generated on each client, just the one firing the jetpack.

Share this post


Link to post
Share on other sites

In that case, it is a locality problem like you suspected. Particles are not globally created, you have to manually make them on all your clients

Share this post


Link to post
Share on other sites
1 minute ago, Tankbuster said:

In that case, it is a locality problem like you suspected. Particles are not globally created, you have to manually make them on all your clients

Yes, I am well aware, and no offense, but why did you even post in the first place if you're not familiar with the stuff 😛

Share this post


Link to post
Share on other sites

I have made particles work in MP. You haven't.

Share this post


Link to post
Share on other sites
Just now, Tankbuster said:

I have made particles work in MP. You haven't.

Well okay then? Would you be able to help instead of insinuating things that are seemingly irrelevant?

Share this post


Link to post
Share on other sites

I have you the 2 basics for particle creation in MP. That's not irrelevant.

I'll be able to look over how I did it later today when I can get Mrs Tank off the PC - she works from home. It was some time ago, but I seem to remember I created a function to make the particles on all the clients and called that from the the server.

Share this post


Link to post
Share on other sites
1 minute ago, Tankbuster said:

I have you the 2 basics for particle creation in MP. That's not irrelevant.

I'll be able to look over how I did it later today when I can get Mrs Tank off the PC - she works from home. It was some time ago, but I seem to remember I created a function to make the particles on all the clients and called that from the the server.

I more meant the video settings issue, although I do understand where it's coming from, but it should still be able to draw some of the particles even with lower settings. But thanks a lot if you are able to help, I've been racking my brain with this for a few days and I just can't get the damn thing to work and it's getting on my nerves.

Share this post


Link to post
Share on other sites

I can't know what you do and don't know apart from looking at your script on the phone screen I'm currently using. Yes, even with particles set to low, players should see at least some particles. As you might already know (this is as much for other readers as you), the particle settings in options>video don't actually control the quality or resolution of the particles, but the number that client can display.

So that leads us to think that, as you said up top, there's a problem with your script. Have you debugged it to the extent that you know for sure it is running on the clients? Put in a diag_log in it and see if that shows up in their RPTs?

Share this post


Link to post
Share on other sites

OK, here is what I did. Particles isn't really my thing, but I'd like to think I know my way fairly competently around the MP side of scripting. This function is compiled in description.ext

Spoiler
 
 
 
 
Spoiler
 
Spoiler

//fn_spawnsmoke by brains200 and tankbuster


_aslLoc = _this select 0;


0 = _aslLoc spawn {
	_aslLoc = _this;

	_smoke1 = "#particlesource" createVehicleLocal getpos _aslLoc;
	_smoke1 setpos getpos _aslLoc;
	_smoke1 setParticleCircle [0, [0, 0, 0]];
	_smoke1 setParticleRandom [0, [24,0,0], [4,0, 0], 0, 0.25, [0.05, 0.05, 0.05, 0.1], 0, 0];
	_smoke1 setParticleParams [["\A3\data_f\cl_fireD", 1, 0, 1], "", "Billboard", 1, 12, [0, 0, 0], [0, 0, 0], 0, 10, 7.85, .375, [6 + random 4, 10 + random 4, 14 + random 4], [[0, 0, 0, 1], [0.35, 0.35, 0.35, 0.35], [0.35, 0.35, 0.35, 0]], [0.08], 1, 0, "", "", _aslLoc];
	_smoke1 setDropInterval .005;

	_smoke2 = "#particlesource" createVehicleLocal getpos _aslLoc;
	_smoke2 setpos getpos _aslLoc;
	_smoke2 setParticleCircle [0, [0, 0, 0]];
	_smoke2 setParticleRandom [0, [0,24,0], [0,4, 0], 0, 0.25, [0.05, 0.05, 0.05, 0.1], 0, 0];
	_smoke2 setParticleParams [["\A3\data_f\cl_fireD", 1, 0, 1], "", "Billboard", 1, 12, [0, 0, 0], [0, 0, 0], 0, 10, 7.85, .375, [6 + random 4, 10 + random 4, 14 + random 4], [[.78, .76, .71, 1], [.35, .35, .35, 0.35], [0.35, 0.35, 0.35, 0]], [0.08], 1, 0, "", "", _aslLoc];
	_smoke2 setDropInterval .005;

	_smoke3 = "#particlesource" createVehicleLocal getpos _aslLoc;
	_smoke3 setpos getpos _aslLoc;
	_smoke3 setParticleCircle [0, [0, 0, 0]];
	_smoke3 setParticleRandom [0, [-24,0,0], [-4,0, 0], 0, 0.25, [0.05, 0.05, 0.05, 0.1], 0, 0];
	_smoke3 setParticleParams [["\A3\data_f\cl_fireD", 1, 0, 1], "", "Billboard", 1, 12, [0, 0, 0], [0, 0, 0], 0, 10, 7.85, .375, [6 + random 4, 10 + random 4, 14 + random 4], [[.55, .47, .37, 1], [.35, .35, .35, 0.35], [0.35, 0.35, 0.35, 0]], [0.08], 1, 0, "", "", _aslLoc];
	_smoke3 setDropInterval .005;

	_smoke4 = "#particlesource" createVehicleLocal getpos _aslLoc;
	_smoke4 setpos getpos _aslLoc;
	_smoke4 setParticleCircle [0, [0, 0, 0]];
	_smoke4 setParticleRandom [0, [0,-24,0], [0,-4,0], 0, 0.25, [0.05, 0.05, 0.05, 0.1], 0, 0];
	_smoke4 setParticleParams [["\A3\data_f\cl_fireD", 1, 0, 1], "", "Billboard", 1, 12, [0, 0, 0], [0, 0, 0], 0, 10, 7.85, .375, [6 + random 4, 10 + random 4, 14 + random 4], [[.1, .1, .1, 1], [.2, .2, .2, 0.35], [0.35, 0.35, 0.35, 0]], [0.08], 1, 0, "", "", _aslLoc];
	_smoke4 setDropInterval .005;

	_smokes = [_smoke1,_smoke2, _smoke3,_smoke4];

	sleep .5;


	_smoke1 setParticleRandom [0, [3 + random 4, 3 + random 4, 5], [4+random 5, 4+random 5, 0], 0, 0.25, [0.05, 0.05, 0.05, 0.1], 0, 0];
	_smoke1 setParticleParams [["\A3\data_f\cl_fireD", 1, 0, 1], "", "Billboard", 1, 9, [0, 0, 0], [0, 0, 0], 0, 10, 7.85, .375, [6 + random 4, 10 + random 4, 14 + random 4], [[.35, .35, .35, 1], [.2, .2, .2, 0.9], [0.35, 0.35, 0.35, 0]], [0.08], 1, 0, "", "", _aslLoc];
	_smoke1 setDropInterval .03;

	_smoke2 setParticleRandom [0, [3 + random 4, 3 + random 4, 5], [4+random 5, 4+random 5, 0], 0, 0.25, [0.05, 0.05, 0.05, 0.1], 0, 0];
	_smoke2 setParticleParams [["\A3\data_f\cl_fireD", 1, 0, 1], "", "Billboard", 1, 12, [0, 0, 0], [0, 0, 0], 0, 10, 7.85, .375, [6 + random 4, 10 + random 4, 14 + random 4], [[.35, .35, .35, 1], [.2, .2, .2, 0.9], [0.35, 0.35, 0.35, 0]], [0.08], 1, 0, "", "", _aslLoc];
	_smoke2 setDropInterval .03;

	_smoke3 setParticleRandom [0, [3 + random 4, 3 + random 4, 5], [4+random 5, 4+random 5, 0], 0, 0.25, [0.05, 0.05, 0.05, 0.1], 0, 0];
	_smoke3 setParticleParams [["\A3\data_f\cl_fireD", 1, 0, 1], "", "Billboard", 1, 12, [0, 0, 0], [0, 0, 0], 0, 10, 7.85, .375, [6 + random 4, 10 + random 4, 14 + random 4], [[.35, .35, .35, 1], [.2, .2, .2, 0.9], [0.35, 0.35, 0.35, 0]], [0.08], 1, 0, "", "", _aslLoc];
	_smoke3 setDropInterval .03;

	_smoke4 setParticleRandom [0, [3 + random 4, 3 + random 4, 5], [4+random 5, 4+random 5, 0], 0, 0.25, [0.05, 0.05, 0.05, 0.1], 0, 0];
	_smoke4 setParticleParams [["\A3\data_f\cl_fireD", 1, 0, 1], "", "Billboard", 1, 12, [0, 0, 0], [0, 0, 0], 0, 10, 7.85, .375, [6 + random 4, 10 + random 4, 14 + random 4], [[.35, .35, .35, 1], [.2, .2, .2, 0.9], [0.35, 0.35, 0.35, 0]], [0.08], 1, 0, "", "", _aslLoc];
	_smoke4 setDropInterval .03;

	sleep 1;
	{
		deletevehicle _x;
	} foreach _smokes;
};

 

 

And here's the result, note this was recorded on a client playing on a dedicated server.

 

 

 

So there's some serverside trickery going on to sense shen the Titan round hits the bridge, but you're not interested in that. Suffice to say, the sensing is done on the server and it calls the above code on all clients.

Share this post


Link to post
Share on other sites
6 minutes ago, Tankbuster said:

I can't know what you do and don't know apart from looking at your script on the phone screen I'm currently using. Yes, even with particles set to low, players should see at least some particles. As you might already know (this is as much for other readers as you), the particle settings in options>video don't actually control the quality or resolution of the particles, but the number that client can display.

So that leads us to think that, as you said up top, there's a problem with your script. Have you debugged it to the extent that you know for sure it is running on the clients? Put in a diag_log in it and see if that shows up in their RPTs?

Yeah, it is running, at least the rest of the script relating to the jetpack (sound is played (I omitted this piece from the script in the OP as it is working as it should), and the origin for the sound is the particle vehicle (_smoke) created by the script. I've not tried diag_log yet, although I suppose that needs to be the next step, unless my script in itself is just not creating the particle properly.

Share this post


Link to post
Share on other sites

You appear to be going at the problem in the right way, so I do think you'll get it eventually. We crossposted, so there's a post above from me you've yet to read. May or may not help 🙂

 

It's possible your script has an error in it. The game engine is sometimes qutie poor at reporting these in compiled functions.

Share this post


Link to post
Share on other sites
2 minutes ago, Tankbuster said:

You appear to be going at the problem in the right way, so I do think you'll get it eventually. We crossposted, so there's a post above from me you've yet to read. May or may not help 🙂

Yeah, just did 😛 Compiled in the description.ext though? Am I going the wrong way compiling it in the init, could that be the cause? I'm really not that experienced with arma 3 scripting so I'm going about the way I've learned just by hours and hours of wiki surfing.

 

Share this post


Link to post
Share on other sites
1 minute ago, Nirrti said:

Yeah, just did 😛 Compiled in the description.ext though? Am I going the wrong way compiling it in the init, could that be the cause? I'm really not that experienced with arma 3 scripting so I'm going about the way I've learned just by hours and hours of wiki surfing.

 

Not sure. Try compiling it in CfgFunctions in description.ext. I know that worked for me.

Share this post


Link to post
Share on other sites
3 minutes ago, Tankbuster said:

Not sure. Try compiling it in CfgFunctions in description.ext. I know that worked for me.

So something like this?

 

class CfgFunctions
{
	class jetpacksmoke
	{
		class jetpacksmoke
		{
			class jetpacksmoke {file = "scripts\jetpacksmoke.sqf";};
		};
	};
};

how would I go about calling the function, same bit as currently (that is "nul = [player] call jetpacksmoke")?

Share this post


Link to post
Share on other sites

Yes, pretty much. If you get file not found errors, you know youre CfgFunctions hierarchy doesn't match your file layout.

As it turns out, I don't call it as a function, I remotexec it. Apologies, I've only just arrived at my PC and got to check actual working code.

[tob] remoteExec ["tky_fnc_spawnsmoke",  [0, -2] select isDedicated, false];

It's a bit illogical.. I compile it, then execute it. And there's me saying I knew MP scripting, lol.

Share this post


Link to post
Share on other sites
5 minutes ago, Tankbuster said:

Yes, pretty much. If you get file not found errors, you know youre CfgFunctions hierarchy doesn't match your file layout.

As it turns out, I don't call it as a function, I remotexec it. Apologies, I've only just arrived at my PC and got to check actual working code.


[tob] remoteExec ["tky_fnc_spawnsmoke",  [0, -2] select isDedicated, false];

It's a bit illogical.. I compile it, then execute it. And there's me saying I knew MP scripting, lol.

Hah, sounds about right for arma from what experience I have. So if I wanted a player to run it I'd do it something like this? I've never even seen remotexec before, as I've never even gone down the rabbit hole of compiling cfgfunctions in the description.

[player] remoteExec ["jetpacksmoke",  [0, 0] select isDedicated, false];

 

Share this post


Link to post
Share on other sites

No, in my snippet, tob is targetobject - where I want the smoke particles to appear. The object is public across the network so all clients know where it is. I'm passing it to the clients as a script parameter. The rest of the line says basically, if this is a dedicated server, execute it on all clients. If not, execute it here AND all clients. Your script wont work on a server because player doesn't exist there.

 

 

Share this post


Link to post
Share on other sites

It still needs to be compiled. In this syntax, remoteExec is calling the function by the way - I don't really remember quite why I did it this particular way.

 

Share this post


Link to post
Share on other sites
5 minutes ago, Tankbuster said:

No, in my snippet, tob is targetobject - where I want the smoke particles to appear. The object is public across the network so all clients know where it is. I'm passing it to the clients as a script parameter. The rest of the line says basically, if this is a dedicated server, execute it on all clients. If not, execute it here AND all clients. Your script wont work on a server because player doesn't exist there.

 

 

well now I'm just confused, I don't see tob defined anywhere in the script you posted earlier, unless the post is not showing the full script, I can only see the smoke particle part. Although if it is a public variable across the network, won't that cause issue if I want to have more than one player using the jetpack script at a time?

Share this post


Link to post
Share on other sites

tob is a public object - it is created and named by other scripts in the mission. It exists on every player machine so when I call the spawnsmoke function on players, it knows where to make the smoke.

Don't get too hung up on the public variable thing because it doesn't really apply to you. You are creating your particles at and on the player. I was creating them at an object some distance away.

Share this post


Link to post
Share on other sites
11 minutes ago, Tankbuster said:

tob is a public object - it is created and named by other scripts in the mission. It exists on every player machine so when I call the spawnsmoke function on players, it knows where to make the smoke.

Don't get too hung up on the public variable thing because it doesn't really apply to you. You are creating your particles at and on the player. I was creating them at an object some distance away.

Oooh, so it would just be

[tob] remoteExec ["jetpacksmoke",  [0, 0] select isDedicated, false];

or something? I'll give that a try and see how it goes.

Share this post


Link to post
Share on other sites

You aren't using a target object, you want to run it on a player. Try

[] remotexec ["jetpacksmoke", [0,-2] select isdedicated, false]

 

Share this post


Link to post
Share on other sites
3 minutes ago, Tankbuster said:

You aren't using a target object, you want to run it on a player. Try


[] remotexec ["jetpacksmoke", [0,-2] select isdedicated, false]

 

Oh, right, I'm an idiot, I'll try that.

 

Edit

 

Well, it's not giving me any errors, but the smoke isn't showing up even in testing in editor.

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

×