• 🏆 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!

Trying to learn Jass can u answer my questions?

Status
Not open for further replies.
Level 5
Joined
Oct 11, 2009
Messages
125
OK I have some questions from reading Jass turorials I was wondering if you could answer.

How do i find out unit ID?
What is defenition of real?
What is Boolean?
How can I practice JASS if I really don't know what I'm doing?

Im gonna update this every time I have a new question answering them might make learning Jass easier.
 
Level 3
Joined
May 24, 2008
Messages
53
well a real is just like an integer but reals uses decimal values..
5 = integer
4.512 = real

(QUOTE =Introduction to JASS (By Vexorian(WC3C.net)) )
Booleans are either true or false values.
There are functions that return boolean values, and there are also comparissions that return boolean values.
(END-QUOTE)
 
Level 5
Joined
Jul 8, 2007
Messages
146
Unit Rawcode ID is the code in the object editor when in raw code view mode. I believe the command is ctrl + D but not sure. It should show you something like A001 I think.

If I'm not mistaken a real is any number in a continuum, unlike an integer, it includes decimals.
integer = 1, 2, 3, 4..
real = .001, .0001, .00001, so on indefinitely

Boolean is a comparison which returns true or false.

Now, I'm not at all good at JASS but I know these concepts relatively well so hope that helps. As far as learning JASS goes, you probably want to use the search tool and look at some of the basic - advanced guides the more experienced users and contributors have already posted.

Good luck!
 
Level 5
Joined
Oct 11, 2009
Messages
125
Unit Rawcode ID is the code in the object editor when in raw code view mode. I believe the command is ctrl + D but not sure. It should show you something like A001 I think.

i ment how do i find this "gg_unit_hfoo_0000" i created a footman than made a trigger to kill it and that is what i got as the footman how do i find that without creating a trigger for it first?
 
Level 5
Joined
Oct 11, 2009
Messages
125
what would the jass be to just create a footman only for player red all i got so far is
function createfooty takes nothing returns boolean
return Player(1) is true than???
 
Level 5
Joined
Oct 11, 2009
Messages
125
im allready using jasscraft and thats what my next question is,

can someone plz tell me what the color coding is I see White,Red,Blue,Light Green,Orange,Light Orange what do they all stand for?
 
Level 5
Joined
Jul 8, 2007
Messages
146
personally, I think it would be better to have a basic to sumwhat advanced understanding of triggering and GUI before trying to learn JASS from the ground up, but up to you. :) good luck! I don't really know JASS so I can't help..
 
Level 9
Joined
Nov 28, 2008
Messages
704
personally, I think it would be better to have a basic to sumwhat advanced understanding of triggering and GUI before trying to learn JASS from the ground up, but up to you. :) good luck! I don't really know JASS so I can't help..

This. Look through GUI actions first for everything you can do, then edit -> convert to custom text.

Best way to learn what you're doing.

can someone plz tell me what the color coding is I see White,Red,Blue,Light Green,Orange,Light Orange what do they all stand for?

Color coding is the art of coloring text in a wc3 style.

You can make a message pop up on the screen that's white by simply calling the function DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "Message goes here!!"). That will display Message goes here!! on the screen in white.

If you however wanted it in red, you have to learn color codes.

The basic syntax for a color code is |cff + a hex code (RRGGBB) representing what color you want.

Hex codes are based on 0-255, or 0-FF in this case. If you want pure red, you want max red (FF) and 0 of the other two (G and B) you would do:

|cffff0000

The "ff" in |cff is supposed to represent how transparent the text is, but that doesn't work because WC3 developers are silly. BUt you HAVE to add it no matter what, and it doesnt matter if you do |cff or |c00, but people do tend to use |cff more often, as far as I can tell. ANd if Warcraft 3 in a new patch did start letting you use transparent text, any map using |c00 would suddenly break.

TL;DR? Use |cff. Not |c00.

Anyways, in our previous example, we want that message displayed in red.

Our new function to call is:

JASS:
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffff0000Message goes here!!")

This now shows Message goes here! in red.

Now, say you want to display two different colors. It is the exact same syntax, except you need to add |r between the two colors.

Say we want red (FF 00 00) and green (00 FF 00). We would use the following syntax:

|cffff0000 some text in red|r |cff00ff00some text in green|r

You should usually add an |r after ANY colored text you do, but it isnt strictly required (and if you dont use it, you can almost hack the warcraft 3 UI in some parts).

TL;DR? Add |r after every color code, even if it's single. Unless you want to do something with the game interface.

So, in our previous example:

JASS:
DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffff0000Message goes |r|cff00ff00here!!|r")

This makes everything red up to "here!!", which is turned green.

One final bit on hex codes:

000000 is black.

FFFFFF is white.

Codes are in RR GG BB.

FF0000 is red.
00FF00 is green.
0000FF is blue.

555555 is grayish.

You can use a color hex maker if you want, but it's good to know anyways.

One final note: capitalisation doesnt really matter in color codes. |CFFFFFFFF is just as valid as |cffffffff. At least for the hex code part, capitalisation does not matter.

In case I forgot to mention, hex codes go up to 15 for one digit, like our numbering system goes up to 9.

The order is: 0 1 2 3 4 5 6 7 8 9 A B C D E F.
 
Status
Not open for further replies.
Top