Jump to content

Brockie

Member
  • Posts

    365
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Brockie

  1. Hey @theduke,

    I don't have the gem mod but I do have extra right click actions, so I used that to play with building a flag and I was right,about player_build.sqf.

    server_monitor.sqf will take care of texturing your flags each time you restart the server, and player_build.sqf will take care of immediately texturing objects as they are being built.  You don't need to edit any of the "publishVehicles" files and you shouldn't need the skins.sqf file either.  

    so here is what I would do for player_build.sqf:  (I've added only one line here, but showing the whole block so you can see where to put it.)

     

    // Start Build
    		_tmpbuilt = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
    
    		_tmpbuilt setdir _dir;
    	
    		// Get position based on object
    		_location = _position;
    
    		if (_classname == "FlagCarrierWhite_EP1") then {_tmpbuilt setVehicleInit 'this setFlagTexture ''\ca\ca_e\data\flag_us_co.paa'';';};  // I added this line
    
    		if((_isAllowedUnderGround == 0) && ((_location select 2) < 0)) then {
    			_location set [2,0];
    		};

     

    and you need to add processInitCommands; near the end.  This shows where I would put it:

    			};
    			processInitCommands;   // I added this line
    		} else { //if magazine was not removed, cancel publish

     

    Once you've done this people will probably get kicked for BattlEye remoteexec restrictions when they build the flag. 

    Here's what you will want to add to your remoteexec.txt:

    !"setFlagTexture"

    like this:

    //new
    5 "" !"setFlagTexture" (more script here that I'm not showing)

     

  2. 4 hours ago, theduke said:

    I was never able to do it just server sided.  Maybe if i would of restarted the server, the skin would of been there. But the only way i was able to get it to work was by adding the suvskins.sqf mission sided.

    This is what i have mission sided called by the init

    suvskins.sqf

      Hide contents

    if (isServer) exitwith {};
    waitUntil {sleep 1; count vehicles > 1};
    sleep 1;
    {
        If (typeOf _x in ["SUV_Blue_DZE4"]) then 
        {
            nul = _x setObjectTexture [0,"graphics\SUV.jpg"]
        };
        If (typeOf _x in ["SUV_Red_DZE4"]) then
        {
            nul = _x setObjectTexture [0,"graphics\SUVCA.jpg"]
        };
        If (typeOf _x in ["SUV_Green_DZE4"]) then
        {
            nul = _x setObjectTexture [0,"graphics\SUVAI.jpg"]
        };
        If (typeOf _x in ["SUV_TK_CIV_EP1_DZE4"]) then
        {
            nul = _x setObjectTexture [0,"graphics\SUVESLK.jpg"]
        };
        If (typeOf _x in ["SUV_White_DZE4"]) then
        {
            nul = _x setObjectTexture [0,"graphics\SUVUK.jpg"]
        };
        If (typeOf _x in ["SUV_Orange_DZE4"]) then
        {
            nul = _x setObjectTexture [0,"graphics\suvweed.jpg"]
        };
        
    } forEach (vehicles);

     

    and i have the 3 files server sided modified also.

    So with you mentioning that it only appears on restart, maybe thats what the mission one does. (i could be wrong)

    But it wouldnt work if spawned in with admin tool. Just bought through trader

    I will give this a try thx

    Indeed my edits will only handle server restart, buying a vehicle, stuff that's already in epoch (building a flag should work too)  but server_monitor.sqf is just for restarts.  Now that I think of it... the file for changing textures of building is player_build.sqf.

    Admin tools is not part of epoch and those mods don't use epoch files for creating stuff, exact same goes for AI missions.  These mods use custom code for creating vehicles which is why the textures don't get applied immediately (but would take effect after a restart if the objects were persistant).  Did your skins.sqf solve the issue to texture admin spawned vehicles?  If not then it is redundant having that file.

    What I would do is edit the actual admin tools that when it createVehicle it also setObjectTexture.  Same could be done with AI missions, by editing the missions code.

  3. Hey @theduke,  I've got it working.

    but before I reveal the code for re-texturing flags I just want to ask about your " mission sided file...  "skins.sqf... in the init.sqf ".  This should not be necessary from what I can tell.  Unless I am mistaken re-texturing should work for all clients, including ones that join later.  Is that from another texture script?  what is the purpose of that file?

    anyway here it is for your sever_monitor.sqf:

    Spoiler
    
    if (_type == "FlagCarrierWhite_EP1") then {_object setVehicleInit 'this setFlagTexture ''\ca\ca_e\data\flag_us_co.paa'';';};

     

    This will re-texture the flag for you on server startup but I don't have emerald designer or whatever gem mod you are using so I can't test building a flag dynamically.  But If you find that it's not working dynamically then I would recommend adding the line also to server_publishVehicle3.sqf (i think this is for dynamic object creating) or actually maybe server_publishObject2.sqf (I'm not sure) and just remember in those files you must change _type to _class.  

  4. Hey @theduke,

    that's an interesting question.  I didn't know about the setFlagtexture command.

    Firstly a bit of a typo in your code: setFalgTexture should be setFlagTexture.

    Now, looking at the difference in syntax on the bohemia wiki first thing I notice is a difference in syntax between setObjectTexture and setFlagtexture.

    syntax for setObjectTexture:

    object setObjectTexture [selectionNumber,texture]

    syntax for setFlagTexture:

    flag setFlagTexture texture

    Indeed it seems there is no 'selection number' when it come to flags.  This means you shouldn't need brackets around the path to the texture file.  Try this:

    if (_class == "FlagCarrierWhite_EP1") then {
    	_object setVehicleInit "this setFlagTexture ''graphics\flag.jpg''" 
    };

    This line of code might have syntax errors but it looks good to me right now.  

     

    Next, when trying to decide between _class or _type it comes down to how the stock files were written.  Use the variable that is being called for creating the vehicle.  Examples:

    Server_Monitor.sqf:

    createVehicle [_type, _pos, [], 0, "CAN_COLLIDE"];

    server_publishVehicle2.sqf, server_publishVehicle3.sqf

    createVehicle [_class, [0,0,0], [], 0, "CAN_COLLIDE"];

    It's just how it was written by the devs for whatever reason.

    Next I'm going to share some of my novice understanding of the code.  Emphasis on being 'novice'.

     

    if (_class == "FlagCarrierWhite_EP1") then {
    	_object setVehicleInit "this setFlagTexture ''graphics\flag.jpg''" 
    };

    So in this line of code, I believe (though I could be totally wrong) _class only represents which type of object we are looking for.   If you have 10 of the same type of flag on the map it's looking at all of them.  Where _object I believe has a number associated with it to identify exactly which of those 10 flags is being updated each time.

    The last thing I can think of right now is the difference between server_publishVehicle.sqf,  server_publishVehicle2.sqf, server_publishVehicle3.sqf, and server_monitor.sqf.   It is important to understand which file does what.  I wish I could explain this right now but I'm way too rusty.  server_monitor.sqf seems to be the likely candidate that deals with server startup so I would start there.  Make sure the flag is called from the database and not from editor.sqf that way the server_monitor.sqf should deal with it (I think).  if that doesn't work I next I would try publishVehicle3, and last I would try publishVehicle2.  I'm going to give this a try in my game and see if I can get it to work and I will report back.

    Thanks for the question.

  5. Hey everyone.  

    On 06/01/2015 at 10:06 PM, FragZ said:
    Spoiler

    I get those error in RPT:

    It spams around 10000 times

    if (_class == "SUV_Yellow_DZE4") then {_obje>
     0:19:19   Error position: <_class == "SUV_Yellow_DZE4") then {_obje>
     0:19:19   Error Undefined variable in expression: _class
     0:19:19 File z\addons\dayz_server\system\server_monitor.sqf, line 144
     0:19:19 Error in expression <riable ["ObjectID", _idKey, true];


    And it wont work ingame...

     

     

    Ok, firstly... sorry I have been away for ages...  beyond that the problem was pretty clear by your RPT:

    problem was you copied the wrong line of code into server_monitor.sqf.

    Step 4 said _type not _class. 

    Spoiler
    On 04/08/2014 at 3:51 AM, Brockie said:

          Step 4.  In your server_monitor.sqf find this:

    
    
    			_lockable = 0;
    			if(isNumber (configFile >> "CfgVehicles" >> _type >> "lockable")) then { 

                       And ABOVE it put this

    
    
    			if (_type == "SUV_TK_CIV_EP1") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\SUV.jpg''];';};

                     Change the Vehicle Classname and the texture pathing for your texture and vehicle.  Keep adding more lines like this for each texture that you need.

     

    I also made a note in step 6 because I knew some people wouldn't get it right.

    Spoiler
    On 04/08/2014 at 3:51 AM, Brockie said:

          Step 6. In server_publishVehicle:

                     Notice the only difference is _class instead of _type.  Again  keep adding more lines like this for each texture that you need.

     

     

    Sorry you had problems getting this to work but you just needed to read the instructions better.

    After I was away for nearly 2 years and now being very rusty at this, I was still able to follow my own instructions and I'm happy to say it still works the same in 1.0.5.1 that it did in 1.0.4.2.

    If anyone has difficulty with this feel free to message me and I'll try to help.  

  6. On 29/07/2015 at 5:59 PM, SmokeyBR said:

    found an error on client RPT

    if player in combat mode and tries to build something this happens

    Spoiler
    
    
    Error in expression < player_build_getConfig;
     
     
    _classname = _itemConfig select 0; 
    _classnametmp = _>
      Error position: <_itemConfig select 0; 
    _classnametmp = _>
      Error Undefined variable in expression: _itemconfig
    File mpmissions\__CUR_MP.Chernarus\dayz_code\actions\modular_build.sqf, line 48

     

     

    I had the same problem.  The bug is in player_build_states.sqf.  The script is checking the variable _isFine and expecting Boolean (true or false) but it's returning "Strings".

    @RimBlock - The way I saw the true error was to wrap the the "[] call player_build_states;" with a waitUntil control structure.  This brought out the proper error in my RPT as to _isFine should be boolean and not strings.  Please double check because I am admitedly using a modified version of P4L but I'm fairly certain this is a bug in your release.  Correct me if I'm wrong.

    To fix it open player_build_states.sqf and change the _isFine variables to Boolean like this:

    Spoiler
    
    if(!DZE_ActionInProgress) exitWith {};
    //disallow building if these conditions are not met
    private ["_isFine","_onLadder","_vehicle","_inVehicle"];
    
    _isFine = true; //define variable to avoid RPT errors
    _onLadder =	(getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
    _vehicle = vehicle player;
    _inVehicle = (_vehicle != player);
    
    if (dayz_isSwimming) exitWith { //end script if player is swimming
    	DZE_ActionInProgress = false;
    	cutText [localize "str_player_26", "PLAIN DOWN"];
    	_isFine = false;
    	_isFine
    };
    
    if (_inVehicle) exitWith { //end script if player is in vehicle
    	DZE_ActionInProgress = false;
    	cutText [(localize "str_epoch_player_42"), "PLAIN DOWN"];
    	_isFine = false;
    	_isFine
    };
    
    if (_onLadder) exitWith { //end script if player is climbing on ladder
    	DZE_ActionInProgress = false;
    	cutText [localize "str_player_21", "PLAIN DOWN"];
    	_isFine = false;
    	_isFine
    };
    
    if (player getVariable["combattimeout", 0] >= time) exitWith { //end script if player is in combat
    	DZE_ActionInProgress = false;
    	cutText [(localize "str_epoch_player_43"), "PLAIN DOWN"];
    	_isFine = false;
    	_isFine
    };
    
    _isFine //returns string to caller, default is "ok" if conditions were not met

     

    Also, however, while debugging this I also found some other nasty, and related, bugs...  

    If you pass the player_build_states.sqf  (ie. you aren't swimming or in a vehicle or on a ladder) it gives you the ghost preview of the object you are about to build.  The problem is that once you have the ghost preview, you can mount a vehicle (or go swimming, or climb on a ladder) and the build doesn't get interupted.  It will infact try to build the object and although it wont actually publish the object (it sort of gets frozen during the build) this is a problem if your server supports static weapons (like mine does) because it will not stop you from mounting an unpublished weapon (or vehicle).  So for me this is not good.

    So I'm sure there's a better way to fix this but my solution so far is to modify the player_build_publish.sqf to essentially recheck the player's "state".  Like so: (don't forget to ADD the extra variables to the private ["..."]  (variables array).

    Spoiler
    
    private ["_passArray","_cancel","_position","_reason","_classnametmp","_classname","_tmpbuilt","_dir","_location","_text","_limit","_isOk","_proceed","_counter","_dis","_sfx","_started","_finished","_animState","_isMedic","_num_removed","_lockable","_combinationDisplay","_combination_1","_combination_2","_combination_3","_combination_4","_combination","_combination_1_Display","_playerUID","_OwnerUID","_toohigh","_isWater","_vehicle","_inVehicle","_onLadder"];
    
    //defines
    _cancel = _this select 0;
    _position = _this select 1;
    _classnametmp = _this select 2;
    _isAllowedUnderGround = _this select 3;
    _text = _this select 4;
    _isPole = _this select 5;
    _lockable = _this select 6;
    _dir = _this select 7;
    _reason = _this select 8;
    _requireplot = _this select 9;
    
    _playerUID = [player] call FNC_GetPlayerUID;
    
    _passArray = [];
    
    _isOk = true;
    _proceed = false;
    _counter = 0;
    _location = [0,0,0];
    
    _isWater = dayz_isSwimming;
    _vehicle = vehicle player;
    _inVehicle = (_vehicle != player);
    _onLadder =		(getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
    if (_isWater) exitWith {DZE_ActionInProgress = false; cutText [localize "str_player_26", "PLAIN DOWN"];};
    if (_inVehicle) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_42"), "PLAIN DOWN"];};
    if (_onLadder) exitWith {DZE_ActionInProgress = false; cutText [localize "str_player_21", "PLAIN DOWN"];};
    
    //No building on roads unless toggled
    if (!DZE_BuildOnRoads) then {
    	if (isOnRoad _position) then {
    		_cancel = true;
    		_reason = "Cannot build on a road.";
    	};
    };

     

    If anyone knows a better way to interupt the build when the player goes swimming, gets on a ladder, or jumps in a vehicle, please let me know! 

    Lastly.. OP please try to condense this mod back into player_build.sqf because this is a bit of a mess as many have already commented.  Also as an opinion I think safes, lockboxes, combos etc should not have been changed.. please change it back to normal or give people the option to keep it normal.  Nonetheless great work.  Keep it up =)

  7. Yea.. they have it polling the server list on execution of the app. I suggest they cease that and have it cache on the client systems and players can manually refresh instead of automatically on startup.

     

    That's the only time I find it slow for me.

     

     

    The strange thing was DC wasn't telling me a mod was not installed ie: Epoch1051 but Dayz Launcher indicated it right away as well as DL'n the mod in DL was lightning fast compared to DC.

     

    Maybe DC will get it all sorted out in the end.  It has been the staple launcher for many years.

     

    U can disable the auto polling on startup in the options.

     

    Also I find DayZ Launcher's need to rename all the folders is causing a lot of problems, but otherwise I'm all for extra launchers.. even tho I don't really use them very often anymore

  8. did you ever test if this was true yourself?

     

    there is a loot spawn timer that prevents loot from spawning if you approach a building too quickly.  it's designed to help with fps I think

  9. Yes it costs money to run a game server but it's not that much, really.  It's a lot less then smoking habit would cost.  And for what you get..  Having a dedicated comp in a data-center can be a great service to any family for hosting websites and cloud sharing and games.  Now that I have one it's taken the burden off my home PC and opened a lot of new options with the power of a dedi.  And there is also a lot of good cheap options out there to choose from.  I would say look at NFO's $30 VDS, or some of OVH servers are low prices, or Hertzner auctions.  A lot of people have great PCs though, and great internet, and are hosting good & reliable servers from home.  So clearly there is a lot of cheap options for hosting.  And I would highly recommend people try it at least once to get the feel for having a powerful dedicated computer at your finger tips to manage whatever your needs.

     

    So why does it matter if there's cheap options?  Because it seems that a lot of people make a big deal about donations..  "donate if you want me to continue adding things to the server", "donate if you want the server to keep running", "donate if you want me to take care of the server".... I could go on, boxes, loadoats, custom skins... yes I'm making these examples up... but I've seen a few servers like this before.

     

    And it's usually the younger crowds that want donation systems.  It's either a young adult that wants to make donations becuz they don't have a real job yet, or it's some teen that wants to spend there parents money on gaining an unfair advantage against others.  At least that has been my experience.  And when I tell them I don't accept donations it's usually shock and disbelief.  I tell them I don't need donations, thanks anyway.  And usually the reply I get "but, why not!? u should offer bases and loadouts and custom this or that.

     

    Ok if you are really passionate about hosting a great server for the love of the game but times are tough and you need the money.. I could understand you might gladly accept some donations.  But that should not be the intent when starting a server like so many do.  And selling items would not be the way to go.  Again if you can't afford it, let someone else take care of it.  There's already enough servers out there and I think the ones built for the love of the game will be far greater then the ones built on: I want to set up an online store in my video game land?  it's going to be so pro!   "donate 50 for an invisible/invincible tank".... lol briefcases of cash for me because I spent 15 minutes setting up a epoch server am I right?

     

    People if you want to donate... I say donate to the Epoch Team!  Go Team!

     

     

     

    Also... where did you get this from?  I admit I'm a sucker for skipping reading the fine print so maybe I missed it but it helps if you try to use notation otherwise I'm just left confused on where this part came from

     

     

    Can I reverse engineer or modify your game files?

    You may not reverse engineer or hack our games to access the content you want to make items from or to change the game’s functionality.

     

×
×
  • Create New...