Blockland Forums > Modification Help

Weapon won't fire anything

Pages: << < (2/2)

Shift Kitty:


--- Quote from: phflack on October 27, 2017, 04:06:50 PM ---Yes, when the function executes it does your stuff, then parent:: stuff tells it to do the old function stuff, then it goes back to your code

--- End quote ---
A better explanation is that there's a class hierarchy involved.

Parent Class > More parent classes > etc > specific object name

GhastFireballImage::onFire
WeaponImage::onFire
ShapeBaseImageData::onFire
and then I forget the rest of the parent classes

And then packages will be added on top of whatever it's packaging.

GhastFireballImage::onFire
[Package2]WeaponImage::onFire
[Package1]WeaponImage::onFire
WeaponImage::onFire
ShapeBaseImageData::onFire

The game will check for these in this order.
If the top one doesn't exist, check the next one down.
If it calls parent, call the next one down as well.
If it doesn't call parent, then we're all done, stop going down the list.

Pages: << < (2/2)

Go to full version