Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   MediaNexus Function Pack 1 (https://forums.graalonline.com/forums/showthread.php?t=79473)

Programmer 04-20-2008 04:05 AM

MediaNexus Function Pack 1
 
1 Attachment(s)
This is a small function pack me and Chompy scripted together. It has several functions:
  • Binary to Decimal conversions
  • Decimal to Binary conversions
  • Binary to Octal conversion
  • Base4 to Base10 conversions
  • Base10 to Base4 conversions
  • Hexadecimal to RGB Conversions
  • RGB to Hexadecimal Conversions
  • Hexadecimal Letter To Number Conversion
  • Arabic to Roman Numeral Conversions
  • Roman Numeral to Arabic Number Conversions
  • Quadratic Support
  • Fibonacci Support
  • Graal Tile Conversions

Installation:
Simply put this into a class and join it to any weapon or NPC you want by doing: this.join("classname");

The Code:
See the attachment.
Reason being, I get a bad request because the forums won't post anything with a percent sign ¬.¬


Enjoy!

cbk1994 04-20-2008 04:10 AM

Some of that stuff is kinda overkill, but nice work anyway!

Chompy 04-20-2008 08:36 PM

Quote:

Originally Posted by cbkbud (Post 1386878)
Some of that stuff is kinda overkill, but nice work anyway!

Hehe, thanks Chris :)

Recently started pack 2 as well ^^

DustyPorViva 04-20-2008 08:38 PM

Did you(or Chompy) figure out the tile/image conversions yourself?

cbk1994 04-20-2008 09:04 PM

Quote:

Originally Posted by DustyPorViva (Post 1386985)
Did you(or Chompy) figure out the tile/image conversions yourself?

I couldn't figure out exactly what that did.

Programmer 04-20-2008 09:28 PM

Quote:

Originally Posted by cbkbud (Post 1386989)
I couldn't figure out exactly what that did.

Open an NW file in Notepad, theres a bunch of 2-digit codes for each tile. Conversions take those digits and turns them into points on the tileset image.

cbk1994 04-20-2008 09:42 PM

Oh, okay.

Tigairius 04-20-2008 10:45 PM

Ve-y nice ;)

zokemon 04-21-2008 05:52 AM

Quote:

Originally Posted by DustyPorViva (Post 1386985)
Did you(or Chompy) figure out the tile/image conversions yourself?

I figured them out for my scripted level editor a few years ago in about 5 minutes :rolleyes:.

Dan 04-21-2008 09:07 AM

Nice stuff :)

Tigairius 05-13-2008 09:13 PM

Sorry for late post, but I was looking at your convertToHex function:
PHP Code:

HEX = {{10"A"}, {11"B"}, {12"C"}, {13"D"}, {14"E"}, {15"F"}};
function 
convertToHex(nr)
{
  for (
0HEX.size(); i++)
  {
    if (
HEX[i][0] == nr)
    {
      return 
HEX[i][1];
    }
  }
  
  return 
nr;


and I noticed you could just as easily have done this:
PHP Code:

function convertToHex(nr) {
  
temp.hextable "0123456789ABCDEF";
  return 
hextable.charat(nr 16);


Just for future reference, it's quite a lot more efficient to do it that way, I'd say.


All times are GMT +2. The time now is 10:36 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.