Epoch execute custom script client side

johnofwax

New Member
Hello,
I'm playing around with a development server just for giggles. Playing around with my friends, and just enjoying the game in general. I acquired the free admin tools that everyone seems to love so much, and cool - that's nifty, very helpful. Added a few weapons kits for myself... awesome. A few vehicles, too. I then attempted to add HALO Jumps to the vehicles spawned in this manner (and intend on later adding halo jumps to purchased vehicles, but that's a thread for a different day).
The issue I'm having at this point is... this is how I'm adding the jump.
Code:
_nul = _spwnveh addAction ["HALO JUMP","jump.sqf",[],1,false,true,"","_this in _target"];
However, I am the only person that sees the HALO JUMP option. Not all clients are getting this. It's local to me, because I executed the script. How can I spawn a new vehicle with a .sqf , but in such a way that everyone on the server gets the action?

I also had the same issue with an ammobox. I create an ammobox via the Tools Menu, and then I was executing

Code:
nul = [_spwnveh] execVM "crateFiller.sqf"

Well, This obviously will not work on a dedi, as execVM is client-side anyways... Both of these lines were generally used by me in the init field of vehicles / ammoboxes in missions I've created in ARMA. However, this dedi stuff is a whole different animal.
So, in searching about, I discovered 'call RE'.
I replaced the above line with
Code:
[nil, _spwnveh, rEXECVM, "crateFiller.sqf"] call RE;
but that didn't execute createFiller.sqf for me either, let alone everyone else on the server. How can I execute scripts on vehicles / objects on a global level, if the object or vehicle does not exist on the map yet, and is to be spawned in dynamically at some other point in time (ie, Trader Purchase or Admin spawn) ?

Any help or pointers would be greatly appreciated. Thanks!
 
at first i thought you wantet to be able to do halo jumps from youre admin menu, but then i realized that you wantet it to eneble it it from inside a vehicle you spawned in (wich is kindof a wierd way to do it imo)

however the reason it only works for you is becourse you are calling it client side ... only you have been running the script ergo only you will get the option then

you will need to add it in somewhere else, if you want all the players on the map to be able to use the action

also i dont think you can spawn a crate and then fill it up with another script, unless you run this script from inside the crate spawning script (idk what you are trying to do there) ...

but you can spawn a crate or vehicle, clear content and then re-fill it with contet you define very easy and tbh i dont think i would call another script for that, but just do it in the vehicle/crate script
 
I think the ammobox issue is solved now, have to wait until later tonight to confirm though. I believe it was a case of addWeaponCargo vs addWeaponCargoGlobal , but we shall see. The reason it is scripted instead of being static in the spawn-script is so that the same sqf can be used across many different missions and scenarios. It was an old arma2 ammobox script that I've tailored a bit to DayZ by adding food and medical supplies, as well as building materials for Epoch. Depending on how the script is called, The type and amount of items found in the box can be tailored, without having to modify different files for each situation.

As far as the HALO jump goes, Yes, it would be kind of cool to just add that into the Tools Menu, which wouldn't be a problem. Could even open the map, get the mapclick, and auto-close the map, as I've done in the past on Arma missions.. But the theory behind this was to have an MV22 flying over certain areas, then dropping the players out via Halo jumps into the zone. It would be a bit more emmersive than just spawning them 2km above the ground.

I believe what I will need to do for this to work though, is set a variable on the vehicle in the same manner that Sarge=1 is set on the others... then, check for this variable in the init.sqf file, and adding the action when that condition is met.
However... would an element of init.sqf still hold true if the vehicle isn't created yet?

I should be able to use http://opendayz.net/threads/halo-jump-tutorial-simplified.8432/ as a base for the HALO feature, but basically the workaround there was 'if a player points at the vehicle, add Halo Jump to it'. I mean... yeah, sure, the player will at some point look at the vehicle so this would work... however, that's not really what I was looking for.
A MultiPlayer compatible solution to execute a script across all clients (including jip) to add the action or whatever a script may be doing is really what I was looking for... the 'call RE' looked like it was going to be the way to go, but it didn't work. In reading up on that, the Functions module is required for it to work, and I'm unsure if that is present in the map currently.

I'm basically looking for a realtime alternative to the init field of vehicles. Would it be ill-advised to use setVehicleInit in this case? I'm concerned about the effects running processInitCommands may have on a dayZ server that is already up and running...
 
call it from the init after specifying its only for new spawns, like where it normally calls to do the halo jump, but instead you attach the player into the vehicle and give them the option to halo from the plane, like you did ...?
 
Back
Top