Intangibility(mob/M in world)
if(density=0)
density=1
world<<"[usr] has become tangible"
else
density=0
world<<"[usr] has become intangible"
Gmstuff.dm:11:error::missing expression
Please dont ignore just because it's me.
ID:145088
![]() Jun 16 2006, 3:14 pm
|
|
![]() Jun 16 2006, 3:18 pm
|
|
Please use the <.dm> and <./dm> tags (without the periods) please. That's why they're there.
|
I'm really starting to wonder if you did read the DM guide... course I didn't either lol. I taught myself DM, with help from the forum.
Anyway, whenever you have an if() statement, if something is supposed to equals something else, you always use ==. In other words: in an if() statement: == if not in an if() statement: = |
Popisfizzy wrote:
Please use the <.dm> and <./dm> tags (without the periods) please. That's why they're there. What do you mean? |
Those tags are used to show code in the format that Dream Maker shows them. It makes it easier for programmers to read.
mob/Login() That is easier to read than this: mob/Login() ..() world << "[src] logs in" |
He (or she, I don't know them) means when you post code, put the DM tags around it, like you would put the [img] tags around a link to show an image on another forum. That why in code problems, when you post a new topic, the DM tags are at the top and done for you.
|
if(!thing.density) means kinda the same thing as if(thing.density==0). I believe that if(!thing.density) checks if it is equal to or below zero. I never really put much thought into that though.
|
Sorcerb wrote:
But on mine, it says "code:" inside the part, so I did... :/ in other words, u use <dm> to show a code, and </dm>to return to normal message understand? |
Clarification on Exophus's post ([link])
Quote: if(!thing.density) means kinda the same thing as if(thing.density==0). I believe that if(!thing.density) checks if it is equal to or below zero. I never really put much thought into that though. Actually, if(!var) checks if the var (variable) is FALSE instead of TRUE, which if(var) looks for...Boolean variable checkers, per say... FALSE => 0, null, "", FALSE TRUE => Anything other than the values in FALSE, INCLUDING negatives if(!var)//looks if var is one of the FALSE values My entry about quick-Boolean methods <.< *spams that link ;x* - GhostAnime |
! = the not operator.
Not applies to a boolean function - !TRUE = FALSE, !FALSE=TRUE. !!A = A. There is no boolean data type in DM - but various things are considered 'true' or 'false'. That's the main reason for using ! - to capture instances where something is false, but not zero. These things are considered false: 0, "" (An empty string), null. Everything else is considered true - any other number, any other string, any reference to an extant object. ! returns either 1 or 0 as true or false. And, of course, if() takes a boolean argument - if it is considered true, it does whatever is inside the if(). <= checks if something is less then or equal to other number - say, zero. |