Blockland Forums > Modification Help
Making a list of every projectile datablock for use in RTB preferences
takato14:
What Im trying to do is make an RTB pref that contains a drop-down list of every projectile datablock in the server, similar to the list in the events gui. The idea is for a user to be able to chose the projectile that he wants a certain weapon(To be disclosed at a future date) to fire. I know that this is possible, Im just not sure how to implement it myself. Normally I'd just look at the source code for the wrench, but I obviously cant access it.
Below is the (untested and incomplete) pile of crap code that I have come up with.
--- Code: ---function datablock::onAdd(%db)
{
if(%db.getType == projectileData)
{
list(projectileList)
{
@ "(%db.uiname)" @
--- End code ---
Any ideas?
Plornt:
You could just loop through all of the datablocks once the server starts and check if its in the ProjectileData Class
otto-san:
Couldn't you just make the box type "datablock ProjectileData"
Ephialtes:
Worth pointing out I'll be adding this variable type in v4 - but you may want to keep looking at alternatives in the meantime.
takato14:
--- Quote from: Ephialtes on June 14, 2011, 02:48:00 PM ---Worth pointing out I'll be adding this variable type in v4 - but you may want to keep looking at alternatives in the meantime.
--- End quote ---
Wonderful... except now I know that once I do figure this out all that work was virtually meaningless :/