Jump to content

Recommended Posts

Hi Hopefully someone can help having run all over the internet for a answer. I have created a mission and have issue on the end mission trigger calling a function from dedicated server or if I host it myself.

 

Its a basic trigger with condition for BLUFOR to be present and on activation run end1" call BIS_fnc_endMission;

 

This works fine on my PC where the mission was created but clients connected dont see it and from what I have read the function is called by the local client. and is not broadcasted to the others if condition is met.

 

 

I read that it should be a publicvariable or RemoteExecCall but unsure how to get this to work. should it be in the init or description files.

 

I used eden to create mission but uncertain where to put the commands. I also setup some triggers that call SQF files that spawn some enemy units, would this be the same same if on a dedicated server. We have played the mission a few times and have held back from making triggers fire but it seems to work from clients triggering it.

 

 

Hopefully someone can help me :-)

 

 

Cheers

 

 

Share this post


Link to post
Share on other sites

run server side

param call BIS_fnc_endMissionServer

            "Won" - show "MISSION COMPLETED" to everyone
            "Lost" - show "MISSION FAILED" to everyone
            "SideScore" - show "YOUR SIDE WON" to side with largest score
            "GroupScore" - show "YOUR GROUP WON" to group with largest score
            "PlayerScore" - show "YOUR WON" to player with largest score

 

 

or just

 ["end1","BIS_fnc_endMission",true,false,true] call BIS_fnc_MP;
  • Like 1

Share this post


Link to post
Share on other sites

Thanks for the reply davisoss, I will give it a try but looks like it had possible an issues in Eden that may be related..

 

 

FYI

 

https://forums.bistudio.com/topic/188583-answered-repair-scripts-doesnt-work-on-dedicated-server-local-works-fine/?hl=eden

 

 

https://forums.bistudio.com/topic/140837-development-branch-changelog/page-36#entry2982827

Share this post


Link to post
Share on other sites

Hi DavidOss, that worked a treat thank you so much, hope you don't mind me asking but I am using a Dynamic Spawn AI script for missions and works local as before but don't seem to work on dedicated using this command NUL = execVM "DynamicAISpawn.sqf";

 

I take it that is all that's required or would I need to use the same MP function call.

 

Much Appreciated.

Share this post


Link to post
Share on other sites

You are missing the point. Local definition depends from where the script is executed.

 

If you execute any code on your pc you are executed it locally. If you execute the code on server it will be executed locally too but for server machine.

If you execute any code on server globally using BIS_fnc_MP or remoteExec means it will be executed  locally for everyone.

 

Before you write any code you need to decide where and how the code will be executed.

If you want to use some script you need to knew where and how it should be executed.

Now you can ask the question please.

Share this post


Link to post
Share on other sites

I may be missing the point, I am very new to scripting concepts and am trying to learn as best I can. I maybe didnt explain clearly and will try and explain as best I can.

 

I have created a mission and have set triggers that are activated by BLUFOR being present and on activation should run the following NUL = execVM "DynamicAISpawn.sqf"; with a hint message

 

the script basically sets a zone to spawn in AI randomly. link provided http://www.armaholic.com/page.php?id=28107

 

 

This works fine in the editor and if I run mission on single player which makes sense. If I host a MP game only I can seem to activate the trigger and see the hint. No other players see a hint and script does not work.

 

 

I tried this on a dedicated server and I cannot activate the trigger or see a hint like other joined players.

 

I want to be able to have any players in a MP game to be able to activate the trigger and call the script.

 

so what you suggested is similar to what I am trying to achieve but maybe going about it the wrong way ( BIS_fnc_MP or remoteExec means it will be executed  locally for everyone) but am unsure of how the command should be set on the trigger in the editor.

 

hopefully I have made some of this a bit more clear.

Share this post


Link to post
Share on other sites

This script can work only when executed on client side and only on one PC.

That defined it as SP script. If you want use it in MP you need to execute it in that way or edit the script and run it on server then.

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  

×