Jump to content
Sign in to follow this  
Fuzzy Bandit

Using BIS_fnc_MP with addAction

Recommended Posts

Here's a fun question for you all!

Using BIS_fnc_MP, I can run code on all client machines including all future JIPP (Join-In-Progress Players). Fantastic!

So, what I want is to, at any point in the game, create an object (let's say a table) and add an action to it for all current and JIP players. I can do that using the aforementioned technique by creating a small function that'll add an action to an object and slamming that, along with the relevant parameters, into a BIS_fnc_MP call with the isPersistant bool set to TRUE.

Now that's all well and good, but I then want to remove my table and the action along with it. That bit's easy - I just use deleteVehicle - but what I want to know is what happens to the code I sent off to run on every JIPP?

Does it hang around? If I create and delete three objects as above, will there now be three useless calls to a function being run every time the client joins?

Share this post


Link to post
Share on other sites

yes, and it is now documented in the wiki.

I'm working on an vehicle.sqf that will not use the bis fnc mp anymore but setVariable with a sync to true. this one sends only the last value, not the chain.

it is good to know, I was wondering why my load time was so long with a jip on a persistant mission that ran for a few hours.

regards,

holo

Share this post


Link to post
Share on other sites

if you only have 3 objects like that, just manage the "if the object is not destroyed" at the beginning of your function. and I don't think you should care.

otherwise, if it may be called an undefined number of time, like the vehicle respawn function, it's a case by case solution.

I'm not the best scripter, but if you had a gamelogic by "table" object and named the table object table1, table2 ... in the gamelogic1 init you put the addaction on the table1. in the gamelogic2 you put the addaction on table2. and when you want to delete table2 let say, you also delete gamelogic2.

that is the most straightforward way I may think of that would be jip compatible. also, in the init code of your gamelogic, you must put a waituntil the object exist before doing the addaction. because the gamelogic may be executed before the object is created at the start of the game ( jip would not have this prob)

I have not tried it, but I made similar things and it worked.

hope this help

Share this post


Link to post
Share on other sites

why dont you just put a little

if (!alive table) exitwith {};


in there? That is in the function used with bis_fnc_MP.

Anyway, i'm using bis_fnc_MP for addActions in my IED script aswell and so far did not see any performance issues whatsoever for JIP's.

Share this post


Link to post
Share on other sites
Anyway, i'm using bis_fnc_MP for addActions in my IED script aswell and so far did not see any performance issues whatsoever for JIP's.

Mm. I'm aware that it won't 'cause too much damage on its own, but its the cumulative effect that worries me; if I have a mission that's running for days on end, having 30 or 40 pointless function calls (even if they immediately exit) is still an annoyance.

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
Sign in to follow this  

×