Undocumented Commands

Blitz3D Forums/Blitz3D Programming/Undocumented Commands

RGF(Posted 2003) [#1]
Hi!!
I've found some commands without description. In the last DocPak (v1.83) I've not found their description. Can you say me how do they work??

These are the commands:
Object
RuntimeStats
DeltaYaw
DeltaPitch
VectorPitch
VectorYaw
VertexAlpha
Stats3D
ActiveTextures
DirectInputEnabled
EnableDirectInput

Bye!!!


GfK(Posted 2003) [#2]
Do a search of the forums. These commands have been discussed many MANY times.

I wouldn't recommend using undocumented commands, as they're liable to disappear in any given update without warning. If that happens and your game is reliant on them, you're not going to be too pleased, are you? ;)


Hotcakes(Posted 2003) [#3]
While the above is true, most of these commands have been around for a while and havn't changed their behaviour, so you may want to decide whether it's worth it or not. The following commands (in my experience) are extremely useful : DirectInputEnabled, EnableDirectInput, Object and Handle (which you missed;)...

I believe Stats3D and/or RuntimeStats return dummy values now... Or at least... values which are only useful for Mark ;]


Drago(Posted 2003) [#4]
Mark commented, once cant remember when though, that the Handle and Object commands are here to stay.


Koriolis(Posted 2003) [#5]
Cool, never heard of that. I would have been very disappointed if it would have disappeared..


RGF(Posted 2003) [#6]
Thank you very much. I'll search in the forums.
Bye!!!!!


Ziltch(Posted 2003) [#7]
What does handle and object do ?


Hotcakes(Posted 2003) [#8]
It's some weirdass way of accessing types' pointers within a normal variable... Very useful, I call it weirdass simply because I've never used it ;]


Drago(Posted 2003) [#9]
object and hable as Hotcakes pointed out are used with types.
it is one way to make a linked list out of them
where you have a next, and prev field in the type, which you store the (handle) of the next type.

it is complex to explain though. there was a cool tut on Blitzcoder, but since it has died I can't get the link.

but basically you can use it as a "pointer" to other types.


Red(Posted 2003) [#10]
TYPE ASS
END TYPE

TYPE NOSE
END TYPE

dim suprises(100)

for i=1 to 50
suprises(i)=Handle(New ASS)
suprises(50+i)=Handle(New NOSE)
next

KissMy suprises(rand(1,100)),1



function kissMy ( what%,type )

if type = 0 then MyBottom.ASS = object.ASS ( what )
if type = 1 then MyNose.NOSE = object.NOSE ( what )

end function



Koriolis(Posted 2003) [#11]
You can even no to pass 'type', because if you try to do "MyBottom.ASS = Object.ASS ( what )" when what is not an ASS but a NOSE, it returns Null. So you can do:
Function kissMy (what%)
    MyBottom.ASS = Object.ASS ( what )
    If (MyBottom <> Null) Then
        ... kiss my ass ...
    Else
        MyNose.NOSE = Object.NOSE(what)
        If (MyBottom <> Null) Then
            ... kiss my nose ...
        Else
            RuntimeError("Eh man, what's that?")
        EndIf
    EndIf
End Function



Red(Posted 2003) [#12]
LOL It's fun code :)

Your example is better than mine


Neo Genesis10(Posted 2003) [#13]
VertexAlpha allows you to set the opacity of individual vertices. There is also an optional alpha setting on one of the other vertex commands but i've forgotten which one :)


Anthony Flack(Posted 2003) [#14]
vertexcolor


cyberseth(Posted 2003) [#15]
VertexAlpha RETURNS the alpha value of the vertex. VertexColor vtx,r,g,b,a is used to set it.

You need to use EntityFX ent,32 in order to enable vertex alpha, but somehow I managed to do it using EntityFX ent,2 and using EntityAlpha in conjunction with it. Anyway...

I've noticed that GetJoy() is not in Blitz+ anymore. I wonder why this is!

Koriolis: Simpler to:
Select 1
    Case Object.Face(what)<>Null
    
    Case Object.Foot(what)<>Null
    
    Case object.Hand(what)<>null
    
End Select



Koriolis(Posted 2003) [#16]
True. I could have made it simpler even with ifs by doing something like you:
If (Object.ASS(what)<> Null) Then
    MyBottom.ASS = Object.ASS(what)
    ...
ElseIf (Object.NOSE(what)<> Null) Then
    MyNose.NOSE = Object.NOSE(what)
    ...
EndIf
But then I would have to do use Object twice more. And I think Object is little bit slow when you use Handle with a lot of objects because I believe it uses an associative container to keep track of the handle<->object association (so the conversion takes time - I have not tested how much time it can take though).

Then I could have used this trick with the select like you. I say trick just because it relies on the way Select are handled (ie by testing SEQUENTIALLY EACH case value against the select value until one matches, in the order the case are given - ie unlike in most programmming languages where the case values must be constants, and where jump tables are often used to directly jump to the right case).
But I just realized that this behaviour is documented so in fact it's safe to use it.

Anyway I definitely like your method for the reading comfort you get with it.