Commit Graph

96 Commits

Author SHA1 Message Date
ebaydayz
f770b0a85d Add group system
Initial commit, not tested in multiplayer yet. Some revisions still left
to do.
2016-10-27 16:06:49 -04:00
ebaydayz
84d549d0a1 Revisions for #1777 (#1778)
* Update z_at_buyItems.sqf

* Update z_at_buyItems.sqf

* Update z_at_canAfford.sqf

* Update z_at_fillBuyableList.sqf

All of this is already checked in z_checkCloseVehicle at startup. If Z_VehicleChanges between the time the menu is started and the buyable list is filled it's not a big deal, since it only affects the highlighted color.

* Update server_handleSafeGear.sqf

* Update snappoints.hpp

* Update z_at_buyItems.sqf
2016-10-25 13:59:56 -04:00
oiad
bef2506653 Advanced trading fixes, server_handleSafeGear human readibility (#1777)
* Advanced trading fixes

Fixes a few issues and a dupe with advanced trading as well as some
localization of where a vehicle key is going.

Z_at_buyItems: Now adds localization for the key getting added to your
toolbelt, backpack and vehicle, this stops players thinking they didn't
get a key when infact it was added to their backpack/vehicle.

Z_at_canAfford.sqf: This fixes a dupe from a bad copy paste for whomever
wrote this script, it was using _backpackMoney in the
z_allowTakingMoneyFromVehicle part, changed to the proper variable
_vehicleMoney.

z_at_fillBuyableList.sqf: this fixes a bug where a vehicle would show
green even when it isn't local, just basically added more checking to
make sure the vehicle it's making green in the list is a) local, b)
alive and that the typeOf == _name.

z_at_logTrade.sqf: fixes some tidyness.

advancedTrading/init.sqf: adds a z_checkCloseVehicle call otherwise even
with Z_AllowTakingMoneyFromVehicle = true it will not get currency from
your vehicle until you clicked on the "Vehicle" tab.

dayz_server/server_tradeObject.sqf: More tidying as per the
z_at_logTrade and removes the useless Player:, as it is obvious a player
has bought something not an AI.

dayz_server/server_handleSafeGear.sqf: Makes the diag_log at the end
more human readable with GPS coordinates as well as the lock code for
the safe or the lockbox.

* advanced trading fixes. I hate you github

WHY U GET MISSED?? STUPID GITHUB.

* snappoints changes

Fixes the issue @SmokeyBR reported
https://github.com/EpochModTeam/DayZ-Epoch/issues/1766#issuecomment-253864795
Adds all floor types to snap list for all barriers so you can snap a
sandbag etc to a floor instead of manually lining it up
2016-10-25 13:10:48 -04:00
ebaydayz
869e95eb2c Fix wrong variable name in z_at_calcFreeSpace
I didn't catch this mistake before because _backpack was not in the private array, so it was still defined from the script that called this function. Thanks @oiad
2016-10-18 15:56:45 -04:00
ebaydayz
2109fdba03 Prevent sell from vehicle dupe
Prevents dupe described here:

https://epochmod.com/forum/topic/41891-resource-a-collection-of-anti-dupes/#comment-281324
2016-10-05 12:17:17 -04:00
ebaydayz
de219116a8 Optimize save after trade
See my comment on b806043

Veh_setFixServer only runs on the server, so the client does not need to
compile it.

The PVDZ_veh_Save PVEH is only added on the server, so it should never
be sent with regular publicVariable anymore.
2016-10-02 15:44:51 -04:00
ebaydayz
91f168011c Remove unused variable from #1770
_inventoryMoney was unused @oiad
2016-10-02 14:11:20 -04:00
oiad
9fd2f2270b Advance trading gem fixes/localizations (#1771)
* Advanced trading combine/return change

Fixes combining/returnChange to squash gems into usable currency so they
can properly be used in the economy
Stringtable fixes for duplicates

* Localization additions

More localizations
2016-10-02 13:06:31 -04:00
ebaydayz
15b05dc84b Fix return change free space check when buying into vehicle
This fixes incorrect return of "not enough space to accept change" when
purchasing large quantities of magazines into a vehicle.

Thanks @oiad for noticing this.
2016-09-27 19:09:54 -04:00
oiad
c02053176d Advanced trading bugfix, Snap building typo and snap point fixes
Fixes a bug with advanced trading green "you have this item" text in
buyables list, this was showing you had the item when you didn't.
Snap building typo
Snap building snap points for large cinder walls as reported by
@SmokeyBR
https://github.com/EpochModTeam/DayZ-Epoch/issues/1766#issuecomment-248021073
2016-09-24 18:53:02 +12:00
ebaydayz
cc03256475 Update purchased vehicle spawn location
If there was no helipad available findSafePos was called. If that failed
it spawned the vehicle in the debug zone.

Calling findSafePos is no longer necessary since we are now using
createVehicle "NONE".
2016-09-22 18:12:52 -04:00
oiad
fed89a0ed2 Advanced trading and safe GUI changes (#1762)
* Advanced trading and safe GUI changes

This adds displaying of item/backpack/weapon/vehicle descriptions
Moves Weapons display on vehicles to a modular type, so if the vehicle
has no weapons it wont display, same with Description

Fixes an issue with safes not sounding keyclicks, at present they are
only active if you have music turned on, since I don't play with music
on (and many others) you will never hear them and when you do, the DTMF
signals they use are really obnoxious.

Replaced the sound with the one from the lockboxes, it's still audible
but very reasonable.

* Advanced trading fixes

Rework for my previous commit @ebaydayz

* Localization additions

Missing from previous commit
2016-09-10 12:09:27 -04:00
ebaydayz
8f25cc70db Localize sell and buy only messages
PrimaryWeapon always returns "", never nil unless the player object
isNull (in which case this script would not be running).

Fixed cases where a nil variable would throw an error when checking the
next condition.
2016-09-09 13:53:20 -04:00
icomrade
ffef031863 Allow disabling of buying or selling
Set price of the item to -1 in the Cfg traders files to disallow buying
or selling
2016-09-03 14:26:43 -04:00
ebaydayz
a8e2ce07b5 Optimize some createVehicleLocal
https://community.bistudio.com/wiki/Code_Optimisation#createVehicle.28Local.29
2016-08-24 13:34:11 -04:00
ebaydayz
a323f453d2 Make minor change to fn_waitForObject.sqf 2016-08-23 17:49:53 -04:00
ebaydayz
10b006d4eb Improve readability of trade_any type lists 2016-08-23 11:57:09 -04:00
ebaydayz
38b2a551bd Fix fn_waitForObject handling multiple of same object type
Forgot to handle case where there is already one or more of that object
type in the area (safes, cars, etc.).
2016-08-22 20:14:11 -04:00
oiad
89a43cb2d8 Advanced trading fix
This fixes the issue that @ndavalos found:
https://github.com/EpochModTeam/DayZ-Epoch/issues/1712#issuecomment-241289082
2016-08-22 21:10:46 +12:00
ebaydayz
f3370cbc4b Give vehUpgraded a default value #1745
@oiad No need to check _vehtrade in this case it will always be true if
_vehUpgraded != ""
2016-08-19 14:17:13 -04:00
oiad
d987fb290c Advanced trading selling upgraded vehicles.
These changes allow the player to sell upgraded vehicles with them not
being added to the trader (as to not polute the lists). This basically
refers to an upgraded vehicle as a child of the base vehicle so it will
get the same sell price as the base vehicle.

This still follows the original trading convention, the vehicle base
needs to be in the trader category, i.e you cant sell an armored SUV at
stary vehicle trader.
2016-08-19 22:15:47 +12:00
ebaydayz
509c2b17d6 Fix typo from 5d372d3
5d372d3
2016-08-18 13:30:19 -04:00
ebaydayz
0394c61183 Match Adv Trade blue color for compatible highlight
Matches blue used in advancedTrading.hpp, slightly lighter and easier to
see on dark grey background. @oiad 42ebfb5
2016-08-18 13:27:00 -04:00
oiad
42ebfb54d7 Advanced trading buyable list changes
Further changes Advanced trading buyable list to show the item as blue
if it's compatible attachment wise and ammo wise.

This will get overwritten if the player has the item in their inventory
by staying green.

Also fixes a small bug I put into my last commit by not showing up for
boats/bikes etc.
2016-08-18 22:02:51 +12:00
oiad
fc2c03d0d3 Advanced trading change to buyables list
This changes Advanced trading to change the item color to green if it
matches with an item is in your inventory, in your weapon slots (main
slot and dayz_onBack) is the same backpack and is a vehicle you are
local to.

This brings it in line with default trader, except we're using local
here since that's all that matters.

Thanks to @ebaydayz for the suggestion.
2016-08-17 22:52:05 +12:00
ebaydayz
f04d581b4d Cleanup Adv Trade parseText formatting
Just added line breaks so it is easier to count the format order.
2016-08-16 17:07:33 -04:00
ebaydayz
e02f8ba8ff Use BIS_fnc_numberText for SC number displays again
Missed some @ndavalos
https://github.com/EpochModTeam/DayZ-Epoch/issues/1712#issuecomment-239647854
2016-08-16 16:44:56 -04:00
ebaydayz
3f3f1a32ed Use BIS_fnc_numberText for SC number displays
See:

https://github.com/EpochModTeam/DayZ-Epoch/issues/1712#issuecomment-239647854

That should be all of them @ndavalos let me know if I missed any.
2016-08-16 16:28:06 -04:00
ebaydayz
c62e3147c8 Do not send purchased vehicle marker arrow over network
Only the player buying the vehicle needs to see the arrow.

Also fixed CfgMagazines error from:
2c4c75c67c (diff-fcf3df9a25b3d05402ab4e4809673194R6)
@icomrade
2016-08-09 14:52:15 -04:00
ebaydayz
950ef04855 Properly separate allowed toolbelt and binocular count
It should no longer be possible to overflow your toolbelt or binocular
slots now.
2016-08-06 11:08:01 -04:00
ebaydayz
c51fd11511 Use better method to find player's vehicle in Advanced Trading #1725 2016-08-05 13:43:58 -04:00
ebaydayz
f6e10dd71c Add gear icons to trader menu vehicle cargo space display
- Added gear icons to vehicle cargo space display instead of
Weps/Mags/Bags text

- Decreased info text to 0.7 all around. Can be reverted to 0.8 if
preferred, but 0.7 or smaller is needed for vehicle info class, display
name and weapons list to avoid cutting off the dialog on normal and
larger interface sizes.

#1724
2016-08-04 20:36:36 -04:00
ebaydayz
60e6b85c4d Don't show fuelCapactiy for bicycles in Advanced Trading 2016-08-04 17:37:53 -04:00
ebaydayz
c52187220c Fix message when buying multiple backpacks into empty gear 2016-08-04 16:16:13 -04:00
ebaydayz
d91bde9e53 Fix return change overflow check
Thanks @oiad

- Added compensation for money which will be removed from gear and
backpack
- Improved readability
2016-08-04 14:22:33 -04:00
ebaydayz
5a55bcb9b0 Forbid buying >1 of any tool into gear
Previous duplicate check only checked player's current tools and the
buying array types for >1 of the same tool (not buying array amounts).

Also added prevention of binocular slot overflow.
2016-08-03 18:56:42 -04:00
ebaydayz
376befd613 Minor Advanced Trading string semantics changes
#1724
2016-08-03 13:38:09 -04:00
ebaydayz
382f3bc451 Add buying to and selling from dayz_onBack
Also:
- Fixed typo Z_fill(e)TradeTitle
- Fixed "not enough slots to accept change" message shows when "not
enough money" should show instead
2016-08-02 14:19:59 -04:00
ebaydayz
a95925aac5 Make free slots display for gear more logical
- Don't show tool slots as available weapon slots in gear. Player is
informed of tool slots count in systemChat.
- Don't show pistol mag slots as available item slots in gear. Player is
informed of pistol mag slots count in systemChat. Only pistol ammo and
bandages can be purchased into them.
- Removed "Stand still to complete trade" message since the medic
animation loop is no longer used
- Added back backpack mags count message and avoided redundant "Backpack
space exceeded message" @oiad
ee3eb845a3 (commitcomment-18483149)
2016-08-02 11:55:50 -04:00
ebaydayz
ee3eb845a3 Remove selling backpacks from vehicles
I don't think we should allow selling backpacks from vehicles because we
can not get backpack contents.

We can only remove all backpacks with clearBackpackCargo and then add
back new empty backpacks for ones that weren't sold.

This means players may unintentionally wipe all contents of all other
backpacks in their vehicle when they only want to sell one.

Thanks @AirwavesMan for catching this.

Also made changes discussed in #1718 @oiad
2016-08-01 17:14:42 -04:00
ebaydayz
a5be49c546 Add handling of magazine overflow in AdvTrade and free slot icons
- Added proper handling of pistol mags and regular mags in gear to
prevent magazine overflow
- Added pre-check if return change will overflow gear + backpack free
space. If change will not fit in gear + backpack free space then buy is
prevented with a message notifying the player. In the case of a sale it
proceeds anyway, but notifies player if overflow occurs (see comments in
returnChange)
- Consolidated duplicate code for calculating free space and returning
cargo of an object into new calcFreeSpace
- Old calculateFreeSpace renamed to displayFreeSpace
- Added Weps/Mags/Bags icons to free slot numbers display
2016-07-31 18:38:53 -04:00
ebaydayz
cc129cf403 Fix buyItems error from #1716 @oiad 2016-07-30 12:28:33 -04:00
oiad
7c4d25ef1a Advanced trading tidying, spelling fixes, private fixes and string fixes (#1716)
* Advanced trading tidying, spelling fixes, private fixes and string fixes.

Fixes snap building issue with metal floors
Fixed spelling mistakes in various scripts
Fixed formatting uglyness in various scripts
Fixed invalid private lines in various scripts
Changed Advanced trading so buying worked more like selling, You can't
select backpack if you don't have a pack nor can you select a vehicle if
you don't have a vehicle.
Removed some redundant strings from Advanced trading and changed a few
of the strings to be more englishy
Removed the ability to buy a backpack into your backpack (You cant do
this anyway)
Fixed a bug where if you had nothing in your backpack it would break the
checkArrayInConfig script so the titlebar would not refresh correctly
Removed slot counts on no backpack and no vehicle (No need for it, just
clutter)
Moved backpack/vehicle checking to z_at_getContainer.sqf

* Last part of tidyness fixes

Last part of tidyness fixes

* Actual backpack fix

Lets actually fix the buying backpack into backpack or backpack when you
already have one.

* Missing from commit

Missing from commit
2016-07-30 10:03:00 -04:00
ebaydayz
1d2fc3b266 Fix item count being overwritten in AdvTrade right list title
When switching back to category view the item count was overwritten
from:

12a9e9f83e

It is no longer needed to set it in changeBuySell since calcPrice runs
every time changeBuySell does. The one exception is when switching back
to category view, but in that case it stays in buy mode anyway.

You forgot to add it for single currency as well @oiad
2016-07-29 16:36:36 -04:00
ebaydayz
fd2eb14c5e Give inTraderCity a default value
There is no point in setting inTraderCity = "Any"; since you can use the
isInTraderCity variable to check if a player is in any trader city. Also
"Any" will return false for isNil, so the only time "Unknown Trader
City" was being used was when the player had not entered any city yet.
If they left a known trader and went to an unknown one the RPT message
would say "bought x at Any". Now it will correctly say "Unknown Trader"
anytime a purchase is made without inTraderCity being set.
2016-07-29 15:48:51 -04:00
ebaydayz
b1ae6c4a60 Fix unknown entity RPT error for Padlock and Frank&Beans
Vanilla development commit:

955c7a263c
2016-07-29 14:34:45 -04:00
ebaydayz
c9efb9e9df Fix some undefined variables in Adv Trade systemChat messages
Fixes "Cannot sell any, tires are too damaged." and empty string in
success message.
2016-07-29 11:41:44 -04:00
ebaydayz
b408e76c55 Fix extra spaces in Advanced Trading RPT log
Also fixed missing space in systemChat message.
2016-07-29 11:09:42 -04:00
ebaydayz
ba3677f13d Remove redundant "Gear" text next to portrait in Adv Trade
The menu already says "Buying in" or "Selling from" Gear in the top left
so having it again in the top right is redundant. It was my mistake
adding it there originally.
2016-07-29 10:22:13 -04:00
icomrade
bdf0870f3e Fix keys not deleting
Should work fine, but more validation is always good, I tested selling
from all inventories with DZE_SaleRequiresKey true and false.
2016-07-29 00:55:20 -04:00