Author Topic: A stupid question regarding fetching the Category name  (Read 1988 times)

I was working on a little something and I feel like I came to a roadblock. For what I need to do, I need to pull the category name from a brick (getCategory, sort of) and store it in a variable to compare it to something which to me seems a little sloppy but it works.

Can anyone elaborate more on this? I feel like the solution is simple and I'm an idiot.

The category and sub-category are stored on the datablock.

%brick.getDatablock().category and %brick.getDatablock().subCategory should work.

The category and sub-category are stored on the datablock.

%brick.getDatablock().category and %brick.getDatablock().subCategory should work.

Oh thank god, I fixed it. The line I needed was %col.getDatablock().category = "JVS". Thank you.

Oh thank god, I fixed it. The line I needed was %col.getDatablock().category = "JVS". Thank you.
...?

That'll make the datablock move to the JVS category, do you mean $=?

Yes, I meant $=. I didnt go back to edit my post so now I look stupid. Great.

Thanks anyway.


Topic Locked.



...Topic Unlocked, because it appears I cant code worth a crap.

Is there an easy way to clear the client's ghost brick via script? I've searched this sub-forum and found nothing related to what I needed.
« Last Edit: June 01, 2012, 06:52:14 PM by Randomness »

servercmdcancelbrick(%client);

I think there is also a variable saved to %client or %client.player that is the ghost brick, which you can then just call .delete(); on
« Last Edit: June 01, 2012, 07:35:05 PM by Nexus »

I always used %client.player.tempbrick.delete(); because other scripts might package servercmdCancelBrick in a way I don't want to have to counterpackage.

By the way, don't lock your topics in coding help. Ever.

I guess that was kinda stupid.



Right.. new question.. (sheesh this must be my 3rd.)

How to fetch the host's BL_ID in script? The other topic doesnt help me.
« Last Edit: June 02, 2012, 09:28:46 PM by Randomness »


Is this for dedi servers too?


1. How to use trace
with this method you can find just about anything

2. Search (I'm pretty sure that finding hosts ID is searchable)

3. Coding help

Follow this order

Here is a better method to get the host's ID, since this works on LAN servers as well.

Code: [Select]
function getBlocklandID()
{
if($Server::LAN)
return getLAN_BLID();
else
return getNumKeyID();
}