Blockland Forums > Modification Help

kid has even more questions about TS

Pages: << < (4/5) > >>

Conan:

do you understand object oriented programming? nmh_type is the object type and :: indicates the function name coming after it is a method on said object type

phflack:

when we declare function NMH_Type:send(%this) we override the default, but that'd be bad because then we couldn't chat with people
so when we use Parent:send(%this); it calls the method that we overwrote (the version before we overwrote) with the arguments

NMH_Type is some kind of object with the method send(%theNMH_TypeObject)

not entirely sure why we must use :: instead of ., probably to show that we're overriding that specific method and not getting a field

SubDaWoofer:


--- Quote from: phflack on December 10, 2017, 01:01:54 PM ---when we declare function NMH_Type:send(%this) we override the default, but that'd be bad because then we couldn't chat with people
so when we use Parent:send(%this); it calls the method that we overwrote (the version before we overwrote) with the arguments

NMH_Type is some kind of object with the method send(%theNMH_TypeObject)

not entirely sure why we must use :: instead of ., probably to show that we're overriding that specific method and not getting a field

--- End quote ---
alright thanks

Latte:


--- Quote from: SubDaWoofer on December 09, 2017, 09:30:55 PM ---oh stuff im handicapped
so it should be

--- Code: ---if ((%msg $= "*^ENABLE) & (%name $= "Stefan Burnett"))
{

--- End code ---
which defautls to

--- Code: ---if ((1) & (1)) {

--- End code ---
which is true
damnit

--- End quote ---
Remember that the and operator is actually 2 ampersands (&&) so that won't work right.

phflack:


--- Quote from: Latte on December 11, 2017, 07:49:36 PM ---Remember that the and operator is actually 2 ampersands (&&) so that won't work right.

--- End quote ---
it will work
& is boolean and, which does work for boolean statements (because they always return 1 or 0)
if they returned an int it would be a bit more iffy

Pages: << < (4/5) > >>

Go to full version