Jump to content
  • 0

Scripting tutorial


Jestertriks

Question

16 answers to this question

Recommended Posts

  • 0

Heres my files see lines in blue are the codes for EESSV2 mod

use the install guide and compare:

my Init.sqf  step 1 of guide. 

Spoiler

//Run the player monitor
    _id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
    _playerMonitor =     [] execVM "\z\addons\dayz_code\system\player_monitor.sqf";   
    execVM "spawn\start.sqf";

my init step 2 of guide.

Spoiler

dayz_MapArea = 14000; // Default = 10000
dayz_maxLocalZombies = 30; // Default = 30

dayz_paraSpawn = false;

dayz_minpos = -1;

my description.ext step 3 of guide

Spoiler

class controls
    {
        class Title1 : RscLoadingText
        {
            text = "$STR_LOADING"; // "Loading" text in the middle of the screen
        };
        class CA_Progress : RscProgress // progress bar, has to have idc 104
        {
            idc = 104;
            type = 8; // CT_PROGRESS
            style = 0; // ST_SINGLE
            texture = "\ca\ui\data\loadscreen_progressbar_ca.paa";
        };
        class CA_Progress2 : RscProgressNotFreeze // progress bar that will go reverse
        {
            idc = 103;
        };
        class Name2: RscText // the text on the top-left
        {
            idc = 101;
            x = 0.05;
            y = 0.029412;
            w = 0.9;
            h = 0.04902;
            text = "";
            sizeEx = 0.05;
            colorText[] = {0.543,0.5742,0.4102,1.0};
        };
    };
};

///spawn class//


#include "spawn\class.hpp"
#include "spawn\halo.hpp"
#include "spawn\spawn.hpp"

*place spawn folder in MPMISSIONS/Instance_chernarus.11/

For now on!!!!!!!!!!!UNPACK YOUR dayz_server.pbo!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

*Step 5 server_playerSetup.sqf  replace whole code   ( i show u my file whit the replace done)

Spoiler

//record for Server JIP checks
    _playerObj setVariable["zombieKills_CHK",0];
    _playerObj setVariable["humanKills_CHK",0,true];
    _playerObj setVariable["banditKills_CHK",0,true];
    _playerObj setVariable["headShots_CHK",0];
};

if (_randomSpot) then {
   if (!isDedicated) then {endLoadingScreen;};
   _debug = getMarkerpos "respawn_west";
   _worldspace = [0,[_debug select 0,_debug select 1,0.3]];
};


//Record player for management
dayz_players set [count dayz_players,_playerObj];

*Step 6 modify server_playerSetup.sqf   -- my server_playerSetup.sqf

Spoiler

//record player pos locally for server checking
_playerObj setVariable["CharacterID",_characterID,true];
_playerObj setVariable["humanity",_humanity,true];
_playerObj setVariable["humanity_CHK",_humanity];
//_playerObj setVariable["worldspace",_worldspace,true];
//_playerObj setVariable["state",_state,true];
_playerObj setVariable["lastPos",getPosATL _playerObj];

dayzPlayerLogin2 = [_worldspace,_state,_randomSpot];

// PVDZE_obj_Debris = DZE_LocalRoadBlocks;

Step 7 server_playerDied.sqf  -- my server_playerDied.sqf

Spoiler

_victim = _newObject;
_newObject setVariable ["bodyName", _victimName, true];
_newObject setVariable ["bodyUID", _playerID, true];

******!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Repack your dayz_server.pbo!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*******

step 8 (i dont have infistar, if u have follow the guide)-

Step 9 (dont worry about configs do it later)

Step 10 ( i dont change it)

Step 11 ( we are using epoch, so dont do it this step)

Link to comment
Share on other sites

  • 0

no, do the spawn selection... its step 5

 

*Step 5 server_playerSetup.sqf  replace whole code  

you needs find this code in server_playerSetup.sqf

Spoiler
if (_randomSpot) then {
        private["_counter","_position","_isNear","_isZero","_mkr"];
        if (!isDedicated) then {
                endLoadingScreen;
        };
       
        //Spawn modify via mission init.sqf
        if(isnil "spawnArea") then {
                spawnArea = 1500;
        };
        if(isnil "spawnShoremode") then {
                spawnShoremode = 1;
        };
       
        //
        _spawnMC = actualSpawnMarkerCount;
 
        //spawn into random
        _findSpot = true;
        _mkr = "";
        while {_findSpot} do {
                _counter = ;
                while {_counter < 20 && _findSpot} do {
                        // switched to floor
                        _mkr = "spawn" + str(floor(random _spawnMC));
                        _position = ([(getMarkerPos _mkr),,spawnArea,10,,2000,spawnShoremode] call BIS_fnc_findSafePos);
                        _isNear = count (_position nearEntities ["Man",100]) == ;
                        _isZero = ((_position select ) == ) && ((_position select 1) == );
                        //Island Check          //TeeChange
                        _pos            = _position;
                        _isIsland       = false;                //Can be set to true during the Check
                        for [{_w=},{_w<=150},{_w=_w+2}] do {
                                _pos = [(_pos select ),((_pos select 1) + _w),(_pos select 2)];
                                if(surfaceisWater _pos) exitWith {
                                        _isIsland = true;
                                };
                        };
                       
                        if ((_isNear && !_isZero) || _isIsland) then {_findSpot = false};
                        _counter = _counter + 1;
                };
        };
        _isZero = ((_position select ) == ) && ((_position select 1) == );
        _position = [_position select ,_position select 1,];
        if (!_isZero) then {
                //_playerObj setPosATL _position;
                _worldspace = [,_position];
        };
};

delete all this lines and replace whit this:

Spoiler

if (_randomSpot) then {
   if (!isDedicated) then {endLoadingScreen;};
   _debug = getMarkerpos "respawn_west";
   _worldspace = [0,[_debug select 0,_debug select 1,0.3]];
};

remember pack again your dayz_server.pbo...   you know what im talking right?

are you working on epoch server?

where you drop "spawn" folder?

Link to comment
Share on other sites

  • 0

Yes I did all this already. I have a overpoch server.

 

I have to replace everything in your spoiler? I thought just 

if (_randomSpot) then {
        private["_counter","_position","_isNear","_isZero","_mkr"];
        if (!isDedicated) then {
                endLoadingScreen;
        };
 
That's what Im probably doing wrong
Link to comment
Share on other sites

  • 0

this is my mission.sqf line for step 10... i dont do it this step  class Item1
        {
            position[]={-7245.377,365.98782,19535.367};
            name="respawn_west";
            type="Empty";
        };

Link to comment
Share on other sites

  • 0
1 hour ago, Jestertriks said:

Yes I did all this already. I have a overpoch server.

 

I have to replace everything in your spoiler? I thought just 

if (_randomSpot) then {
        private["_counter","_position","_isNear","_isZero","_mkr"];
        if (!isDedicated) then {
                endLoadingScreen;
        };
 
That's what Im probably doing wrong
Guide say u put it:

if (_randomSpot) then {
   if (!isDedicated) then {endLoadingScreen;};
   _debug = getMarkerpos "respawn_west";
   _worldspace = [0,[_debug select 0,_debug select 1,0.3]];
};

 

see.. paste your whole server_playerSetup.sqf  in here  (use the spoiler)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...