Blockland Forums > Modification Help
Iban Explains it All
Stocking:
--- Quote from: takato14 on May 08, 2011, 11:02:49 PM ---1: I cant have two muzzlepoints.
2: That wont work. I cant control the image states from a function, thusly I cannot change the number of ejected shells depending on how many times the trigger has been clicked
3: Possible, but would make my current system entirely useless.
So what you're saying is that there is NO function that spawns a debris datablock. Nope, dont buy that.
--- End quote ---
I'm almost 100% certain that there is no way to spawn debris. You'll have to make do with the state system or just half-ass it and only eject 1 shell.
--- Quote from: Plexious on May 08, 2011, 11:16:12 PM ---I have a question:
If I were to have a package and rewrite the same functions without using packages, would it still work? Do some things have to be packaged?
--- End quote ---
I'm not quite sure what you're asking, but keep in mind the defintion of "works" is very flexible.
The idea of putting everything in a package sometimes rises up, because packages enabled after the server starts are automatically disabled when the server closes, and this prevents stray script from operating if the person restarts the server with your add-on disabled.
What bugs me is that there is no standards in add-on creation. Badspot seems to get a static shock whenever he tries touching the issue of add-on development for his own game and the only time he even posts about the subject is when talking about exploits being created or features being disabled. Nobody really knows how X should be done, and in a game like Blockland where almost all of the functionality can be exposed, this can be very bad when you have so many hands in the cookie jar that somewhere along the way something breaks and then you have a bunch of broken add-ons and even core game components not working.
But, to answer your question, it depends on what you want. Any function that is overwriting an existing function ABSOLUTELY MUST be in a package, otherwise you're destroying core game functionality. However, if we're going to create a brand new function that does not exist, it does not need a package, no.
The best thing to do when trying out hypotheticals like this is to just make a quick and dirty script and try it out. Learning any programming language is usually as simple as using it.
Greek2me:
--- Quote from: Stocking on May 08, 2011, 11:55:36 PM ---But, to answer your question, it depends on what you want. Any function that is overwriting an existing function ABSOLUTELY MUST be in a package, otherwise you're destroying core game functionality. However, if we're going to create a brand new function that does not exist, it does not need a package, no.
--- End quote ---
Not entirely correct. If you are completely overwriting a function, chat for example, you do not package the function. This would cause all other mods that package chat to parent your chat function. The danger there is not including all the functionality of the original function, but if you do, it works fine. You have to do this in some cases to change things, like name color in chat.
If you are only adding a check or something that occurs before or after the original function, you package it.
Stocking:
--- Quote from: Greek2me on May 09, 2011, 06:42:09 PM ---Not entirely correct. If you are completely overwriting a function, chat for example, you do not package the function. This would cause all other mods that package chat to parent your chat function. The danger there is not including all the functionality of the original function, but if you do, it works fine. You have to do this in some cases to change things, like name color in chat.
If you are only adding a check or something that occurs before or after the original function, you package it.
--- End quote ---
I struggle to imagine even one scenario in which it would be advantangeous, ethical, and practical to overwrite core game functionality without a way to disable or turn the effect off.
You're literally destroying something that cannot be replaced without a game restart. It's unacceptable to do that, ever.
* Packages can be disabled, leaving core game functionality working as intended.
* Packages are automatically disabled once the server shuts down, preventing interference with other mods with stray script if the server owner reboots the server without your add-on enabled.
* Overwriting a function prevents the add-on maker from adding in an option to disable certain features with something as simple as a boolean variable change, using something like Ephialte's RTB Preferences.
* Making Badspot's scripts not working can forget with other people's add-ons, and assuming that the add-ons aren't complete trash in the first place, this is a great sign of disrespect and poor ethic.
It's not OK to destroy core game functionality, ever. There's no reason to, and any reason invented has a simple work around with packages. This is not up for discussion.
Kalphiter:
--- Quote from: Stocking on May 09, 2011, 08:46:54 PM ---I struggle to imagine even one scenario in which it would be advantangeous, ethical, and practical to overwrite core game functionality without a way to disable or turn the effect off.
--- End quote ---
Preventing a player from mounting to a vehicle where we stop a function that mounts them to a vehicle
--- Code: ---package GSFnoMount
{
function WheeledVehicleData::onCollision(%this, %obj, %col, %vec, %vecLen)
{
if(%col.client.GSFmount == 1 || %obj.dataBlock !$= "carriervehicle")
Parent::onCollision(%this, %obj, %col, %vec, %vecLen);
}
};
function servercmdnomount(%client)
{
if(%client.GSFmount)
{
%client.GSFmount = 0;
%status = "un";
}
else
%client.GSFmount = 1;
messageClient(%client, '', "You are now "@ %status @"able to mount to aircraft carriers");
}
--- End code ---
Stocking:
--- Quote from: Kalphiter on May 09, 2011, 08:55:03 PM ---Preventing a player from mounting to a vehicle where we stop a function that mounts them to a vehicle
--- End quote ---
Thank you for proving my point. There's a package in there that only filters out some functionality in a very controlled environment