Jump to content

Tom507

Member
  • Content Count

    18
  • Joined

  • Last visited

  • Medals

Community Reputation

0 Neutral

About Tom507

  • Rank
    Private First Class

Recent Profile Visitors

563 profile views
  1. @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
  2. 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
  3. thx again you were a great help @Larrow and @killzone_kid
  4. 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 ] , "" ];
  5. @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?
  6. 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!
  7. 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)?
  8. 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
  9. 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!
  10. nevermind i looked it up https://community.bistudio.com/wiki/exitWith
  11. 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. 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
  13. 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
  14. btw i know my code is a mess its by far not final i was just trying things
  15. 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.
×