-
Content Count
54 -
Joined
-
Last visited
-
Medals
Community Reputation
12 GoodAbout soldier9945
-
Rank
Lance Corporal
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
BIS_fnc_showMissionStatus shows wrong countdown time (at server start?)
soldier9945 replied to soldier9945's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Still having the problem when loading it with the first player connecting... but only on a dedicated server. Hosted local server doesn't have this error. I will try to make my own counter as suggested: -
How to copy Virtual Inventory from a vehicle to another?
soldier9945 replied to soldier9945's topic in ARMA 3 - MISSION EDITING & SCRIPTING
And just like that it works... Don't know what I did back then... Thanks for the explanation regarding BIS_addVirtualWeaponCargo_cargo -
How to copy Virtual Inventory from a vehicle to another?
soldier9945 replied to soldier9945's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I finally got it working by using the functions instead of the variables. initServer.sqf: fnc_copyVehicleArsenal = { Params["_vehToCopy", "_destVehs"]; Private["_BackPackCargo", "_ItemCargo", "_MagazineCargo", "_WeaponCargo"]; _BackPackCargo = _vehToCopy call BIS_fnc_getVirtualBackpackCargo; _ItemCargo = _vehToCopy call BIS_fnc_getVirtualItemCargo; _MagazineCargo = _vehToCopy call BIS_fnc_getVirtualMagazineCargo; _WeaponCargo = _vehToCopy call BIS_fnc_getVirtualWeaponcargo; { [_x, _BackPackCargo] call BIS_fnc_addVirtualBackpackCargo; [_x, _ItemCargo] call BIS_fnc_addVirtualItemCargo; [_x, _MagazineCargo] call BIS_fnc_addVirtualMagazineCargo; [_x, _WeaponCargo] call BIS_fnc_addVirtualWeaponCargo; ["AmmoboxServer", [_x, true]] call BIS_fnc_arsenal; } forEach _destVehs; }; [west_truck_1, [west_truck_2, west_truck_3, west_truck_4]] call fnc_copyVehicleArsenal; [east_truck_1, [east_truck_2, east_ammobox_1, east_ammobox_2]] call fnc_copyVehicleArsenal; I'm not sure that code is clean or optimized... still re-learning ArmA scripting... :/ -
How to copy Virtual Inventory from a vehicle to another?
soldier9945 replied to soldier9945's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I've got an error on this line: _x setVariable ["BIS_fnc_arsenal_condition", _condition, true ]; In the original BIS_fnc_arsenal it's used the same way, so I don't know why it wouldn't work here : case "AmmoboxInit": { private ["_box","_allowAll"]; _box = [_this,0,objnull,[objnull]] call bis_fnc_param; _allowAll = [_this,1,false,[false]] call bis_fnc_param; _condition = [_this,2,{true},[{}]] call bis_fnc_param; if ({} isequalto {}) then { _box setvariable ["bis_fnc_arsenal_condition",_condition,true]; }; -
How to copy Virtual Inventory from a vehicle to another?
soldier9945 replied to soldier9945's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@larrow, you're the best. I was gonna try to implement it like that... Do you read minds? Thanks a thousand times! Were did you find the BIS_fnc_arsenal_condition variable? EDIT: doesn't your script only copy the weapons from the truck ? _x setVariable [ "bis_addvirtualweaponcargo_cargo", _cargo, true ]; If this is for the weapons, shouldn't we add these variables too ? BIS_fnc_getVirtualBackpackCargo_cargo BIS_fnc_getVirtualItemsCargo_cargo BIS_fnc_getVirtualMagazineCargo_caro fnc_copyVehicleArsenal = { params[ "_vehToCopy", "_vehs" ]; _condition = _vehToCopy getVariable "BIS_fnc_arsenal_condition"; _cargo = _vehToCopy getVariable "bis_addVirtualBackpackCargo_cargo"; _cargo = _vehToCopy getVariable "bis_addVirtualItemsCargo_cargo"; _cargo = _vehToCopy getVariable "bis_addVirtualMagazinesCargo_cargo"; _cargo = _vehToCopy getVariable "bis_addVirtualWeaponcargo_cargo"; { _x setVariable [ "BIS_fnc_arsenal_condition", _condition, true ]; _x setVariable [ "bis_addVirtualBackpackCargo_cargo", _cargo, true ]; _x setVariable [ "bis_addVirtualItemsCargo_cargo", _cargo, true ]; _x setVariable [ "bis_addVirtualMagazinesCargo_cargo", _cargo, true ]; _x setVariable [ "bis_addVirtualWeaponcargo_cargo", _cargo, true ]; [ "AmmoboxServer", [ _x, true ] ] call BIS_fnc_arsenal; }forEach _vehs; }; if ( isServer ) then { [ west_truck_1, [ west_truck_2, west_truck_3, west_truck_4 ] ] call fnc_copyVehicleArsenal; }; Also, is using these variables faster than calling the functions BIS_addVirtual*****Cargo ? -
How to copy Virtual Inventory from a vehicle to another?
soldier9945 replied to soldier9945's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I may have found a solution reading the Arsenal Wiki and came up with the following idea: I could set up a Truck for Blufor called west_truck_1 and edit the virtual items I wanted. and in the init of every object I wanted to replicate these item selections: [this,(west_truck_1 call BIS_fnc_getVirtualBackpackCargo)] call BIS_fnc_addVirtualBackpackCargo; [this,(west_truck_1 call BIS_fnc_getVirtualItemCargo)] call BIS_fnc_addVirtualItemCargo; [this,(west_truck_1 call BIS_fnc_getVirtualMagazineCargo)] call BIS_fnc_addVirtualMagazineCargo; [this,(west_truck_1 call BIS_fnc_getVirtualWeaponCargo)] call BIS_fnc_addVirtualWeaponCargo; I'll try this now and will report back if it works! EDIT: Confirmed! This works! I had to change a few things from my first idea, sorry for the notifications that may have sent to subscribers of this thread -
Countdown timer, adding a points system & Stopping script if another is activated
soldier9945 replied to LimpingWhale's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I've started a new topic BIS_fnc_showMissionStatus shows wrong countdown time (at server start?) @larrow explained why the number is wrong in the first 5min: -
BIS_fnc_showMissionStatus shows wrong countdown time (at server start?)
soldier9945 replied to soldier9945's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks again! Does that mean it's a bug to be fixed? What synchronizes the server? A module? Do you know why it does wait 5mins before syncing? Thanks for the suggestions! I'll try to find another countdown script. -
Countdown timer, adding a points system & Stopping script if another is activated
soldier9945 replied to LimpingWhale's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks @harmdhast! Where would I execute it? If I'm not wrong, if it's called in the initServer.sqf, wouldn't it only be launched only at server start? What I don't understand is the second parameter explained with 1: BOOL - true to set the value globally. Shouldn't it already be correct for all clients? I've tried to reconnect after the server has started for an hour, and strangely it worked and showed the right time. I'll try running it with and report back. UPDATE: Just tried the following in initServer.sqf: [600, true] remoteExec ["BIS_fnc_countdown"]; //start mission Countdown Problem is, my end.sqf script triggers at start of the mission, ending it immediately. -
BIS_fnc_showMissionStatus shows wrong countdown time (at server start?)
soldier9945 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Apparently I have not managed to implement the BIS_fnc_showMissionStatus properly. It works fine on a Dedicated server, the end script ends the mission on the right time. But I can't seem to find out how to show the right time to the players. It displays too much time on the client, but only if I join the Dedicated server. If I launch the mission from the editor it works, at least for me, with the right time showing. Original BIS_FNC_countdown /* Author: Karel Moricky Description: Trigger countdown Parameter(s): 0: NUMBER - countdown in seconds 1: BOOL - true to set the value globally Returns: NUMBER */ private ["_countdown","_isGlobal"]; _countdown = [_this,0,0,[0,true]] call bis_fnc_param; _isGlobal = [_this,1,true,[true]] call bis_fnc_param; switch (typename _countdown) do { case (typename 0): { private ["_servertime"]; _servertime = if (ismultiplayer) then {servertime} else {time}; switch true do { case (_countdown < 0): { missionnamespace setvariable ["bis_fnc_countdown_time",nil]; if (_isGlobal) then {publicvariable "bis_fnc_countdown_time";}; -1 }; case (_countdown == 0): { private ["_time"]; _time = missionnamespace getvariable "bis_fnc_countdown_time"; if (isnil "_time") then { -1 } else { (_time - _servertime) max 0 }; }; case (_countdown > 0): { private ["_time"]; _time = _servertime + _countdown; missionnamespace setvariable ["bis_fnc_countdown_time",_time]; if (_isGlobal) then {publicvariable "bis_fnc_countdown_time";}; _time }; default { -1 }; }; }; case (typename true): { ([] call bis_fnc_countdown) > 0 }; default { -1 }; }; I have used in the initServer.sqf file (I expect the second parameter to set the mission time as a public variable for clients to get the right time when they initialize): // Mission End [600, true] call BIS_fnc_countdown; //start mission Countdown It seems to work fine on the server as stated, my End.sqf script ends the mission on the right time, 10mins after beginning. Problem is, when I want to show the player this timeout through initPlayerLocal.sqf: // Show Tickets Status [] call BIS_fnc_showMissionStatus; It shows numbers over the 1000's, as if the client interprets the server time wrong. I've checked after letting the Dedicated server was running for some time... and it strangely worked... EDIT: can reproduce this. Restarting server and connecting in about a minute shows the wrong countdown number. Waiting approx. 10min shows the right number. How do I fix that? -
Countdown timer, adding a points system & Stopping script if another is activated
soldier9945 replied to LimpingWhale's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@harmdhast Not useful. Not at all. Thread was unanswered. How is anybody gonna find solutions on here leaving things unanswered? @dreadedentity Thanks for the explanation. "Does not synchronize across clients" does that mean there's no possibility to show each client the current state of the countdown? That was my question about BIS_fnc_showMissionStatus. You explained the DE_fnc_countdown. Should we only use this one instead of BIS_fnc_countdown? Why? Thank you. -
Countdown timer, adding a points system & Stopping script if another is activated
soldier9945 replied to LimpingWhale's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@LimpingWhale I found out how to use BIS_fnc_countdown: /* Author: Karel Moricky Description: Trigger countdown Parameter(s): 0: NUMBER - countdown in seconds 1: BOOL - true to set the value globally Returns: NUMBER */ private ["_countdown","_isGlobal"]; _countdown = [_this,0,0,[0,true]] call bis_fnc_param; _isGlobal = [_this,1,true,[true]] call bis_fnc_param; switch (typename _countdown) do { case (typename 0): { private ["_servertime"]; _servertime = if (ismultiplayer) then {servertime} else {time}; switch true do { case (_countdown < 0): { missionnamespace setvariable ["bis_fnc_countdown_time",nil]; if (_isGlobal) then {publicvariable "bis_fnc_countdown_time";}; -1 }; case (_countdown == 0): { private ["_time"]; _time = missionnamespace getvariable "bis_fnc_countdown_time"; if (isnil "_time") then { -1 } else { (_time - _servertime) max 0 }; }; case (_countdown > 0): { private ["_time"]; _time = _servertime + _countdown; missionnamespace setvariable ["bis_fnc_countdown_time",_time]; if (_isGlobal) then {publicvariable "bis_fnc_countdown_time";}; _time }; default { -1 }; }; }; case (typename true): { ([] call bis_fnc_countdown) > 0 }; default { -1 }; }; Now when used in the initServer.sqf file like this: // Mission End [600, true] call BIS_fnc_countdown; //start mission Countdown it seems to work fine, even on Dedicated Severs. Problem is, when I want to show the player this timeout in initPlayerLocal.sqf: // Show Tickets Status [] call BIS_fnc_showMissionStatus; It does only work on my client if I host the game (from editor -> as MP mission) and it counts down from 10min to 0min. But on the dedicated server I get weird numbers (1030min) that grow if I restart the server 3min later, it will show (1033min) If I then restart the server 5min later it will show (1038min). I can however call the BIS_fnc_countdown funciton in the initPlayerLocal.sqf but then the timer goes wild and triggers my end conditions somehow too early. I think something is broken with the showMissionStatus function... I think there is a step missing by substracting the time of the server (from midnight?) or something like that. -
Kunduz, Afghanistan [10km] v1.20
soldier9945 replied to james2464's topic in ARMA 3 - ADDONS & MODS: COMPLETE
I can't seem to port my working missions on Kunduz to a dedicated Eden server... AI just falls through the map in loops and swim forward (instead of walking), same with vehicles (unmanned) that rotate weirdly. This doesn't happen when launched as MP mission from the Editor... What could it be? I tried making a sample mission with just 4 units (playable) and the swim-fallthrough-bug is there too. HELP!!! EDIT: My fault, I launched the dedicated server with nssm (launch any program as a service) and I had to hard code the startup parameters... first I had the armaholic version loaded on the server, and I changed it for the workshop version... The Dedicated Server couldn't load the map data anymore so he let the units and vehicles fall, but my client did the physics calculations with the terrain as ground surface... -
How to copy Virtual Inventory from a vehicle to another?
soldier9945 replied to soldier9945's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Okay, that I know. But is there an easy way to get the names of the already configured items from one vehicle to copy it into the init? Thanks! -
How to copy Virtual Inventory from a vehicle to another?
soldier9945 replied to soldier9945's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Dayum... Gonna try this, didn't event think about it. Thanks! What if I wanted to add some equipment everywhere, I'd have to edit every vehicle, right?