Goal Compass

Servers with lots of content would like to talk to you. Graal The Adventure from 2004 is a good example of horrible code everywhere with no real concept behind interactions between scripts. Mostly everything has bad formatting, bad code, and is horribly inefficient as well.

Even with the same programmer thourgh the project… I’m trying framework ideas on my server and nothing’s really coherent from a minigame to another.

I guess my point is that perfection shouldn’t get in the way of progress.

That’s very true. It’s difficult to find that balance. Too many people take the low end of that balance where their code is shit, though.

One thing Ive learned is that it’s OK to be a shitty coder as long as you work for a company that forces you to do proper QA and testing.

:rolleyes: Awesome mentality!

Helps if you don’t write shitty code and waste people’s time though. At least… that’s how you keep your job.

eye twitches I’m about to murder you for saying that’s more efficient. You also forgot to remove all line breaks, spaces and to make variables one character long. There also exists gr.x for player coords to make your script even shorter. But why… I’m not convinced this is a joke.

^^^^^^^

Rofl… while we’re at it, let’s also note that the first use of “this.” on a variable denotes it as local for the rest of the script. Re-use is pointless, but nobody ever seems to learn this!

it’s your own time that gets wasted if it doesnt pass test cases. i generally dont care how the other devs get their stuff done as long as it works as expected.

Hmmm seems like my 5 seconds in notepad to shrink it by a negligible amount was worth it for this hilarious reaction.

you guys actually succ dick at writing code
i fixed this ez
if (playerenters) {
showstats 1791;
timeout = .05;}

So pretty.

I had no idea… anyway I<d rather have it stated everywhere, so I remember which variables are local and which are not.

Maybe I’ll keep up with the client progress and we won’t have to deal with shitty Graal scripting. Then you have no dumb prefixes to deal with.

What kind of language are you even implementing? a GS1 clone?

Fuck no. The documentation is attached here: https://graal.in/forum/general/general-talk/7358-client-progres

:shrug:Lol, not sure how I missed that :shrug:
cheers

I made a thread about this before.

I was bored so I added a depth effect to this.


Came out kind of neat.

if (playerenters){
  showstats 1791;

  this.compassX = 100;//central location for compass placement
  this.compassY = screenheight - 100;//""
  this.radius = 16;
  this.needleWidth = this.radius / 4;
  this.depth = 4;

  showimg 300,compass_hud.png,this.compassX - 24,this.compassY - 24 + this.depth;
  changeimgvis 300,4;

  timeout = 0.05;
}

if ( timeout ) {
  this.playerC = {playerx,playery};
  this.targetC = {30,12};

  //work out the angle between the target and the player
  this.angle = getangle(this.targetC[1] - this.playerC[1],this.playerC[0] - this.targetC[0]);

  //calculate points of interest
  this.pois = {
    this.compassX + sin(this.angle) * this.radius, this.compassY + cos(this.angle) * this.radius,//needle head(north)
    this.compassX - sin(this.angle) * this.radius, this.compassY - cos(this.angle) * this.radius,//needle head(south)
    this.compassX + sin(this.angle + 90) * this.needleWidth, this.compassY + cos(this.angle + 90) * this.needleWidth,//needle side(1)
    this.compassX + sin(this.angle - 90) * this.needleWidth, this.compassY + cos(this.angle - 90) * this.needleWidth,//needle side(2)
  };

  //north triangle
  showpoly 301, { this.pois[0],this.pois[1],this.pois[4],this.pois[5],this.pois[6],this.pois[7] };
  changeimgcolors 301,1,0,0,1;//red
  changeimgvis 301,6;

  //south triangle
  showpoly 302, { this.pois[2],this.pois[3],this.pois[4],this.pois[5],this.pois[6],this.pois[7] };
  changeimgcolors 302,0.5,0.5,0.5,1;//grey
  changeimgvis 302,6;

  //determine the bottom side index of the triangle to use for depth
  this.maxIndex = ( this.pois[5] > this.pois[7]) ? 4 : 6;

  //north triangle 3d effect
  showpoly 303, { this.pois[0],this.pois[1] + this.depth, this.pois[this.maxIndex ],this.pois[this.maxIndex + 1] + this.depth, this.pois[this.maxIndex ],this.pois[this.maxIndex + 1], this.pois[0],this.pois[1] };
  changeimgcolors 303,0.7,0,0,1;//dark red
  changeimgvis 303,5;

  //south triangle 3d effect
  showpoly 304, { this.pois[2],this.pois[3] + this.depth, this.pois[this.maxIndex ],this.pois[this.maxIndex + 1] + this.depth, this.pois[this.maxIndex ],this.pois[this.maxIndex + 1], this.pois[2],this.pois[3] };
  changeimgcolors 304,0.2,0.2,0.2,1;//dark gray
  changeimgvis 304,5;

  timeout = 0.05;
}

I didn’t want to spend too much time on this but if I were to spend more I’d probably split out the compass background from the front or add additional math to counter for the overlap when the compass is pointing south.