Jump to content
Sign in to follow this  
eagledude4

missiong ] in remote execution

Recommended Posts

The error relating to the topic title has been resolved, but I have a few other questions regarding RE parameters

Code #1:

[nil, nil, "loc", execVM "Scripts\Dispatch.sqf", "Pub"] call RE;

Code #2:

[nil, nil, "loc", [Test] execVM "Scripts\Dispatch.sqf", "Pub"] call RE;

In code #1, _this returns "<null>" and in code #2, _this returns "[any]" so how do I use the parameters in the RE array? I would like to define _Type in my dispatch script as the "Pub" parameter

_Array = _this select 0;
_Type = _Array select 4;

Edited by eagledude4

Share this post


Link to post
Share on other sites

code#1 _this returns <null> because there is nothing to return.

code#2 _this returns [any] because Test isn't defined or isn't a recognised data format - it needs to be "Test" or Test=3; [Test] execVM "Scripts\Dispatch.sqf"; or ["Test"]

edit - NVM

Edited by Mattar_Tharkari

Share this post


Link to post
Share on other sites

why would it be select 5 instead of 4? I tried using "Test", but I got an error about it being a string and not something else.

Edited by eagledude4

Share this post


Link to post
Share on other sites

I don't know anything about RE at all (seriously, what is that?), but from what I can gather is that [Test] counts as select 4 as it is an additional value within the array, so Pub would be _this select 5.

Share this post


Link to post
Share on other sites

I don't think I can use the RE parameters for the Dispatch script, so I'll just use the execVM parameters instead.

[nil, nil, "loc", ["Pub"] execVM "Scripts\Dispatch.sqf"] call RE;

The script is only being ran locally (which I suspect is because of the loc parameter, but I get errors without it, even though it's supposed to be arbitrary?

I tried using nil as the third parameter but it gives me the same error that I get when not using the loc parameter at all:

'..._local exec=False
error generic error in expression
if ((_Targetscript |#|==''loc)
||
(_Targetscript =="locper)

Edited by eagledude4

Share this post


Link to post
Share on other sites

Can't find a suitable example in the wiki for that, where did you get the idea from originally? - _this select n - only works for the execVM params as you say.

RE - remote execute is part of the original BIS multiplayer scripting framework - general opinion is it's a bit rough and you should use CBA now:

http://community.bistudio.com/wiki/Multiplayer_framework

CBA

https://dev-heaven.net/docs/cba/files/overview-txt.html

https://dev-heaven.net/projects/cca/wiki/CBA

Edited by Mattar_Tharkari

Share this post


Link to post
Share on other sites

Thanks, I found some functions that work :)

Edited by eagledude4

Share this post


Link to post
Share on other sites

The issue with your RE is that your invoking the "loc" or local peramiter but then your giving it a nil object to check locally for. Also you must send the command you wish to use and then define the prams for said command.

Your old code: (This is Wrong)

// The third peram ("loc") if you use this then you must define what object to check for in the second peram.
[nil, nil, "loc", ["Pub"] execVM "Scripts\Dispatch.sqf"] call RE;[color=#333333]
[/color]

http://community.bistudio.com/wiki/Multiplayer_framework

Multiple parameters

[objNull, BIS_Rodriguez , "per", rKBADDTOPIC, "armstrongs_speech", "kb\armstrongs_speech.bikb", ""] call RE;- "kb\armstrongs_speech.bikb" becomes (_this select 1) in kbAddTopic.sqf library script

anyways , RE is horrible for this kind of stuff and you should be using CBA events.

-------------------------------------------------------------------------------------------------------

Now for your CBA event code that you posted. is that functions.sqf being run on all clients before you raise the global event?

---------- Post added at 10:55 AM ---------- Previous post was at 10:50 AM ----------

Also you should have a _scripthandle on your execVM

["DispatchPub", { _scripthandle = ["Pub"] execVM "Scripts\Dispatch" }] call CBA_fnc_addEventHandler;

The only place you can not use a script handle is in a config or in the init.sqf. But you really should use one all the time for consistency. Even _nul will work if you don't need to use it.

Share this post


Link to post
Share on other sites

Works without a scripthandle. In what circumstance would I need to call the script handle?

Share this post


Link to post
Share on other sites

Whenever a script is ran in the scheduled environment, the game will return a script handle. You don't always need this return. But the game tries to assign that return to something. hence the _scripthandle syntax seen here:

http://community.bistudio.com/wiki/execVM

Most of the time your scipts will work just fine since your not using the _handle. But the game still tries to write that and will log an error in your .rpt. That's just poor coding. Your writing an error for no reason. That's why you follow the syntax.

Back on topic.

Did you see my question about your CBA events above?

Share this post


Link to post
Share on other sites
Whenever a script is ran in the scheduled environment, the game will return a script handle. You don't always need this return. But the game tries to assign that return to something. hence the _scripthandle syntax seen here:

http://community.bistudio.com/wiki/execVM

Most of the time your scipts will work just fine since your not using the _handle. But the game still tries to write that and will log an error in your .rpt. That's just poor coding. Your writing an error for no reason. That's why you follow the syntax.

Back on topic.

Did you see my question about your CBA events above?

Does waitUntil {scriptDone _Handle}; actually waitUntil the script exits?

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  

×