Nieechi Posted June 3, 2014 Report Share Posted June 3, 2014 Awesome, thanks Gr8Boi The code I listed in my last post does that ("trying to add a medic animation and stop it so it doesn't take too long to trade") although its not very clean, it doesn't let you move and cancel until the 2 second timer is up and so from the middle of the trade till then end of that cycle you have to hold a direction in preparation for it, again, not sure why. I can imagine some panicky moments for first time users of the server when buying high value items in that scenario lol I think I might prefer the no animation option so I'll try that out but if you can get a clean, shorter animation to work that would be perfect :) Link to comment Share on other sites More sharing options...
Gr8 Posted June 3, 2014 Author Report Share Posted June 3, 2014 I am working on it, will let you know about the updates Link to comment Share on other sites More sharing options...
calamity Posted June 7, 2014 Report Share Posted June 7, 2014 thankz... Link to comment Share on other sites More sharing options...
Jokaru Posted June 8, 2014 Report Share Posted June 8, 2014 So, this is working or buggy like hell? Link to comment Share on other sites More sharing options...
axeman Posted June 8, 2014 Report Share Posted June 8, 2014 Some animations are hard to cancel, managed it somehow in this suicide script edit. Link to comment Share on other sites More sharing options...
Nieechi Posted June 8, 2014 Report Share Posted June 8, 2014 It is working, Gr8Boi's version, the one in the OP download link currently works with a timer but no animation i believe, timer set to 1.5 seconds (correct me if im wrong). The code i posted abovehas a shortened animation but is still buggy and i wouldn't recommend using it. Link to comment Share on other sites More sharing options...
sisquo007 Posted June 11, 2014 Report Share Posted June 11, 2014 Hey! It works like a charm but i found one issue! I have Traders which sell Tanks or some Items for Gems. in database i need to do "trade_any_vehicle_old" and "trade_any_items_old" now u cant buy or sell this items. Trader GUI closes instantly when u try to buy or sell. i think thats because u dont include thoose files. i try to add it manually into ur "trade" folder. i give feedback after next server restart :) Edit: I just addet the files (all with _old) behind ,from "dayz_code\actions" folder to the custom "trade" folder and it works. just with normal trader animation but thats ok because i think its enought to buy one tank in normal speed xD Link to comment Share on other sites More sharing options...
Gr8 Posted June 27, 2014 Author Report Share Posted June 27, 2014 This version will not work with the latest 1.0.5.x will update the files soon Link to comment Share on other sites More sharing options...
Gr8 Posted June 29, 2014 Author Report Share Posted June 29, 2014 Any body got this working on 1.0.5? Having trouble with it Link to comment Share on other sites More sharing options...
SmokeyBR Posted June 29, 2014 Report Share Posted June 29, 2014 it seems to be working fine for me, i saw your post saying its not working i just went and tested working good the folder "trade" is the same, just the "player_traderMenuHive.sqf" i got from the new version 1.0.5.1 and did the edit again its working unless i missed something,,, Link to comment Share on other sites More sharing options...
DeliciousAce Posted June 30, 2014 Report Share Posted June 30, 2014 Thanks for this Gr8Boi! Working fine but its not possible to abort the Trade by Moving. Link to comment Share on other sites More sharing options...
Gr8 Posted July 1, 2014 Author Report Share Posted July 1, 2014 Send me your trade_items.sqf Link to comment Share on other sites More sharing options...
Gr8 Posted July 1, 2014 Author Report Share Posted July 1, 2014 it seems to be working fine for me, i saw your post saying its not working i just went and tested working good the folder "trade" is the same, just the "player_traderMenuHive.sqf" i got from the new version 1.0.5.1 and did the edit again its working unless i missed something,,, Did you use the files from dayz_code or from the download link? Link to comment Share on other sites More sharing options...
Creep Posted July 5, 2014 Report Share Posted July 5, 2014 Currently working on the 1.0.5.1 version of this, lookin pretty well, last thing left is the item trades, doin some trouble Link to comment Share on other sites More sharing options...
Gr8 Posted July 5, 2014 Author Report Share Posted July 5, 2014 Yes, i am am also stuck on them. Its pretty hard to cancel this loop animation. Link to comment Share on other sites More sharing options...
Creep Posted July 5, 2014 Report Share Posted July 5, 2014 this isnt the problem for me right now :D stuck in an endless trading loop w/o getting items :D Link to comment Share on other sites More sharing options...
mudzereli Posted July 5, 2014 Report Share Posted July 5, 2014 to stop the medic animation, i just use this: player switchMove ""; player playActionNow "stop"; Link to comment Share on other sites More sharing options...
Creep Posted July 5, 2014 Report Share Posted July 5, 2014 I doing the items thingy w/o any animation, isnt needed anyways Link to comment Share on other sites More sharing options...
Gr8 Posted July 5, 2014 Author Report Share Posted July 5, 2014 to stop the medic animation, i just use this: player switchMove ""; player playActionNow "stop"; medic animation is easy to cancel like that. But Putdown is short and the animation starts and stops and the same time. Its just just a trigger to put player in a position. To cancel the trade. You will need to do an if statement on player move. But the animation itself moves the player. I am having trouble on how i can do something that stops trade when player moves more than 2 meters. Link to comment Share on other sites More sharing options...
Gr8 Posted July 5, 2014 Author Report Share Posted July 5, 2014 I doing the items thingy w/o any animation, isnt needed anyways Thats what is it in OP. item trading with sleep. and other tradings with animation. Link to comment Share on other sites More sharing options...
mudzereli Posted July 5, 2014 Report Share Posted July 5, 2014 I plug in the below code for all the trade files in place of the entire medic animation loop stuff -- it's a 1 second delay between trades that cancels if you move. Maybe this can help? //### BEGIN MODIFIED CODE: fast trading private["_newPosition","_finished","_oldPosition"]; _finished = false; _oldPosition = position player; sleep 1; _newPosition = position player; if (_oldPosition select 0 == _newPosition select 0 && _oldPosition select 1 == _newPosition select 1) then { _finished = true; }; if (!_finished) exitWith { _abort = true; cutText [(localize "str_epoch_player_106") , "PLAIN DOWN"]; }; //### END MODIFIED CODE: fast trading Link to comment Share on other sites More sharing options...
Gr8 Posted July 5, 2014 Author Report Share Posted July 5, 2014 It works, but 1 second is too fast for a player to cancel Link to comment Share on other sites More sharing options...
mudzereli Posted July 5, 2014 Report Share Posted July 5, 2014 I just tested this in my trade_items.sqf -- seems to work how you were looking for. You start the initial trade, then it just waits 2 seconds between trades. If you move more than 2 meters from the original position, then it cancels it. See //### lines where I modified code ... <<< TOP OF FILE ... //### BEGIN MODIFIED CODE: fast trading private["_oldPosition"]; _oldPosition = position player; //### END MODIFIED CODE: fast trading // perform number of total trades r_autoTrade = true; while {r_autoTrade} do { _removed = 0; // check if current magazine count is greater than 20 if ((count (magazines player)) > 20) exitWith { cutText [(localize "STR_DAYZ_CODE_2"), "PLAIN DOWN"]; r_autoTrade = false}; _canAfford = false; if(_bos == 1) then { //sell _qty = {_x == _part_in} count magazines player; if (_qty >= _qty_in) then { _canAfford = true; }; } else { //buy _trade_total = [[_part_in,_qty_in]] call epoch_itemCost; _total_currency = call epoch_totalCurrency; _return_change = _total_currency - _trade_total; if (_return_change >= 0) then { _canAfford = true; }; }; if(!_canAfford) exitWith { _qty = {_x == _part_in} count magazines player; _needed = _qty_in - _qty; cutText [format[(localize "str_epoch_player_184"),_needed,_textPartIn] , "PLAIN DOWN"]; r_autoTrade = false }; cutText [(localize "str_epoch_player_105"), "PLAIN DOWN"]; [1,1] call dayz_HungerThirst; //### BEGIN MODIFIED CODE: fast trading //player playActionNow "Medic"; //_dis=20; //_sfx = "repair"; //[player,_sfx,0,false,_dis] call dayz_zombieSpeak; //[player,_dis,true,(getPosATL player)] spawn player_alertZombies; private["_newPosition","_finished"]; _finished = false; sleep 2; if (player distance _oldPosition <= 2) then { _finished = true; }; if (!_finished) exitWith { r_autoTrade = false; cutText [(localize "str_epoch_player_106") , "PLAIN DOWN"]; }; //### END MODIFIED CODE: fast trading ... BOTTOM OF FILE >>> ... Link to comment Share on other sites More sharing options...
Gr8 Posted July 5, 2014 Author Report Share Posted July 5, 2014 if my test server decides to work. I would test it ASAP Link to comment Share on other sites More sharing options...
mudzereli Posted July 6, 2014 Report Share Posted July 6, 2014 btw I was able to test it and it worked pretty great. I ended up just replacing the section of each trade file from the start of the medic animation to the _finished check: (reason the _positionOld is defined like that is so that it can just be blocked in with the rest of the code for easy updating of the files between epoch updates.) //### BEGIN MODIFIED CODE: fast trading private["_newPosition","_finished","_oldPosition"]; if(isNil "_oldPosition") then { _oldPosition = position player;}; _finished = false; sleep 2; if (player distance _oldPosition <= 2) then { _finished = true; }; if (!_finished) exitWith { r_autoTrade = false; cutText [(localize "str_epoch_player_106") , "PLAIN DOWN"]; }; //### END MODIFIED CODE: fast trading see a full example trade_items.sqf file here on my github: https://github.com/mudzereli/DayZScripts/blob/master/overwrites/fast_trading/trade_items.sqf Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now