[RELEASE] - Deploy and pack bike - ARMA3 Epoch - UPDATED

Discussion in 'Scripting/Addon Discussion' started by FallingSheep, Feb 15, 2015.

  1. FallingSheep

    FallingSheep OpenDayZ Lord!

    Joined:
    Mar 17, 2013
    Messages:
    1,980
    Likes Received:
    576
    hey guys since theres no release section im just putting this here need it tested in the wild/public!

    Deploy/Pack Ebike

    What it does:
    lets deploy an ebike if you 50 krypto

    Difficulty:
    Easy < 5 min


    Requirements:
    Epoch mod
    mission folder access ( MPMISSIONS)
    text editor

    CREDITS
    Leigham
    Objectives
    KIloSwiss

    keith fitzgerald

    Install:
    1.
    add this to the bottom of your init.sqf in you mission folder
    (if you dont have a init.sqf just create one!)
    Code:
    waitUntil{!isNull (uiNameSpace getVariable ["EPOCH_loadingScreen", displayNull])};
    waitUntil{isNull (uiNameSpace getVariable "EPOCH_loadingScreen")};
    sleep 5;
    Deployaction = player addaction [("<t color=""#00CF11"">" + ("Craft Bike") +"</t>"),"scripts\bike.sqf","",-97,false,false,"",""];
    
    2. now create another sqf called bike.sqf and paste this into it,
    (save it in your mpmission\scripts folder)
    Code:
    if (EPOCH_playerCrypto > 50) then {
        titleText ["", "PLAIN DOWN"];
        player playActionNow "Medic";
        _spawnPos = player modelToWorld [0,2,0];
        _spawnDir = (getDir player) -90;
        SPAZ = [player, _spawnPos, _spawnDir];
        EPOCH_playerCrypto = EPOCH_playerCrypto - 50 ;
        sleep 3;
        publicVariableServer "SPAZ";
        sleep 1;
        ['You bought a bike for 50 crypto. Gone at restart!',0,0.7,2,0] spawn bis_fnc_dynamictext;
        player removeAction spazbike;
    } else{
        ['You need 50 crypto.',0,0.7,2,0] spawn bis_fnc_dynamictext;
    };
    
    3.place the .pbo in your @epochhive\addons folder.


    thats it!
    fire up your server grab some krypto and test it out!
     
    Last edited: Jul 12, 2015
  2. FallingSheep

    FallingSheep OpenDayZ Lord!

    Joined:
    Mar 17, 2013
    Messages:
    1,980
    Likes Received:
    576
    50 views and not 1 comment?
    so i assume it works correctly and no one has any issues with it?
     
  3. TuBz

    TuBz Member

    Joined:
    Jan 31, 2013
    Messages:
    48
    Likes Received:
    4
    Well maybe others like me think they have it installed but have no idea how to get it to actually work:)...
    pretty used to adding scripts already have vanp, and sem ai, old style a2 loot spawns, and extra banks etc on my bornholm server but can't seem to get this to fire off!...got to run to work but will be back in a couple of hours. maybe I've not followed the what seemed very simple instructions properly or maybe I'm missing a trick:)
     
  4. keith fitzgerald

    keith fitzgerald Moderator Staff Member

    Joined:
    Aug 5, 2013
    Messages:
    26
    Likes Received:
    4
    Bike vanishes on spawn - server clean up - need work around or spawn from the server
     
    FallingSheep likes this.
  5. FallingSheep

    FallingSheep OpenDayZ Lord!

    Joined:
    Mar 17, 2013
    Messages:
    1,980
    Likes Received:
    576
    thats excatly the feedback ineeded, ill see if i can move it to be server side spawn! thanks!
     
  6. moosemilker

    moosemilker Member

    Joined:
    Apr 16, 2013
    Messages:
    31
    Likes Received:
    1
    Were you able to move it to the server side?
     
  7. FallingSheep

    FallingSheep OpenDayZ Lord!

    Joined:
    Mar 17, 2013
    Messages:
    1,980
    Likes Received:
    576
    im updating to 0.3 epoch, ill get the new serverside version out soon
     
    moosemilker likes this.
  8. keith fitzgerald

    keith fitzgerald Moderator Staff Member

    Joined:
    Aug 5, 2013
    Messages:
    26
    Likes Received:
    4
    serverside :
    Code:
    if(isServer) then {
        "SPAZ" addPublicVariableEventHandler {_this select 1 call Spawn_Ebike};
    
        Spawn_Ebike = {   
    
            private["_spawnPos","_spawnDir","_veh","_goat"];
    
            _spawnPos = _this select 1;
            _spawnDir = _this select 2;
            _veh = createVehicle["Ebike_Epoch", _spawnPos, [], 0, "NO_COLLIDE"];
            _veh allowDamage false;
            _veh setPos _spawnPos;
            _veh setDir _spawnDir;
            _veh setVectorUp (surfaceNormal (getPos _veh));
            _veh call EPOCH_server_setVToken;
            _veh call EPOCH_server_vehicleInit;
            _veh setVelocity [0,0,.1];
            _veh allowDamage true;
           
        };
    };
    clientside :
    Code:
    if (EPOCH_playerCrypto > 50) then {
        titleText ["", "PLAIN DOWN"];
        player playActionNow "Medic";
        _spawnPos = player modelToWorld [0,2,0];
        _spawnDir = (getDir player) -90;
        SPAZ = [player, _spawnPos, _spawnDir];
        EPOCH_playerCrypto = EPOCH_playerCrypto - 50 ;
        sleep 3;
        publicVariableServer "SPAZ";
        sleep 1;
        ['You bought a bike for 50 crypto. Gone at restart!',0,0.7,2,0] spawn bis_fnc_dynamictext;
        player removeAction spazbike;
    } else{
        ['You need 50 crypto.',0,0.7,2,0] spawn bis_fnc_dynamictext;
    };
     
    FallingSheep likes this.
  9. moosemilker

    moosemilker Member

    Joined:
    Apr 16, 2013
    Messages:
    31
    Likes Received:
    1
    When you say server-side, does that go in the init.sqf is dedicated if block of the mission file?
     
  10. keith fitzgerald

    keith fitzgerald Moderator Staff Member

    Joined:
    Aug 5, 2013
    Messages:
    26
    Likes Received:
    4
    place the .pbo in your @epochhive\addons folder.

    in your int.sqf use :

    Code:
    waitUntil{!isNull (uiNameSpace getVariable ["EPOCH_loadingScreen", displayNull])};
    waitUntil{isNull (uiNameSpace getVariable "EPOCH_loadingScreen")};
    sleep 5;
    Deployaction = player addaction [("<t color=""#00CF11"">" + ("Craft Bike") +"</t>"),"scripts\bike.sqf","",-97,false,false,"",""];
    
    bike.sqf

    Code:
    if (EPOCH_playerCrypto > 50) then {
        titleText ["", "PLAIN DOWN"];
        player playActionNow "Medic";
        _spawnPos = player modelToWorld [0,2,0];
        _spawnDir = (getDir player) -90;
        SPAZ = [player, _spawnPos, _spawnDir];
        EPOCH_playerCrypto = EPOCH_playerCrypto - 50 ;
        sleep 3;
        publicVariableServer "SPAZ";
        sleep 1;
        ['You bought a bike for 50 crypto. Gone at restart!',0,0.7,2,0] spawn bis_fnc_dynamictext;
        player removeAction spazbike;
    } else{
        ['You need 50 crypto.',0,0.7,2,0] spawn bis_fnc_dynamictext;
    };
     

    Attached Files:

    • ud.pbo
      File size:
      3.2 KB
      Views:
      10
    FallingSheep likes this.
  11. FallingSheep

    FallingSheep OpenDayZ Lord!

    Joined:
    Mar 17, 2013
    Messages:
    1,980
    Likes Received:
    576
    keith fitzgerald likes this.
  12. moosemilker

    moosemilker Member

    Joined:
    Apr 16, 2013
    Messages:
    31
    Likes Received:
    1
    Thanks guys. I will try it out soon.
     
  13. moosemilker

    moosemilker Member

    Joined:
    Apr 16, 2013
    Messages:
    31
    Likes Received:
    1
    Hey, fellas. It works, but it's a little quirky. If you have say 2500 krypto and quickly click the 'Craft Bike' action, it will spawn 1 bike per click as long as you have money.

    I'd say if the price was raised to 500 krypto and a fresh spawn had 500 at start, maybe that would be a decent implementation of this code the way it works.

    Thank you, Keith and FallingSheep. Great work!
     
  14. ReasontoRun

    ReasontoRun New Member

    Joined:
    Apr 28, 2015
    Messages:
    4
    Likes Received:
    0
    First of all thanks i really love this script. I am very new to scripting and don't really know how to code so please keep that in mind. Right now with this installed it works but if i die i have to log out and back in for me to get the craft bike menu. Has anyone else seen this thanks.
     
  15. Suppe

    Suppe New Member

    Joined:
    May 6, 2015
    Messages:
    3
    Likes Received:
    0
  16. Suppe

    Suppe New Member

    Joined:
    May 6, 2015
    Messages:
    3
    Likes Received:
    0
    If u are Horbin with a other name, then sorry.... if not: shame on you !
     
  17. ShootingBlanks

    ShootingBlanks OpenDayZ Guru!

    Joined:
    Mar 31, 2013
    Messages:
    2,422
    Likes Received:
    336
  18. Objectives

    Objectives New Member

    Joined:
    Aug 3, 2014
    Messages:
    6
    Likes Received:
    0
    It would be nice to have credit for the PBO. But whatever. I Created the Pbo with help from KIloSwiss on Epochmod.com
     
  19. ShootingBlanks

    ShootingBlanks OpenDayZ Guru!

    Joined:
    Mar 31, 2013
    Messages:
    2,422
    Likes Received:
    336
    You are correct, if its your work then credit is due.
    My incredulous comment was because the link that was given by Suppe doesn't have a working download link and he asks about a username Horbin who also did not make the linked to post (it was Leigham). And now you (Objectives) claim it to be yours ... So does it belong to Leigham, Horbin or Objectives? Do you see the problem here?
    Is Objectives = Leigham?
    And the correct thing to do by Suppe, would have been a PM to Falling Sheep with a polite request for credit rather than the accusational "Why you stealing someone elses work!!!!" which really rubs me the wrong way.

    I downloaded the PBO from epochmod.com link and from this post and they are identical except for the deploybike script (differences is shown at the bottom of this post). And nowhere does it say in those original files that anyone wrote the scripts .. I could easily claim them as mine. Obviously the version posted on Epochmod.com is the earlier version and the one in posted here is using that as its source.

    So let me just say that Fallingsheep and Keith Fitzgerald are both honest and reputable persons and I can assure you neither tried to intentionally claim anyone elses code as their own.
    The files in the ud.pbo were not edited to claim to be the work of either of them, therefore the accusation of 'Stealing other peoples work' is completely false.

    I would like to apologize on their behalf for any impression of wrongdoing as none was intended. I am sure they will also put the authors name at the top of the files for credit when that person is finally revealed.
    Searching google for ud.pbo on epochmod.com reveals this post
    http://epochmod.com/forum/index.php?/topic/32442-trying-to-make-an-addon-pbo/
    as the only other instance of ud.pbo .. which was also Leigham.

    So some clarification would be appreciated and we can get all the credit where credit is properly due.
    Thanks.


    [​IMG]
     
    Last edited: May 9, 2015
  20. ShootingBlanks

    ShootingBlanks OpenDayZ Guru!

    Joined:
    Mar 31, 2013
    Messages:
    2,422
    Likes Received:
    336
    Actually, let me amend my comment about the epochmod.com post being earlier.
    This is the first reference I found to ud.pbo
    [​IMG]

    and if you look at the top of this page, Falling sheep posted a pbo a day earlier on Feb 15th. apparently on april 9th Keith added the ud.pbo which is identical to the one from Epochmod. So ITS POSSIBLE that the original version was made by Falling Sheep, then edited by Leigham and posted on epochmod.com a day later and finally recovered by KeithFitzgerald ...
    How do we know what actually happened?
    And why not?
    Because nobody had sense enough to ever claim credit at the top of the file.

    although the common sense answer is they were simultaneous projects and the epochmod.com ud.pbo was better and discovered for use in this project 2 months later.

    OR WAS IT
    imagine ominous whodunit music was playing now
     
    FallingSheep likes this.

Share This Page