[Log in / Register]
| News | Chat | Pastebin | Donations | Tutorials | Rules | Forums | Starcraft II |
| Maps | Skins | Icons | Models | Spells | Tools | Jass | Packs |
(Keeps Hive Alive)
Go Back   The Hive Workshop > Warcraft III Resources > JASS Functions

JASS Functions Approved JASS functions will be located here.
Remember to submit your own resources to the submission forum.

Reply
 
LinkBack Thread Tools
Old 06-30-2009, 11:46 AM   #16 (permalink)
Registered User maskedpoptart
aspiring programmer
 
maskedpoptart's Avatar
 
Join Date: Aug 2006
Posts: 318
maskedpoptart is on a distinguished road (70)maskedpoptart is on a distinguished road (70)
Could one of the JASS moderators please give me some feedback on the new version and tell me if there is anything I can do to get this approved? I have time to fix things today and tomorrow, but I will be gone on a trip starting Thursday. I would like to be done with this library by then.

Thank you for your patience and understanding.
__________________
My JASS resourcesMy Spells
ListFire Wall
IsUnitDead
String functions
maskedpoptart is offline   Reply With Quote
Old 07-01-2009, 12:06 AM   #17 (permalink)
Registered User aznricepuff
OOP freak.
 
Join Date: Feb 2006
Posts: 751
aznricepuff is a jewel in the rough (181)aznricepuff is a jewel in the rough (181)
Former Staff Member: This user used to be on the Hive Workshop staff. 
function SBase2I takes string oldBaseString, integer oldBase returns integer
          local integer base10Num = 0
          local integer placeNum //number at current place
          local integer placeIndex = 0 //index of current place. 0 = one's place, etc.
          local integer i = StringLength(oldBaseString)-1
          loop
              exitwhen i < 0
              set placeNum = FindLastIndexFrom(HEX_CHARS, SubString(oldBaseString, i, i+1), oldBase-1)
              set base10Num = base10Num + placeNum*R2I(Pow(I2R(oldBase), I2R(placeIndex)))
              set placeIndex = placeIndex + 1
              set i = i - 1
          endloop
          return base10Num
     endfunction

You dont need those I2R() casts inside Pow().

And if you're not going to support negative numbers, make a note of it in the documentation.

And I don't like the function names S2Id and Id2S. Id seems too vague, could refer to a lot of things. Maybe S2RawCode/RawCode2S.
aznricepuff is offline   Reply With Quote
Old 07-01-2009, 02:13 AM   #18 (permalink)
Registered User maskedpoptart
aspiring programmer
 
maskedpoptart's Avatar
 
Join Date: Aug 2006
Posts: 318
maskedpoptart is on a distinguished road (70)maskedpoptart is on a distinguished road (70)
Fixed all of the above. I seem to have trouble coming up with good function names... :/

I have some questions about raw codes that I am wondering if anyone can answer. I have found out that they are four-digit, base 256 integers. However, I can only find 62 possible characters to put in each digit (namely 0-9, A-Z, a-z). Did I miss any? What about the other 194 numbers that could be represented in each digit? Why didn't blizzard make them base 64 integers?
__________________
My JASS resourcesMy Spells
ListFire Wall
IsUnitDead
String functions
maskedpoptart is offline   Reply With Quote
Old 07-01-2009, 02:43 AM   #19 (permalink)
Registered User aznricepuff
OOP freak.
 
Join Date: Feb 2006
Posts: 751
aznricepuff is a jewel in the rough (181)aznricepuff is a jewel in the rough (181)
Former Staff Member: This user used to be on the Hive Workshop staff. 
The raw codes are just integers. The single quotations ' ' are standard CS notation for a cast from characters to integer. In the case of JASS, the cast follows ascii standards. BUT, blizz for some reason decided to only allow these casts for sequences of a single character or four characters. Any other number, and every compiler I've ever used gives you a syntax error (though I'm curious to see if a map would still work if the compiler ignores this limitation and compiles the code anyway).

You can use any of the ascii characters when doing these casts in JASS, as long as you only use one or four characters:

call BJDebugMsg(I2S(')')) // displays 41
call BJDebugMsg(I2S('))))')) // displays 690563369
call BJDebugMsg(I2S('ff')) // syntax error!

You can also use non-alphanumeric characters in object raw codes, so you can have an ability with raw code '))))'.
aznricepuff is offline   Reply With Quote
Old 07-01-2009, 12:56 PM   #20 (permalink)
Registered User maskedpoptart
aspiring programmer
 
maskedpoptart's Avatar
 
Join Date: Aug 2006
Posts: 318
maskedpoptart is on a distinguished road (70)maskedpoptart is on a distinguished road (70)
Thanks for the explanation. The S2RawCode and RawCode2S functions now work with any sequence of standard ASCII chars from 32 to 126. While the functions should work for a sequence of any length, world editor will only let you input sequences of one or four characters.
Let me know if there's anything else I can do to get this approved.

Off Topic...

For some reason, TESH screws up with \" as an escape combination. It looks at the quote as a regular quote. Who do I contact about this?
__________________
My JASS resourcesMy Spells
ListFire Wall
IsUnitDead
String functions
maskedpoptart is offline   Reply With Quote
Old 07-01-2009, 03:19 PM   #21 (permalink)
Registered User Eleandor
Penguins, Bacon, Trees
 
Join Date: Aug 2005
Posts: 3,661
Eleandor is a glorious beacon of light (518)Eleandor is a glorious beacon of light (518)Eleandor is a glorious beacon of light (518)Eleandor is a glorious beacon of light (518)Eleandor is a glorious beacon of light (518)
Quote:
You can use any of the ascii characters when doing these casts in JASS, as long as you only use one or four characters:

Haven't tested it but are you sure it's limitted to 1 or four? I'd say 1 to 4...
__________________
Poop.
Eleandor is offline   Reply With Quote
Old 07-01-2009, 04:52 PM   #22 (permalink)
Registered User hvo-busterkomo
'Cos I had some sense
 
Join Date: Jun 2007
Posts: 1,267
hvo-busterkomo is a jewel in the rough (238)hvo-busterkomo is a jewel in the rough (238)hvo-busterkomo is a jewel in the rough (238)
Former Staff Member: This user used to be on the Hive Workshop staff. 
It's 1 or 4. Both 2 and 3 will produce compile errors.
hvo-busterkomo is offline   Reply With Quote
Old 07-14-2009, 02:57 AM   #23 (permalink)
Registered User maskedpoptart
aspiring programmer
 
maskedpoptart's Avatar
 
Join Date: Aug 2006
Posts: 318
maskedpoptart is on a distinguished road (70)maskedpoptart is on a distinguished road (70)
Hey guys, I am back from my trip. aznricepuff, I have done everything you asked since initial release. At the moment, I am not aware of any reason this resource should not be approved. It is quite useful and has no bugs that I am aware of. I would appreciate it if you could either approve it, tell me what I can do to get it approved, or tell me why it should not be approved. Thanks again.
__________________
My JASS resourcesMy Spells
ListFire Wall
IsUnitDead
String functions
maskedpoptart is offline   Reply With Quote
Old 07-15-2009, 12:36 AM   #24 (permalink)
Registered User aznricepuff
OOP freak.
 
Join Date: Feb 2006
Posts: 751
aznricepuff is a jewel in the rough (181)aznricepuff is a jewel in the rough (181)
Former Staff Member: This user used to be on the Hive Workshop staff. 
Yea, sorry about the delay. I've been busy with other things (non-wc or HW related) lately.

Approved.
aznricepuff is offline   Reply With Quote
Old 07-15-2009, 01:29 AM   #25 (permalink)
Registered User maskedpoptart
aspiring programmer
 
maskedpoptart's Avatar
 
Join Date: Aug 2006
Posts: 318
maskedpoptart is on a distinguished road (70)maskedpoptart is on a distinguished road (70)
Thank you mr. rice puff . I want to eat you up (jk).

P.S. I completely understand. Don't worry about the delay.
__________________
My JASS resourcesMy Spells
ListFire Wall
IsUnitDead
String functions
maskedpoptart is offline   Reply With Quote
Old 01-30-2010, 10:17 PM   #26 (permalink)
Registered User Element of Water
He has beautiful eyes...
 
Element of Water's Avatar
 
Join Date: Aug 2008
Posts: 2,062
Element of Water is just really nice (284)Element of Water is just really nice (284)Element of Water is just really nice (284)Element of Water is just really nice (284)Element of Water is just really nice (284)
Please submit this on Wc3c so I can use it in my submissions there :D
Element of Water is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Trigger] String inside a string PaperJack Triggers & Scripts 3 06-16-2009 05:13 PM
[Unsolved] String! Drakosa123 World Editor Help Zone 5 03-04-2009 08:29 AM
[JASS] Jass error:"String literal size limit exceeded /unclosed string" Titanhex Triggers & Scripts 4 10-15-2008 07:04 PM
[JASS] Global Functions (Reusable Functions) Tigershark Triggers & Scripts 6 05-25-2008 03:37 AM
[Trigger] String Coloring blah900 Triggers & Scripts 1 10-27-2007 12:55 AM

All times are GMT. The time now is 01:57 PM.






Hosting by SliceHost 
Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.1
Copyright©Ralle