-
Content Count
64 -
Joined
-
Last visited
-
Medals
Posts posted by SicSemperTyrannis
-
-
make the last parameter true, as opposed to false.
-
Following this with interest ! Is it also possible to save the units CURRENT order?If it can be converted to a string, number or array it can be saved and loaded. I don't know if that answers your question.
-
Well, again, the engine would just send that data explicitly (although I guess you are trying to avoid that?) because I'm pretty sure addWeapon/addBackpack/addItem/etc works on the server.
If you're trying to avoid it purposefully, maybe it's better you add me to skype (will put in my profile in a moment).
-
I'm still not entirely understanding your need for it, if it's to store inventory only, the server has that information and you don't really need to specifically send your loadout from the client to the server.
The server has that data explicitly, meaning, it'd be there whether you specifically sent it or not.
That being the case, I could look into making a gzip extension, but it might not work well with the ini format.
-
Is is possible for implementing the string compression?Since I, myself, am not a native programmer, then it is quite hard for me to understand some codes.
Can you give me some advice for implementing the string-data compression (zlib, glib, lzw) to your codes?
Why would you need string compression if you don't mind my asking?
I can try to make a separate extension to meet your needs if I know what it is for.
EDIT:
@Bad Benson: No, it doesn't belong in the client init. If the server isn't running the code, it will not work. You have to execute the code on the server-side and I explain how to do that in this topic in detail.
-
I hope so, that was the plan I guess. I also hope there's some C/++ coders (or other languages) that can learn a bit about the plugin format and how to send/return data to/from the extension DLLs.
There's a lot more you can make. I plan on making a couple more extension modules myself.
-
In the player init (on the client) I do:
player setVariable["profileName", profileName, true]; //3rd var "true" reports it to the server
It's explained why I do that in the comments (if a player uses a different profile it will make a new db file), I guess I should have been more clear.
-
First, this is a great system, works very well, but I have 1 problem and hopefully someone can help me out with it.This makes no sense to me as to why this doesn't work, and is regarding weapons & magazines loading, everything else loads perfectly fine and has no issue.
First My Save variable
_Profile = format["%1", getPlayerUID player]; [_Profile, "playerData", "Weapons", weapons player] call iniDB_write; [_Profile, "playerData", "Ammo", magazines player] call iniDB_write;
Then my loading info which executes in the same file, same time, as all the other variables which load perfectly fine.
_Weps = [_Profile, "playerdata", "Weapons", "ARRAY"] call iniDB_read; _Mags = [_Profile, "playerdata", "Ammo", "ARRAY"] call iniDB_read;
And currently I have it as
player addWeapon _Weps;
I've tried (_Weps); , this addWeapon _Weps; , (_Weps); , I've literally tried everything I know, and it just will not give the weapons or mags, if anyone has gotten it to load the mags and weapons without issues... please share :(
Couple of things... first, you can't call iniDB_read on the client. Once again guys, the server. The server. The server.
Also as far as I'm aware, addWeapon does not accept arrays. Try using the script I mentioned early on to get/set loadout.
Not sure if it will help or not, depends what type of mission you have in my opinion. I run a Takistan Life, Island Life, and Wasteland, and they all save perfectly fine with just setting the options and things to save and executing the script in the init.sqf that executes per player, on a loop while the player is connected.Um, question. How would "player" be a valid variable on the server... ? I feel like a lot of you guys should read up on code locality in ARMA.
I'm not trying to make fun of any of you guys it's just... that has to be broken. If you're running it on a test server, it might save YOUR stats since isServer == true and player is valid on a local, non-dedicated server.
If you try running it with actual players i have a strong feeling it will break.
Protip: If iniDB_read/iniDB_write and "player" are used nearby one another, it's likely going to be broken.
-
It's stored in /@inidb/db/
The first parameter of the write/read function is the file name, just not the entire file name (since it's not needed and can cause exploits).
So,
_fileName = format["PlayerID_%1", getPlayerUID _unit];
Would be like:
/@inidb/db/PlayerID_123456.ini
-
There's no loops or anything that would cause yellow chain. There's nothing especially intensive about the code.
If there's problems, it's with the script. Perhaps you'd have better luck asking in script help topics.
-
It should work on ARMA2 just fine, the callExtension API is in ARMA2 as well.
-
;2346060']This is BIG NO NO!Fixed it, then.
-
what about a simple demo mission ?I said earlier that I'd post one eventually, but right now I simply do not have the time. I'm working on my own mode.
-
You're coding that completely incorrectly.
if(!isServer) exitWith {}; _unit = _this; _profile = format["%1", getPlayerUID _unit]; _position = [_profile, "playerdata", "position", "ARRAY"] call iniDB_read; _score = [_profile, "playerdata", "score", "NUMBER"] call iniDB_read; _unit setPos _position; _unit setScore _score;
Then in the init:
0=this execVM "playerinit.sqf";
What you're doing extremely wrong is you did not read up on the scripting language.
I know it's inconsistent, hard to understand and well... no apologies for the language itself, but you should learn the fundamentals before tackling something like this.
-
Make sure you're only executing the loading stuff if isServer is true, and if the server can't properly set the loadout (it really should be able to) then try setting a variable and transferring the data.
-
Then you want it to be in the player initPlayer.sqf (without the event handler)
-
give them a respawn event handler, I suppose.
In the editor, in the unit initialization do:
nil=[] execVM "initPlayer.sqf";
then in there, you add the handler:
_unit addEventHandler["Respawn", { //load stuff here I guess? }];
Or you could set a variable, etc. There's lots of ways.
-
yes, it's for wasteland. a mode traditionally enjoyed by them.What? It's not been designed for wasteland.
-
I'll try running it vanilla, my settings prior were:
-nosplash -noPause -world=empty -cpuCount=8 -exThreads=14 -maxmem=12288 -maxvram=2048 -mod=@FA_gpstr_watermark;@brf_nvg;@inidb;
---------- Post added at 02:52 ---------- Previous post was at 02:48 ----------
Alright, problem solved. You need to launch in the editor for it to work, the multiplayer editor will not work.
-
works like a champ.I get this when trying to move an object:
_posX = (GUI_idcActive_pos select 0) + _diffMouseX; _posY = (GUI_id> Error position: <select 0) + _diffMouseX; _posY = (GUI_id> Error Generic error in expression File A3\functions_f\gui\editor\GUI_fnc_ctrlMouseMoving.sqf, line 162 Error in expression <ys) then {
EDIT: Also, Escape and F1 thing doesn't work for me at all.
-
if(isServer) then { [] execVM "serverSaveData.sqf"; };
At the end of the init.sqf, I suppose.
-
If you want to automatically save and load, you don't need any code running on the client, probably.
serverSaveData.sqf:
while{true} do { { if(isPlayer _x) then { // Save their data here }; } forEach allUnits; };
Then in the player init (the character initialization) and respawn event handler, set their loadout.
-
That seems about right, DukeRevenger. You also shouldn't forget to set triggerSave to false on the server after you've written the data, or if it's in a loop it'll just save continuously.
---------- Post added at 22:39 ---------- Previous post was at 22:37 ----------
God.. i cant figure out how to get this running non-local, What does the init file need to make clients auto save and then that it just loads the array on spawnIt isn't designed to make "clients auto save", if you want to save data to the client there is functions like http://community.bistudio.com/wiki/saveVar which I believe allow you to save to the local computer.
iniDB should be used for things that require saving on the server-side specifically.
EDIT: However, I will probably make an example mission soon for a simple gear save since so many people have asked for one.
-
stra_gui.pbo is no longer functional, though. Unless it's been updated from the version i already had.
iniDB - Save and Load data to the server or your local computer without databases!
in ARMA 3 - ADDONS & MODS: COMPLETE
Posted
Haven't been here in a while, kind of impressed the topic didn't go to crap.