Author Topic: [Solved] setMusic(), setLight(), setItem(), etc.  (Read 914 times)

When I .dump(); a brick's object ID I get a lot of set commands such as setColor(), setLight(), setEmitter(), etc but only for some of them such as setColor() or setColliding() are the parameters specified. So my question to you guys is, is there a way to find the parameters those functions take or, if not, can someone explain? Thanks in advance and I apologize if this has been asked before but I can't find any information on it.


« Last Edit: January 21, 2016, 10:45:41 AM by Dr.Tyler O. »

Code: [Select]
package debug
{
   function fxDtsBrick::setColor(%a,%b,%c,%d,%e,%f,%g,%h)
   {
        parent::setColor(%a,%b,%c,%d,%e,%f,%g,%h);
        announce(%a SPC %b SPC %c SPC %d SPC %e SPC %f SPC %g SPC %h);
   }
};
activatePackage(debug);

Try doing this and activating the command using whatever method activates it naturally (in this case, painting or using the setColor event should do it). It should return a few numbers in the chat, and from there it's up to you to find out what they mean by experimenting.

For absolutely no reason at all, dump doesn't show the args for script functions.

These are the args for the functions you mentioned:

function fxDTSBrick::setMusic(%obj, %data, %client)
function fxDTSBrick::setLight(%obj, %data, %client)
function fxDTSBrick::setItem(%obj, %data, %client)
function fxDTSBrick::setEmitter(%obj, %data, %client)

Thanks guys, the debug package helps especially. The data variable, in setLight() for instance, returns values that I can use to set the brick's light but they seem to start at around 1200 which doesn't seem to make much sense but they work and that's what matters I suppose.
« Last Edit: January 21, 2016, 10:48:22 AM by Dr.Tyler O. »

Thanks guys, the debug package helps especially. The data variable, in setLight() for instance, returns values that I can use to set the brick's light but they seem to start at around 1200 which doesn't seem to make much sense but they work and that's what matters I suppose.
those are the datablock ids
try %data.getName() or %data.uiName

if you want to set a datablock always use the datablock name rather than the datablock id because the datablock id can change depending on the order of things executed whereas the datablock name will always be the same one

%brick.setLight(playerLight);
%brick.setItem(gunItem);

those are the datablock ids
try %data.getName() or %data.uiName

Thanks Swollow, I've ran into this issue once before.