Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Community spirit - "Off Topic"

Should this become a permenant - sticky - feature of the PT Development section?


  • Total voters
    9
  • Poll closed .
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
lmao at the video.

Sorry to hear you have problems with my latest release. I don't use the normal character data files, so you'll probably have to create new characters. This is the price of such a small server. Guess I should have documented that huh? But nobody ever reads it anyway, so I CBA. XD
 
Custom Title Activated
Loyal Member
Joined
Jan 28, 2009
Messages
1,320
Reaction score
616
Worked on code too much today but item changer is nearly finished (increased to 359424 possible combinations (sic!)), one little piece is missing >=P

Lets say I have hex 1100150E (in some address) and I would like to convert it to text/string "1100150E"...how?


_______IN_TOPIC_______ ;)

saixQ - Community spirit - "Off Topic" - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
Haven't tested, usually have a UDF or string class available to perform this on, but from memory (going back to lessons over 10 years old) something like this should do the trick:-
Code:
int     val = 0x1100150E;
int     count;
char    nibble = 0;
char[8] str="";
for (count = 0; count < 8; count ++)
{
	nibble = val & 0x0000000F;
	nibble += 0x30;
	if (nibble > 39)
	{
		nibble += 8;
	};
	str[count] = nibble;
	val = val >> 4;
};
val[8] = 0;
// now the array str should be a string representation of int val.
// so printf(&str); should produce the string you are looking for.
Again, there are a few variations on this basic theme you can use. For example, a pointer to the array, branching the if to < 9 or else (only += for every iteration) etc.

If you turn it into a function, remember that val is destroyed during processing, so you may wish to pass by value, as opposed to by reference. :wink:
 
Last edited:
Custom Title Activated
Loyal Member
Joined
Jan 28, 2009
Messages
1,320
Reaction score
616
Not working for me, I still getting the same value from your code.

What I am trying to do:

mpc - Community spirit - "Off Topic" - RaGEZONE Forums


1100150E ---> "1100150E"
any other function to get that?
 
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
Yes, I understood the problem. I declared the char array in the wrong way, but my code does produce the correct result once that is fixed.
char[8] str=""; //Wrong :(:
char str[8]; //Right :):​

An alternative, if you have windows.h available, would be to use wsprintf() with the %X formatter.

See below for the two methods in one program:-
Code:
#include <windows.h>
#include <stdio.h>

void Int2Hex(char *ret, int val);

int main(void)
{
	int	val = 0x1100150E;
	char	buf[9];
	char	*str = &buf[0];

	wsprintf(str, "%X", val); // Generate string with User32.dll
	printf("%s\n", str);

	Int2Hex(str, val);        // Generate string with Int2Hex function
	printf("%s\n", str);
}

void Int2Hex(char *ret, int val)
{
	int	count;
	char	nibble = 0;
	char	str[8];
	for (count = 0; count < 8; count ++)
	{
		nibble = val & 0x0F;
		if (nibble > 9)
		{
			nibble += 0x41;
		}
		else
		{
			nibble += 0x31;
		};
		str[count] = nibble;
		val = val >> 4;
	};
	ret = &str[0];
}
Tested this time. :wink:

0x0000000F = 0x0F or even 0xF or 15 if you like.

I've used the variation to ensure 1 addition each iteration too.

Result:-
Code:
1100150E
1100150E
 
Last edited:
Custom Title Activated
Loyal Member
Joined
Jan 28, 2009
Messages
1,320
Reaction score
616
You love to eat parts of you code ;)
}
Yeah I noticed [] but I am glad you posted
wsprintf(str, "%X", val); // Generate string with User32.dll
for some reason I can take string that I am looking for from wsprintf buffer and other ways are not working, and it comes reversed :)

Once I get sober I will fully implement it into my code.
I understand that I can address you as creator of this function?

Thank you again. Great code as always.
I will probably post some update today with speed tests... (game.exe got fat >=P)


BTW... captcha on RZ going crazy? ;)
How do I type that? =P

mpc - Community spirit - "Off Topic" - RaGEZONE Forums
 
Last edited:
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
You love to eat parts of you code ;)
}
Sorry, MentaL was doing unscheduled maintenance (again) and the post kept timing out and double posting. :( I fixeded it nao! :thumbup:
for some reason I can take string that I am looking for from wsprintf buffer and other ways are not working, and it comes reversed :)
I could implement as x86 if that is any help?
I understand that I can address you as creator of this function?
IDK about that. It was written from memory, I looked up the array syntax fix , and I'm sure the design was something I was taught either at college or uni. But it's just stuck in my mind.

I've used the same basic algorithm in several languages. Usually when I've not wanted to include some big butt string library that will do it all for you. :eek:tt1:

Since wsprintf() is part of Windoze, and the chances that you are not going to link to User32.dll are pretty slim on Doze, it's probably as quick a method as any.

If you end up linking to something like mscvr71.dll just so you can use to do it, then that is excessive. (I would say the same for glibc BTW, I'm not bashing MS, just the size of a general C library for one tiny function is disproportionate)

--- EDIT ---
Glad RZ doesn't ask me to enter Captcha. At least, it's only done it once before, and I suspected tampering so backed out. XD
 
Last edited:
Custom Title Activated
Loyal Member
Joined
Jan 28, 2009
Messages
1,320
Reaction score
616
I could implement as x86 if that is any help?
Yes, please.
Right now most of items will crash my client and reason for that is that I am getting wrong numbers.

__EDIT__
NVM. Fixed and its fast too!
Right now I am too tired so will post video tomorrow.
Thank you again! wsprintf is doing the trick.
 
Last edited:
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
The place for this type of dance music is the chillout room of a 90's rave / nightclub. In that location it would have been so cool. (I can still smell the chillout room and feel it spinning like the lights from the main floor over my head.

If you are too young to remember:-
It smells like skunk, lollipops / alcopops and dry ice mixed in with sweat and either sawdust, concrete or mud. (depending on where the rave is held) Everyone is totally spaced out sat (or lay) on the floor. We have danced our tits off on the main floor spaced out on amphetamines and E's, breaking every physical limitation of our bodies and liberating our minds. We have no idea how many hours we've been performing the same repetition of moves, but it was great. Now we're here, either because the high is wearing off, our dealer gave us a bad trip or we've collapsed from dehydration and exhaustion. (taking a swig of water as part of the repetition your develop as the E's kick in is always a good idea, but it doesn't help when the bottle runs out... that's really confusing.
"It worked a moment ago... it's always worked before... hasn't it? I can't remember now. Did I just say that? Maybe this bottle is broken? Oh! New track! Awesome mix, GOOO DEEEEE JAAAAAAAY!"
Unfortunately this track is commercialised, plastic and revivalist. Oldskule is gone. That's what makes it Oldskule and not just rip-off. It should be remembered or remixed not revived. :eek:tt1:

Posted 2008, this is also getting dated. (slow and loosing it's contemporary relevance) But DJ Cotts is doing it pretty much the way it is still done for in this decade. (not two decades ago) XD The last couple of years, "Freeform" hardcore has really started coming into it's own, and is really separating the men from the boys among DJs. So if you're looking to find 100% "now" dance scene. Find a good freeform hardcore mix. They are quite rare, as they are usually "live" and never recorded... that's part of the freeform culture, it's a one-off unique experience that you should go and see, not listen to a recording of. You can look up producers like Kevin Energy or so. That's always good.

The other new form taking off it "gabber". It uses that distorted sound you, Sheen, like and I don't, so look it up if you like, I can't say much that's positive about it, except that it is popular, and is at least contemporary. :wink:

Also... if the artist is signed to a label, or you can buy the music anywhere other than a digital download or Burned CD from their home page, or collective page. (collectives are non-commercial music organisations to help DJs help themselves in terms of promotion, distribution and arranging live gigs) Then they are poopie. Don't bother with them. If they have ever been recorded in any chart... they are a waste of time.

The real Dance scene is, and has been, since the early 80's, all about non-commercialisation. (look up Acid House, they would even wear masks to hide their faces when performing)

It's about Open Source music "development". Developing music they way we hack and reverse engineer code. They reverse engineer sound. :wink: DJs produce and mix under handles, and try to avoid associating their own name with their work. They will never charge more than the cost of production and hosting. They will always take piracy and re-mix as a complement. :eek:tt1:

They are the Linux geeks of the music world, and any stuck up fool DJ who thinks they "own" their tunes, and can say what should be done with them (hello Deadmau5 :eek:tt1:) has already lost touch with their community, and the right to be considered a member of it IMHO. :wink:
Deadmau5 is a highly respected producer who refuses other DJs and producers permission to re-mix his tracks "digitally". He only believes in vynal, and promotes "analogue" production.
--- EDIT ---
I should give some adds to my favourite on-line resources for real contemporary music in this part of the world. and . Check them out.

My step-son regularly mixes for them both, and if you pop into the Krafty shoutbox or IRC channel when Midas is on, feel free to tell him bobsobol sent you his way.

I'm sure MentaL would love it if you could get him to send shout-outs for the RaGEZONE crew. :wink: If there are a couple of you tuned in and lovin' the choons I'm sure he'd be happy to do that.

I'll big-up our lad here too, so you can check out his awsome mixing and get a feel for what to expect from him on Krafty. Check out his old Demo mix. :thumbup1: (if you're not into the terminology, that's a rapid mix of some of the best bits of tracks that frequently get requested on your shows & gigs)
 
Last edited:
Skilled Illusionist
Joined
Apr 20, 2009
Messages
351
Reaction score
212
I don't understand this thread.
But I'll fork bomb it nonetheless.

Code:
:(){ :|:& };:
 
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
Yea... I'm starting to suspect that the Priston Tale Developers social group or PristonTale Developers social group would be more appropriate place for these posts... but I don't know how moderation and management for the social groups goes, or who may find them. (we have two... and nobody is really managing either)

Anyway... hows the Dance scene in France Gregoo? I've heard some decent Eurostyle and EuroSynth music... (which is where the UK underground gets thrown in) but finding out where it actually comes from is not easy once it's been put there.
 
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
LMAO. See DK knows what it's for. XD
Just PT RaGEZONERs being off-topic among themselves Gregoo.

Vormavs C questions could be better placed in f144 [Coders' Paradise], and all the rest of this would be "on topic" in f10 [The Outerworld], but sometimes it's nice to be in a smaller group of closer friends. :wink:
Where do the carrots come from? (even when you haven't eaten carrots in months)

--- EDIT ---

Oh yes... two days (ish) till the poll runs up and so far 75% in favour of sticky. :): Keeping an eye on it.
 
Last edited:
Skilled Illusionist
Joined
Apr 20, 2009
Messages
351
Reaction score
212
I have no clue I don't listen to that kind of music :)
 
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
I do. I love my cats very much and would do anything to protect and care for them. But that emotional outburst is extreme.

That video brought a tear to my eye, as I've been in a place not dis-similar to that young lady. However extreme the emotions are they are not that alien to me.

I am sure a psychologist would say
  • Emotionally disturbed (sadness and love)
  • Displaced emotion
  • Uncontrolled thought patterns
    leading to:-
  • Obsessive compulsion
She is clearly projecting some other emotional tragedy she doesn't know how to cope with onto cats. Due to the nature of the emotions cats invoke in humans, this is probably connected with fertility or infant mortality. Remember, it is not natural for a human female to reach the age of 16 childless, just as it is not natural for humans to regularly reach the age of 40. These things are artificial modifications to human nature and in such an artificial environment it shouldn't be unexpected that many of us will be traumatised. I hope she receives, or has received help.

I know my wife and I treat our cats like our children, and in a marriage which will always be childless this may well be a form of self-therapy we have adopted. We have even discussed this openly, and concluded that both we and our cats benefit from this arrangement. Recognising it for what it is is a good thing too. However much we baby our cats, we do remember that they aren't actually babies, they are cats.

A domestic cats cry mimics a human babies cry frighteningly well (according to EKG readings of a human brain when hearing each) and they have a similar body mass to a human baby. However, unlike a human infant, cat's actually don't like being cuddled.

So firstly, her seemingly generous desires are actually quite selfish, and secondly this is probably a strong indicator for what the true target of her displaced emotions is. If you replaced the word "cats", for "babies" in that video, and remember she is making the video in search of a "mate" you would probably see her in a completely different light, and possibly understand her distress much better.

I should consider myself lucky that I never posted a video of myself display such extreme and mixed up emotion. Though in all fairness, the emotions I lost control of where fear and aggression. ("the Dark Side, are they") I would probably have punched out any camera pointed at me when I was in that state. :lol:
 
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
Yes. It's funny how most of us can be broken down into Dog people and Cat people.

Dog owners can "baby" their dogs too. But I suspect that most pet dogs substitute a young school child rather than a baby. It's fast approaching teenage rebellion and constantly needs telling off and putting in it's place. Dogs need exercise and play, where cat's demand you never ignore them and give them food on a frequent basis. Cats also never sleep at night. (you see the similarity with human infants or differing ages?)

What really confuses me is those pygmy breeds of dog. You know the ones elderly women will carry around with them everywhere they go? Often smaller than the average cat. They are a very strange kind of pet to me. Neither one thing nor there other. XD

It's also interesting to find that we aren't the only species which will develop parenting instincts towards totally unrelated animals.



 
Moderator
Staff member
Moderator
Joined
Feb 22, 2008
Messages
2,404
Reaction score
723
I think cats just wants to take advantage of you, you know what I mean? :lol:

They are very independent - more than dogs. My neighbor have a lot of cats, and everytime I go to the "roof" (its not roof acctually, its more like this things with glass but my house isnt as fancy as this one ofcc :lol: ) I see them in the streets.. you know, I think you cant create a bond of friendship coz just like you said
Dogs need exercise and play, where cat's demand you never ignore them and give them food on a frequent basis.
whereas with dogs you need to play, need to show affection and you end up creating that friendship, and you gain the dog's loyalty..
I see many times in TV, episodes of dogs, just sitting in the street (mostly where they were abandoned, or they owner passed away) just waiting for him to return...

buuut, I cant change what you like xD I am just giving my point of view, I dont hate cats xD
 
Back
Top