* server_updateObject force update for single currency
This modifies server_updateObject to force update/save to the hive if
the item being saved is in the DZE_MoneyStorageClasses array.
Previously if you force saved the object multiple times, the coins would
not get updated until the inventory changed, which if this was for a
bank object it would never update.
(This applies if you are using PVDZ_veh_Save to save the object)
* z_at_calcDefaultCurrencyNoImg prettyfication
This fixes a long standing issue in my brain about how this text was
always displayed, to me it seemed very untidy and just thrown together
(since I borrowed it from the IMG version)
Changes the output from this example: 7 Ruby 1 Amethyst 3 Gold 4 10oz
Silver 5 Silver
To this prettier and more logical example: 7 Ruby, 1 Amethyst, 3 Gold, 4
10oz Silver and 5 Silver
Make texts great again!
* z_at_logtrade fixes
Removes hard coded "Coins" text and replaces it with configVariables
version.
Also removes duplicate code and simplifies it.
* Merge z_calcDefaultCurrency and z_calcDefaultCurrencyNoImg
This merges these two files together since they are largely the same,
this also adds an optional argument to change the font size which is
useful for custom scripts that use this function.
Examples of use:
[_number,true] call z_calcCurrency; // Return a string of text with no
images
[_number,false] call z_calcCurrency; // Return a string of text with
images
[_number,false,0.7] call z_calcCurrency; // Return a string of text with
the currency in it and sets the font size to 0.7
This variable is not useful. If you change it you need to copy all the
AT files to your mission.
It is fewer files in the mission to just overwrite the path in compiles
and fn_selfActions.
Also fixed mistake with not replacing macros in scripts.txt with their
actual values.
* Advanced trading modifications, maintain_area modifications
This lot of changes brings forth the following:
Sets up a "default" set of compiles that are the minimum needed for
maintain_area.sqf and custom scripts to utilize the gem based currency
that @icomrade added.
maintain_area.sqf: This will now utilize the gem based currency system.
Removed the redundant Z_Vehicle and replaced it with the Epoch built in
DZE_myVehicle
z_at_buyItems: Code tidying and optimization
z_at_checkCloseVehicle: Tidied up the code since removing Z_Vehicle
allowed us to remove some now useless code.
z_at_getVehicleItems: Removed the nearestObjects check for your vehicle
since we now do z_checkCloseVehicle on Advanced trading start up.
* Advanced trading missed redundant variables
As per description
* Advanced trading rework
We don't need to check for close vehicle anymore now for backpack money
since we've made z_vehicle redundant.
* Revert "Advanced trading rework"
This reverts commit a589bd19b9.
* Advanced trading rework
We don't need to check for close vehicle anymore now for backpack money
since we've made z_vehicle redundant.
* Advanced trading rework
More rework
* Remove single currency add/remove coins functions
at request of @ebaydayz.
* 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
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.
There is no point in having two variables for the same purpose.
It is also pointless to keep an action count tally like r_action_count
was doing, since it is only ever checked for being 0 or 1. Any count
higher or lower than that is irrelevant.
I will make this change in vanilla too.
- 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
* 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
The buying list now acts like a shopping cart. It is no longer cleared
when switching between categories or containers. Closing the dialog or
switching to sell mode still clears it.
Also fixed:
- Filter button in sell mode
- Bug where filtering sellable list readded items already moved to
selling list
- Visual price display not clearing when remove all button is used on
buying list
- Gear container picture showing rank instead of portrait in buy mode
- Dialog is no longer closed when trying to sell zero items
- LbCurSel is now reset when the buyable list is cleared
- Category is no longer opened onLbSelChanged. Instead you need to
double click or use the "View" button, so the arrow keys can be used for
selecting too.
* Advanced trading fixes/modifcations
This adds combine currency option to the Advanced trading screen since
@Airwaves man noticed it didn't have a way of doing it.
Updated stringtables with correct "paid" spelling and differing text for
buying/selling.
This also addds proper currency checking/reporting for the log system
that has been introduced, it's untidy but it works, instead of getting
"user bought x for 1000 currency" in a non coins server, it will convert
it to the proper 1 brief 5 10oz gold etc system (uses a new function
z_calcDefaultCurrencyNoImg)
This also adds a check to see if the buy list is empty (as per the
selling list) and returns text to the user informing them.
Re-arranged buy and sell so buy is on top of sell, it's a bit easier to
read then.
* Advanced trading logging change
This was missing from my previous commit, this changes the
server_tradeobject to check if it's being passed a number (single
currency) or text (my logging currency changes)
* Advanced trading rework
Fixes all problems @ebaydayz