• 0
Erzengel

execute script global

Question

As usual when i post here iam stuck again and i hope this time soneone will find a solution

iam building a static mission with the goal to cool down a nuklear reaktor and if players fail, its gonna explode and have fallout and everything. everything works fine so far, but the nuke.sqf is executed local as is use execVM "nuke\nuke.sqf"; - also tried the isServer thing aaand one more i accutally forgot about. my question is:

how to execute a script global so every player get the visual effect and the damage on buildings is done on the server and not on the client, if possible.

pls tell me your ideas even if you think it just MIGHT work.

 

Thanks allready now :-)

 

edit: i remember the last tested thing ^^

["nuke\nuke.sqf","BIS_fnc_execVM",true,true ] call BIS_fnc_MP;

Edited by Erzengel

Share this post


Link to post
Share on other sites

6 answers to this question

  • 0

so i managed to get the script executed on the server now with adding an file in between which i called "tonuke" which includes this

nuke = [player, _this select 3 select 0];
publicVariableServer "nuke";

and

"nuke" addPublicVariableEventHandler {
    [_this select 1 select 0, _this select 1 select 1] execVM "nuke\tonuke.sqf";
};

in the initServer.sqf

 

now it is run on the server, but there are no particle or coloreffects anymore. not even for the player that started the script.

 

meanwhile i felll as if i tried every possible method to start a script in arma 2 & 3 and nothing seems to work...

Share this post


Link to post
Share on other sites
  • 0

While I do have some 'expertise' in scripting, this is like the weather.  If I have a cloud on the left, you will have it on the right.

What you need to do is have the clients run the nuke script.

ONE way is to set a variable when 'activated' - blownuke="no"

On the client side, you could have a looping script like:

:Wait

If blownuke="no" then goto Wait else exec blownuke.sqm

 

Yes, the coding above is NOT correct for ARMA, however, it gives you an idea on how you could do it.

Best thing is to use a network message to notify the clients.  My 'expertise' is in SP scripting, so I am not much help on the MP messaging side.

This way, when the bomb 'goes off', this msg is sent to clients and then the client 'blows the bomb'.

 

The only issue will be that I question if everybody's screen will see the EXACT thing.  As an example, you see a house that is 75% damaged, while I see the same house at 50% damage.  I fear that this will be the end result.  And yes, you CAN 'fix that' by getting a list of all objects, then from that list, obtain the damage levels, then pass this off to all clients.  The server would run the 'blownuke' script and gather this info.  Then, the clients get this info after the client run their bomb script.

Some things for you to ponder on...

 

:)

 

Share this post


Link to post
Share on other sites
Advertisement
  • 0

well, i allreeady tried that. i did waitUntil {boom > 0}; at the bottom of initPlayerLocal and then execVM "nuke\nuke.sqf";
in the script called by an addaction on an npc i got the variable boom set to 1 and be published to the server.

and guess what.. does not work.

 

iam now trying to use a different script which is more realsitic in my oppinion, but iam trying to get this into a .pbo i could call on the server if user performes addaction command.

anyone can tell me how this works ?

and thanks for the hint with the message, but i will not do this as i let an abc alarm go of 3 minutes before the power plant reaktor goes of cause of overheating

Edited by Erzengel

Share this post


Link to post
Share on other sites
  • 0

Hey

Maybe try this:

+ Place an object in Eden.

+ Name the object in it's init.

+ Export the object into your mission & execute it call it from your misson. 

Alias has done all the work for you here:

 

Share this post


Link to post
Share on other sites
  • 0
On 15.1.2018 at 2:24 AM, aussie battler said:

Hey

Maybe try this:

+ Place an object in Eden.

+ Name the object in it's init.

+ Export the object into your mission & execute it call it from your misson. 

Alias has done all the work for you here:

 

i know this hase bin a while since i posted that but i dont get any of alias scripts to work. I did try with him together but even he was not able to execute that for all players if it was not done from the admin menu

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

  • Recently Browsing   0 members

    No registered users viewing this page.