Sign in to follow this  
Followers 0
s3v3red

Passing an array

9 posts in this topic

Is it possible to pass an array from the exile_client folder/pbo to the exile.altis folder/pbo?

 

Specifically, I need a script contained with the client pbo to pass an array to a script within the mission folder. Can you use 'call'? how do you specify the path if you can?

Share this post


Link to post
Share on other sites

Might try adding it to exile_server\code\fn_preInit and to CfgRemoteExec.hpp in map pbo or

CfgExileCustomCode in config.cpp

Share this post


Link to post
Share on other sites
Advertisement

if you can explain a bit more what you are trying to achieve ill tell you. What client function are you wanting to use? 

Share this post


Link to post
Share on other sites

anything client side code can be called. let's say you have your array

_array=["sucka",_namePlayer,_distance];

you can send that array to the function to be processed

[_array] call ExileClient_util_example_function;

that would send the array to be processed by the function and if the function should return infomation, you will receive that back from the function for your script that sent the array.

so let's say it processes the array and sends back _msg

your script receives _msg after the above call processes, your next lines in your script will be able to process this returned _msg however you like.

 

Share this post


Link to post
Share on other sites
5 hours ago, DirtySanchez said:

anything client side code can be called. let's say you have your array

_array=["sucka",_namePlayer,_distance];

you can send that array to the function to be processed

[_array] call ExileClient_util_example_function;

that would send the array to be processed by the function and if the function should return infomation, you will receive that back from the function for your script that sent the array.

so let's say it processes the array and sends back _msg

your script receives _msg after the above call processes, your next lines in your script will be able to process this returned _msg however you like.

 

I understand how to use call for scripts located in the client folder. What I need to do is pass an array to the exile.altis folder.  As in [_array] call Exile.Altis_somefolder_myscript.sqf;

 

But something tells me that won't work.

Share this post


Link to post
Share on other sites

Posted (edited)

not to be a dick but I answered your question bud, no matter how you look at it something will have to initiate sending that array to the client. just create your sqf put it in your mission file and initiate whatever the hell you are trying to do.

The only thing that I left out of the original reply is that a function as in your new .sqf will have to be compileFinal during load so it knows its a function

Good Luck

Edited by DirtySanchez

Share this post


Link to post
Share on other sites

its this ----   pass an array from the exile_client folder/pbo

that is the confusing part. that really determines the answer you need. I need to know what you want from there? 

Share this post


Link to post
Share on other sites
11 hours ago, happydayz said:

its this ----   pass an array from the exile_client folder/pbo

that is the confusing part. that really determines the answer you need. I need to know what you want from there? 

What I have done is request information from the database.

It is then sent client side using ExileServer_system_network_send_broadcast.

From there it goes to ExileClient_system_network_dispatchIncomingMessage.

That then relays the array to a custom script located in the client folder (so I dont have to edit ExileClient_system_network_dispatchIncomingMessage).

I need the array to be sent from there to a script in the exile.altis folder. At this point I'm considering converting the array into a string using splitstring and joinstring and trying to send it using a namespace, but if I can avoid that I would like to.

 

Im afraid I dont see where the confusion lies, I simply need to send an array from the client folder to the mission folder.

Share this post


Link to post
Share on other sites

@s3v3red

If I understand you correctly you want  ExileClient_system_network_dispatchIncomingMessage to call your function and send the array as an parameter?

Poor solutions

Todo this you need to add a class for you function within CfgNetworkMessages which withholds the information of which function that should be executed. The issue with this is that the only way for you use this option is to create a mod that all clients need to download and use, within that mod's configfile you can add classes to the CfgNetworkMessages.
This is a very bad solution, easier is if you just edit the ExileClient_system_network_dispatchIncomingMessage to find the classes within the missionconfigfile instead if its not found in the configfile. 

-- Best and easiest solution

I would recommend you to avoid all those headaches and just call the function from the server instead by using remoteExec and pass your array as a parameter 

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.