Tom507
Member-
Content Count
18 -
Joined
-
Last visited
-
Medals
Everything posted by Tom507
-
basic selection of connected Player help
Tom507 replied to Tom507's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@killzone_kid I'm afraid I have to take some of your Time again I got everything to work so far exept one thing wich is the check if the Player is alive iterestingly the Player object changes in the middle of my script from: R Alpha 1-1:1 (Tom507) REMOTE to: 286a0080# 48: vr_protagonist_f.p3d REMOTE (thats propably the moment the player takes controll of the Unit) thought it might be important I have a simple if (alive _player) then { // my main script } else { // it allways runns into the else I dont understand why sleep 2; if (alive _player) then { _player setCaptive true; // this is supposed to make the Player captive every time he respawns }; }; the question is why does my alive check not work? to qoute your own Blog KK http://killzonekid.com/arma-scripting-tutorials-locality/ AG: Command accepts global arguments. If the argument is a vehicle, I do not have to find the PC that owns it, I can just reference it from anywhere. if thats the case (witch it is with alive) I don't understand it this is my whole script in case you wan't a look: btw I also tryed putting it all in the initPlayerServer.sqf but since it never got to the the main part of the code it made no difference whatsoever I noticed the Note under the alive command I have only the respaw activated but that shouldn't be an issue so far anyway since I never died while testing: Thanks for any answer in advance!!!! plus: I found out now that, the value of thisPlayer (witch is the global variable i'm asigning _player to) switches from bis_02_47( witch is the correct value I think) to: (some number, different every time): vr_protagonist_f.p3d REMOTE every view seconds- 11 replies
-
- multiplayer
- jip
-
(and 4 more)
Tagged with:
-
basic selection of connected Player help
Tom507 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I got this to work (at least partially): in the init: if (isServer) then { addMissionEventHandler["PlayerConnected",{_this execVM "playerInit.sqf"}]; }; in playerInit.sqf: thisPlayer = objNull; playerId = (_this select 4); for "_x" from 0 to (count allPlayers) -1 step 1 do { if (owner _x == playerId) then { thisplayer = (allPlayers select _x); }; }; thisPlayer = _this publicVariable "thisplayer"; publicVariable "playerId"; the Id is correctly transfered the problem is thisPlayer returns nothing the if never returns true so either the player is not in the list allPlayers at the time or i have no clue I tested everything seperately and everything works so Ihave nu f*king idea why it doesn't work Please help thanks in advance- 11 replies
-
- multiplayer
- jip
-
(and 4 more)
Tagged with:
-
Server sided connection handling
Tom507 replied to Tom507's topic in ARMA 3 - MISSION EDITING & SCRIPTING
thanks for your answer! i have to admit i was to impatient, to wait for it tho, and started a new thread I'm sorry and by the way the Reason why the stuff didn't work was not because of global vars(i was alone on my Server anyway), but because of the Player not beeing correctly initialized (thats what you probably ment) https://community.bistudio.com/wiki/player KK and Larrow pointed me at the initPlayerServer.sqf wich I got to work in an instant: (code in initPlayerServer.sqf) params[ "_player", "_didJIP" ]; thisPlayer = _player; publicvariable "thisPlayer"; // works as smooth as a babys skin and is less expansive (calc time) than what we were attempting still thanks for your Efforts- 12 replies
-
- multiplayer
- server
-
(and 2 more)
Tagged with:
-
I'm making a guerilla style coop mission the code works well in single player but as soon as i go on a Server not verry much happens I plan on having a persistent server witch initializes with the start so i only have JIPs I have been trying to just execute code on new Players either by 1. writing them in a list and updating it every 0.1 sec. or (and looping thrue them later) 2. by (Player) execVM ... i tried playing with waitUntil it doesnt seem to have any effect (apart from delying the script) i failed with both attempts there must be something im missing maybe locality? here is my code (you can also Just answer my question im shure its a simple one for some of you) : 1. : while {true} do { for "_thisPlayerNum" from 0 to (count allPlayers) do { _thisPlayer = (allPlayers select _thisPlayerNum); if (!isNil "_thisPlayer") then { if (alive _thisPlayer) then { if (!(_thisPlayer in myLivePlayers)) then { // executed on Player spawn //waitUntil {alive _thisPlayer}; myLivePlayers = (myLivePlayers + [_thisPlayer]); _thisPlayer setCaptive true; } else { if (!(alive _thisPlayer)) then { // executed on Player death myLivePlayers = (myLivePlayers - [_thisPlayer]); if (_thisPlayer in HostilePlayers) then { TimeLastShot = TimeLastShot - [(TimeLastShot select (HostilePlayers find _thisPlayer))]; HostilePlayers = HostilePlayers - [_thisPlayer]; }; }; }; if ((_checkNewPlayer != (count allPlayers)) and (_thisPlayer in myLivePlayers)) then { _thisPlayer execVM "GW_3_0_PlayerConnected.sqf"; }; _checkNewPlayer = (count allPlayers); }; }; }; sleep 0.1; }; 2. : while {true} do { if ((count allPlayers) > 0) then { if (_checkNewPlayer < (count allPlayers)) then { waitUntil{isNull (allPlayers select ((count allPlayers)-1))} (allPlayers select ((count allPlayers)-1)) execVM "GW_3_1_Main.sqf"; } _checkNewPlayer = (count allPlayers); }; sleep 0.1; }; I would verry much appreciate your help this holds me back for a week now THX in advance
- 12 replies
-
- multiplayer
- server
-
(and 2 more)
Tagged with:
-
basic selection of connected Player help
Tom507 replied to Tom507's topic in ARMA 3 - MISSION EDITING & SCRIPTING
thx again you were a great help @Larrow and @killzone_kid- 11 replies
-
- multiplayer
- jip
-
(and 4 more)
Tagged with:
-
basic selection of connected Player help
Tom507 replied to Tom507's topic in ARMA 3 - MISSION EDITING & SCRIPTING
still two questions can I put my main script in the initPlayerServer.sqf with heavy stuff like checkVisibility or should i write my own list of Players and go through it seperatly? and secondly just out of interest how exactly would I do this ? maybe something like Player == Player that I read a couple of times or !isNull Player (woulndn't work tho since i don't yet have the object Player)? will it be the right Player Object from the moment the initPlayerServer.sqf runns? important for this: _DetectionTrigger setTriggerStatements [ "this", format [" %1 setVariable ['_DetTrgThisList_%1', thisList] ", _player ] , "" ];- 11 replies
-
- multiplayer
- jip
-
(and 4 more)
Tagged with:
-
basic selection of connected Player help
Tom507 replied to Tom507's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@larrow: OK WTF I just tried your solution Larrow and it works just like that!!! ( initPlayerServer.sqf ) I'm amazed thanks soooooo much now i can get on with the fun stuff, this held me back for a week or so from making my script multiplayer compatible. I have to say I'm verry thankfull that you pro's took it upon you to answer me. I already saw alot of stuff from both of you larrow and KK. btw. can I somehow mark this as solved?- 11 replies
-
- multiplayer
- jip
-
(and 4 more)
Tagged with:
-
basic selection of connected Player help
Tom507 replied to Tom507's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I think I got everything right now but it still doesn't work: init.sqf if (isServer) then { addMissionEventHandler["PlayerConnected",{_this execVM "GW_3_1_Main.sqf"}]; }; GW_3_1_Main.sqf : I noticed that I had befor: owner _x fixed it still no luck thisPlayer = objNull; playerId = (_this select 4); // I also tried somethings with isNull but i have no object since I have not yet selected the Player // and this with isNil doesn't work either // waitUntil {!isNil (str playerId)}; for "_x" from 0 to (count allPlayers) -1 step 1 do { if ((owner (allPlayers select _x)) == playerId) then { thisplayer = (allPlayers select _x); }; }; publicVariable "thisplayer"; publicVariable "playerId"; the problem is still that thisPlayer returns: null object (as initialized) while playerId works fine I'm afraid I need your help once more since I don't see anything wrong with this. thanks in advance!- 11 replies
-
- multiplayer
- jip
-
(and 4 more)
Tagged with:
-
basic selection of connected Player help
Tom507 replied to Tom507's topic in ARMA 3 - MISSION EDITING & SCRIPTING
thank you for your fast answers !!! @ larrow : Im just using global variables for testing purposes its not final code but I will definetly look into initPlayerServer.sqf I didn't know that that is something Special. @KK : I just now found out about the .rpt files so I will propably get at least the syntax right in the future. btw is there any other method to get the syntax errors of called scripts on the server in real time like in the editor? Why can the condition of the if not be true ? is the owner (id) not the same as 3 (for the first connected Player)?- 11 replies
-
- multiplayer
- jip
-
(and 4 more)
Tagged with:
-
Server sided connection handling
Tom507 replied to Tom507's topic in ARMA 3 - MISSION EDITING & SCRIPTING
don't get confused by the previous posts just read this one. I think i spoke too soon because i can't get yours to work Im confused since it doesn't work either when i do it any other way for example: handler: if (isServer) then { addMissionEventHandler["PlayerConnected",{_this execVM "GW_3_1_Main.sqf"}]; }; script: playerId = (_this select 4); for "_x" from 0 to (count allPlayers) -1 step 1 do { if (owner _x == playerId) then { thisplayer = (allPlayers select _x); }; }; sleep 0.5; publicVariable "thisplayer"; publicVariable "playerId"; it does everything (theoretically) that yours does except stopping the loop playerId returs the correct 3 but thisPlayer returns nothing for some reason i believe the evaluation doesn't work neither in mine nor in yours since if i do this: private _ownerId = _this; private _player = objNull; { if(owner _x == _ownerId) exitWith { _player = _x; }; } forEach allPlayers; playerId = _ownerId ; thisplayer = _player ; thisPlayer returns your initialization "<NULL-object>" so the condition never returned true or your exitWith didn't set the variable correctly (yes i changed (_this select 4) every time in the other script) this doesn't work at all in the init.sqf: if (!isServer) then { [player, "GW_3_1_Main.sqf"] remoteExec ["execVM", 2]; }; Main: thisPlayer = _this publicVariable "thisplayer"; publicVariable "playerId"; i have no idea what could be wrong with that stil thanks for the response!- 12 replies
-
- multiplayer
- server
-
(and 2 more)
Tagged with:
-
Server sided connection handling
Tom507 replied to Tom507's topic in ARMA 3 - MISSION EDITING & SCRIPTING
nevermind i looked it up https://community.bistudio.com/wiki/exitWith- 12 replies
-
- multiplayer
- server
-
(and 2 more)
Tagged with:
-
Server sided connection handling
Tom507 replied to Tom507's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I could punch myself for making such a basic mistake . Sorry that i got so emotional but this basic stuff stopped my advance for a lot of ours. Thank you so much now i can finally work on the fun stuff. What does this do tho? Why would the server ever have to deal with clients that have the same ID? isn't the ID given by the server and should therefor be unique?- 12 replies
-
- multiplayer
- server
-
(and 2 more)
Tagged with:
-
Server sided connection handling
Tom507 replied to Tom507's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I want to get rid of this problem because im annoyed that i can't move on and do the way more interesting stuff that i have planned for my mission please HELP !!!!!!!! THANKS IN ADVANCE- 12 replies
-
- multiplayer
- server
-
(and 2 more)
Tagged with:
-
Server sided connection handling
Tom507 replied to Tom507's topic in ARMA 3 - MISSION EDITING & SCRIPTING
OMG thakns I think thats the exact thing im looking for but it still doesnt work for me shouldn't i be able to access the owner with: _this select 5 like so : if (isServer) then { addMissionEventHandler["PlayerConnected",{_this execVM "GW_3_1_Main.sqf"}]; }; this is in GW_3_1_Main.sqf : thisPlayer = _this select 5; publicVariable "thisPlayer"; if I watch thisPlayer it returns nothing I'm now even looping the public variable even though it should be JIP proof (so i read) while {true} do { sleep 0.5; publicVariable "thisPlayer"; }; still doesn't work- 12 replies
-
- multiplayer
- server
-
(and 2 more)
Tagged with:
-
Server sided connection handling
Tom507 replied to Tom507's topic in ARMA 3 - MISSION EDITING & SCRIPTING
btw i know my code is a mess its by far not final i was just trying things- 12 replies
-
- multiplayer
- server
-
(and 2 more)
Tagged with:
-
Server sided connection handling
Tom507 replied to Tom507's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I saw that but how do i get the Players in to the executed script the ids that that command gives you are as i read in this forum useless if i were searching for the profile name there is the simple: name (object) I am searching for a way to reliably get the (object) that is the player into an execVm without delaying the connect handler.- 12 replies
-
- multiplayer
- server
-
(and 2 more)
Tagged with:
-
How to spawn in a weapons crate?
Tom507 replied to Batflaps's topic in ARMA 3 - MISSION EDITING & SCRIPTING
i would use an arsenal on some entity (can be player, car, crate, anything you can see) and double click it and add in the field called init : ["AmmoboxInit",[this,true]] call BIS_fnc_arsenal; then in the Game look at whatever you decided to place just scroll your mouse wheel and select with middle mouse button Arsenal -
Eula licence not accepted
Tom507 replied to DentonJC.bio@gmail.com's topic in ARMA 3 - BI TOOLS - TROUBLESHOOTING
I have the same issue but it does still not work if i start it with steam: I play the a 3 tools, accept the license and click on the updater button, then i get a windows error message that tells me a3 tools stoped working, but the window does still work, and also an updater window showes up witch tells me that i didnt agree the liscense. What should i do about it? could it be that the game beeing on another drive is causing this? o btw some of the other tools do work somehow its only the updater thats causing this problem Help would be verry much appreciated!