Author Topic: Datablock ids  (Read 688 times)

Ok so i noticed that %brick.getDatablock(); gives you an id for each brick. How does this system work? Can i use if for items/projectiles?

Yes.

A datablock is a class, but for networking purposes.

Two VehicleSpawns should have the same id there if i am correct.
This is how you can let something recognise a certain datablock.

flyingJeepVehicle or something would be the datablock over all flying jeeps.

flyingJeepVehicle or something would be the datablock over all flying jeeps.
That isn't a datablock for a brick though. ;)
(Wait, what if one would change the datablock of a brick into flyingJeepVehicle? I think that isn't possible since there are different datablock types...)

That isn't a datablock for a brick though. ;)
(Wait, what if one would change the datablock of a brick into flyingJeepVehicle? I think that isn't possible since there are different datablock types...)
A jeep would probably just suddenly appear if you change a brick into a jeep. It would drop like a vehicle, but there may be other unpredictable results. Try it.

A jeep would probably just suddenly appear if you change a brick into a jeep. It would drop like a vehicle, but there may be other unpredictable results. Try it.
It did not work and gave an error.
As i predicted:
I think that isn't possible since there are different datablock types...

It did not work and gave an error.
As i predicted:
They probably have to have a common parent in order to change

They probably have to have a common parent in order to change
Yup. :C
Though changing a brick's datablock to another will cause it to have the hitbox of the new datablock but still the model (graphic) of the old one.
Interesting!

They probably have to have a common parent in order to change
They need to be the same datablock class.


Hmm, also possible.
Not "also possible", it's exactly how it works.

Any physical networked object between the server and client has it's own corresponding datablock class. To spawn a Player you need a PlayerData, to spawn an Item you need an ItemData, to spawn a fxDtsBrick you need a fxDtsBrickData, to spawn a StaticShape you need a StaticShapeData, to spawn a Projectile you need a ProjectileData, etc.

All physical objects can't switch between different datablock classes (vehicles may be an exception - I'm not entirely sure).

Not "also possible", it's exactly how it works.

Any physical networked object between the server and client has it's own corresponding datablock class. To spawn a Player you need a PlayerData, to spawn an Item you need an ItemData, to spawn a fxDtsBrick you need a fxDtsBrickData, to spawn a StaticShape you need a StaticShapeData, to spawn a Projectile you need a ProjectileData, etc.

All physical objects can't switch between different datablock classes (vehicles may be an exception - I'm not entirely sure).
Sorry, my bad, bad words.
I meant it like, oh well we all mean about the same here.

But thanks for the in-depth explanation.