2015-07-01 17:50:56

hi all.
I was wondering if we could share a few functions in our code, either voluntarily or somebody asks and somebody else says here's a function.
I didn't want to create a new thread for every function I wanted, or the same for others, so I put this up.
The function I'm looking for, I'm pretty sure cae will be able to answer this one.
I need a hex_to_decimal function.
I, of course, can not use hex_to_string because it returns binary strings, not decimal digits.
Say, e do this.
string thing=number_to_hex_string(1372); //returns 55C.
//I did that calculation before, I don't actually know hexadecimal.
now, I can't exactly do this one.
string thing2=hex_to_string(thing);
i wanted 1372, and I don't get that. Does anybody have like an include or something that will convert hexadecimal to decimal? Prefferably returning a double. And if you make this, keep the following things in mine.
One: Hexadecimal doesn't support subdigits, i.e, 3.14, would come out as 0x03.
Two: I do not believe hexadecimal supports negative numbers.
Or maybe these are bgt limitations.
So, can anybody give me one of those? Also, any functions you need just post here and somebody should return you one!

----------
An anomaly in the matrix. An error in existence. A being who cannot get inside the goddamn box! A.K.A. Me.

2015-07-01 19:02:17

Hello,
That feature is already built in to the engine. I talked Philip in to adding it a couple years ago. It's called hex_string_to_number(int) but it might not be in the documentation.

Official server host for vgstorm.com and developer of the Manamon 2 netplay server.
PSA: sending unsolicited PMs or emails to people you don't know asking them to buy you stuff is disrespectful. You'll just be ignored, so don't waste your time.

2015-07-01 19:05:48

Hi,
I don't have the function you wanted Colton, but I do have some misc stuff I can put here:
First is a set of speech functions. All that's there is a function to autodetect a screen reader and a speak function which has 2 peramitors, the text you want the voice to speak and weather it will interrupt by default this is true.
The speak function uses the function to autoselect a screen reader.
https://dl.dropboxusercontent.com/u/24767067/speech.bgt
Second, is a little class I created called parsed data. Basicly this flass can parse a file or string containing such text as, for example:
name=person
age=21
Or something like that. The constructer takes 3 peramitors. A string of data, a string that is the encryption key, and a Boolean which states weather the name is a filename or actual data. Please note the encryption key is used with string decrypt, not file_decrypt.
https://dl.dropboxusercontent.com/u/247 … d_data.bgt

2015-07-01 21:09:30

heeheehee, I wonder what other functions philip forgot to mension lol.

I am a web designer, and a game developer. If you wish see me at http://www.samtupy.com

2015-07-01 22:38:59

Well, I know he forgot to mension this thing:
condission ? true : false
Basicly, the condission part is something you'd put in a regular if statement, like gender==1 or something, and then there's a question mark, followed by the thing to do if that condission is true, example "male", and then a colan followed by the thing to do if it's false, for example "female". So you could do something like

"The player "+player.name+" is a "+player.gender==1 ? "male" : "female"

2015-07-02 05:14:20

Well, as for undocumented features of angelscript, there's also class casting:

@a=cast<b>(c);

Where c is an instance of a parent class of b. Results in null if c is not an instance of b.

I don't think sound_is_playing in the sound_pool was documented. I think it's supposed to be used internally, so you should use sound_is_active instead... except I think this was before the persistent parameter was added, so sound_is_playing is actually useful.

看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.

2015-07-02 08:01:48

sound_is_playing is in the documentation. And I never knew this, fuck. Wasn't there a key code to string function or something?

----------
An anomaly in the matrix. An error in existence. A being who cannot get inside the goddamn box! A.K.A. Me.

2015-07-15 00:48:19

Private works on bgt too. Can be usefull on some things.