Jump to content
  • 0

format without the quotes


Sandbird

Question

It should be a simple command....but its been at pain in the @ss....

I am trying to convert this:

[336.253,"[6028.168945,1444.422974,0.370625]"]

to this:

[336.253,[6028.168945,1444.422974,0.370625]]

Here is the trick....

I cant call compile the string cause if i do is will 'cut' the decimal points to 2 points....and for obvious reasons i want to keep it as it is :/

Any ideas?

 I tried KRON_Strings to replace the string with nothing....same results....its like call compile.

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

@Namindu

I may be wrong but it looks like he is trying to increase floating point precision by storing floats as strings.

 

@Sandbird

So I had a go at this and my head is melting now. It would be a world easier if it was possible for you to store the string as an array of strings, e.g.

["1234.567","89098.7654","321234.56789"]

Link to comment
Share on other sites

  • 0

I see you are chatting on KillZoneKids site concerning the stuff Mikeeeyy has leveraged for his mod .

 

Cant read the chat from work though :) .

 

That is probably the best way to go with A2 and seems to take care ofthe worldspace position shift issues quite nicely.

Link to comment
Share on other sites

  • 0

 

Yup i did, even tried to convert the CBA functions to regular ones, since i dont want to run the extra @CBA param, since i've read it can cause problems with other mods.

I got stuck on a command PUSH  that it has....couldnt figure out what was that.

 

@Namindu

I may be wrong but it looks like he is trying to increase floating point precision by storing floats as strings.

 

@Sandbird

So I had a go at this and my head is melting now. It would be a world easier if it was possible for you to store the string as an array of strings, e.g.

["1234.567","89098.7654","321234.56789"]

 

I am already running a server with 6000 objects...All the sudden having coordinates with quotes is a problem :P

I mean, i already re-wrote the whole system_monitor, and most of the SQLs to fix the CharacterID cell length not been able to fit more than 11 characters....Reinventing the wheel for the wordspace coords is just wrong :P hahaha.

 

 

I see you are chatting on KillZoneKids site concerning the stuff Mikeeeyy has leveraged for his mod .

 

Cant read the chat from work though :) .

 

That is probably the best way to go with A2 and seems to take care ofthe worldspace position shift issues quite nicely.

 

Thats what i did....I tried to do Mikeeeyys post and even tried to tweak KK's code but every time, i am getting quotes around the result.

And i know KK is saying that i wouldnt get a truncated result by call compiling the string.....i still am though.

 

As an example:

spos = getPosASL player;
diag_log format[" >> getPosASL player : %1", spos];
str spos;
pos2str = spos call KK_fnc_positionToString;
diag_log format[" >> Converted getPosASL : %1", pos2str];
diag_log format[" >> Call Compiled: %1", call compile pos2str];

Gives:

" >> getPosASL player : [6038.43,1436.7,57.5287]"
" >> Converted getPosASL : [6038.430176,1436.699951,57.528652]"
" >> Call Compiled: [6038.43,1436.7,57.5287]"

See the last line ? I lost the extra decimal points.

And importing the converted getPosASL type into database, adds the extra quotes.

Link to comment
Share on other sites

  • 0

My test server is currently down (Adding a water cooling loop) but I can take a look once I get the hand of this acrylic tube bending :) .

 

For the new A3 mod I am working on I have gone with storing the worldspace as seperate integer columns in the DB so no conversion to store, just split and combine depending on direction (DB or A3).  You could do the same with A2Net but, as you say, how much of the wheel do you want to re-invent in order to get the A2 Epoch game to the state you want it....

 

WIll have a play if my server boots without blowing up before you find a solution.

Link to comment
Share on other sites

  • 0

why dont u use the precise basebuilding fix ?? it uses killzone kids method and works fine ...

 

cause it uses quotes in the wordspace cell and its pissing me off.

I got quotes for color painted vehicles, and if i use that as well, i'll get quotes on coordinates as well.

 

10.000 checks in my sqf files, if string, if array, if god knows what.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...