Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-20-2008, 04:05 AM
Programmer Programmer is offline
Coder
Programmer's Avatar
Join Date: Jan 2008
Location: -78.464422, 106.837328
Posts: 449
Programmer has a spectacular aura aboutProgrammer has a spectacular aura about
Send a message via AIM to Programmer Send a message via MSN to Programmer Send a message via Yahoo to Programmer
MediaNexus Function Pack 1

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!
Attached Files
File Type: txt functionpack.txt (7.6 KB, 489 views)
__________________
- Iᴀɴ Zɪᴍᴍᴇʀᴍᴀɴ
Reply With Quote
  #2  
Old 04-20-2008, 04:10 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Some of that stuff is kinda overkill, but nice work anyway!
__________________
Reply With Quote
  #3  
Old 04-20-2008, 08:36 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by cbkbud View Post
Some of that stuff is kinda overkill, but nice work anyway!
Hehe, thanks Chris

Recently started pack 2 as well
__________________
Reply With Quote
  #4  
Old 04-20-2008, 08:38 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Did you(or Chompy) figure out the tile/image conversions yourself?
Reply With Quote
  #5  
Old 04-20-2008, 09:04 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by DustyPorViva View Post
Did you(or Chompy) figure out the tile/image conversions yourself?
I couldn't figure out exactly what that did.
__________________
Reply With Quote
  #6  
Old 04-20-2008, 09:28 PM
Programmer Programmer is offline
Coder
Programmer's Avatar
Join Date: Jan 2008
Location: -78.464422, 106.837328
Posts: 449
Programmer has a spectacular aura aboutProgrammer has a spectacular aura about
Send a message via AIM to Programmer Send a message via MSN to Programmer Send a message via Yahoo to Programmer
Quote:
Originally Posted by cbkbud View Post
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.
__________________
- Iᴀɴ Zɪᴍᴍᴇʀᴍᴀɴ
Reply With Quote
  #7  
Old 04-20-2008, 09:42 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Oh, okay.
__________________
Reply With Quote
  #8  
Old 04-20-2008, 10:45 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Ve-y nice
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #9  
Old 04-21-2008, 05:52 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by DustyPorViva View Post
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 .
__________________
Do it with a DON!
Reply With Quote
  #10  
Old 04-21-2008, 09:07 AM
Dan Dan is offline
Daniel
Join Date: Oct 2007
Posts: 383
Dan is an unknown quantity at this point
Send a message via MSN to Dan
Nice stuff
__________________
Reply With Quote
  #11  
Old 05-13-2008, 09:13 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
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.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:53 PM.


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