• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Need help on importing System

Status
Not open for further replies.
Go to the Trigger Editor, create a New Trigger (that white sheet of paper button) and then go to Edit and scroll to "Convert to Custom Text". Now delete everything from the converted text and go to this jass system, select all the code and right click it, pressing "Copy". Go back to your deleted converted text and right click -> Paste. That's it.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
In the map there is a trigger called "Creation GUI" and "Preset Creation GUI" that show you how to use it. These parts are written in GUI (with a few lines of Custom Script) so what exactly are you having troubles with?

What are you trying to use this system for, anyway?

JASS:
function Color takes integer alpha, integer red, integer green, integer blue returns string
    // Colors are in hexadecimal (between 0 for dark and 255 for light
    // alpha of 0 means fully transparent
    return "|c" + I10TO16(alpha) + I10TO16(red) + I10TO16(green) + I10TO16(blue)
endfunction

This is in the script. Its funny though because "alpha" is not used on strings for some reason. You can also add this code if you want to be able to color a string, specifically, without the open-ended color-code.

JASS:
function ColorString takes integer R, integer G, integer B, string msg returns string
    // Alpha of 0 does not mean fully transparent. Silly wabbit.
    return "|CFF"+I10TO16(R)+I10TO16(G)+I10TO16(B)+msg+"|r"
endfunction
 
Level 5
Joined
Nov 13, 2007
Messages
99
Thanks Pharaoh and Berbanog for replying! I didn't try your way yet Pharaoh but I'll do it later. =] uhm Berbanog I'm using this trigger for my map and it needs like a grouping thingy like. My map's theme is the Triad/Mafia so I think the grouping trig will fit it a lot. Thanks! I don't know a lot of Jass so I don't know what does uhm Alpha or anything means :T
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Well alpha is the transparency of the text. In order to use these functions in GUI you need to use Custom Script, where you type "call FuncName( something, somethingElse, andSomethingElse )" where the "somethings" are variables of the type defined by the function.

In this case you have 4 integer variables, so you could type "call Color( 0, 0, 0, 0 )" and it would work, though it would return a black color tag.
 
Status
Not open for further replies.
Top