Author Topic: Brick Spawn Script  (Read 1641 times)


I tried make it work, it does not work.

Server.cs

Code: [Select]
datablock fxDTSBrickData (brick4xOctagontSpawnData){
   brickFile = "Add-Ons/Brick_Revloution_Spawn/4xOctagonSpawn.blb";

   specialBrickType = "Brick Spawn";

   orientationFix = 1;

   canCover = false;

   category = "Special";
   subCategory = "Revloution Spawn";
   uiName = "4 x Octagon";
   iconName = "Add-Ons/Brick_Revloution_Spawn/4xOctagon";

   indestructable = true;
};
How this player will get work spawn?

So you want it so people spawn on the brick?

If so, the reason is that you need to use the data from the default spawn brick.  Look at the first lines and compare. Hopefully this helps.

Code: [Select]
datablock fxDTSBrickData (brick4xOctagontSpawnData : brickSpawnPointData)
{
   brickFile = "Add-Ons/Brick_Revloution_Spawn/4xOctagonSpawn.blb";

   specialBrickType = "Brick Spawn";

   orientationFix = 1;

   canCover = false;

   category = "Special";
   subCategory = "Revloution Spawn";
   uiName = "4 x Octagon";
   iconName = "Add-Ons/Brick_Revloution_Spawn/4xOctagon";

   indestructable = true;
};

So you want it so people spawn on the brick?

If so, the reason is that you need to use the data from the default spawn brick.  Look at the first lines and compare. Hopefully this helps.

Code: [Select]
datablock fxDTSBrickData (brick4xOctagontSpawnData : brickSpawnPointData)
{
   brickFile = "Add-Ons/Brick_Revloution_Spawn/4xOctagonSpawn.blb";

   specialBrickType = "Brick Spawn";

   orientationFix = 1;

   canCover = false;

   category = "Special";
   subCategory = "Revloution Spawn";
   uiName = "4 x Octagon";
   iconName = "Add-Ons/Brick_Revloution_Spawn/4xOctagon";

   indestructable = true;
};
Nope, it does not work.

Where you in a minigame?

where you get this brickSpawnPointData? I been search for this a script. Can you tell me, so I can find it and look at it.

where you get this brickSpawnPointData? I been search for this a script. Can you tell me, so I can find it and look at it.
brickSpawnPointData is the default spawn brick. You can't access it's code file because it's in a .dso. You can however put brickSpawnPointData.dump(); or brickSpawnPointData.save("File path"); after you've started a server, if you want to find out everything about the brick. The .blb file for the brick is also in base/data/bricks/special/spawnPoint.blb
« Last Edit: June 20, 2013, 10:27:56 AM by jes00 »

brickSpawnPointData is the default spawn brick. You can't access it's code file because it's in a .dso. You can however put brickSpawnPointData.dump(); or brickSpawnPointData.save("File path"); after you've started a server, if you want to find out everything about the brick. The .blb file for the brick is also in base/data/bricks/special/spawnPoint.blb
it worked, you are great of mentor! I got this script :

Code: [Select]
==>brickSpawnPointData.dump();
Member Fields:
  alwaysShowWireFrame = "0"
  bottomArea = "9"
  brickFile = "base/data/bricks/special/spawnPoint.blb"
  brickSizeX = "3"
  brickSizeY = "3"
  brickSizeZ = "15"
  canCoverBottom = "1"
  canCoverEast = "0"
  canCoverNorth = "0"
  canCoverSouth = "0"
  canCoverTop = "0"
  canCoverWest = "0"
  category = "Special"
  eastArea = "99"
  hasPrint = "0"
  iconName = "base/client/ui/brickIcons/Spawn Point"
  indestructable = "1"
  isWaterBrick = "0"
  northArea = "99"
  southArea = "99"
  subCategory = "Interactive"
  topArea = "9"
  uiName = "Spawn Point"
  westArea = "99"
Tagged Fields:
  canCover = "0"
  orientationFix = "1"
  specialBrickType = "SpawnPoint"
Methods:
  addScheduledEvent() -
  cancelEvents() -
  clearEvents() -
  clearNTObjectName() -
  delete() - obj.delete()
  disappear() -
  dump() - obj.dump()
  dumpEvents() -
  getBlockArrayBit() - (x,y,z)
  getClassName() - obj.getClassName()
  getGroup() - obj.getGroup()
  getId() - obj.getId()
  getMaxSide() - ()
  getName() - obj.getName()
  getTaggedField() - obj.getTaggedFieldCount(int idx)
  getType() - obj.getType()
  getVolume() - ()
  onAdd() -
  onCameraEnterOrbit() -
  onCameraLeaveOrbit() -
  onClearFakeDeath() -
  onColorChange() -
  onDeath() -
  onFakeDeath() -
  onLoadPlant() -
  onPlant() -
  onPlayerTouch() -
  onRemove() -
  onTeledoorEnter() -
  onTeledoorExit() -
  onTrustCheckFailed() -
  onTrustCheckFinished() -
  onUse() -
  onWake() -
  openTreasureChest() -
  processInputEvent() -
  ProfileReplace() -
  reappear() -
  ReplaceProfiles() -
  save() - obj.save(fileName, <selectedOnly>)
  schedule() - object.schedule(time, command, <arg1...argN>);
  scheduleNoQuota() - object.schedule(time, command, <arg1...argN>);
  serializeEvent() -
  serializeEventToString() -
  SetEventEnabled() -
  setName() - obj.setName(newName)
  setNTObjectName() -
  ToggleEventEnabled() -
  unReplace() -

I should use this ?
Code: [Select]
  alwaysShowWireFrame = "0"
  bottomArea = "9"
  brickFile = "base/data/bricks/special/spawnPoint.blb"
  brickSizeX = "3"
  brickSizeY = "3"
  brickSizeZ = "15"
  canCoverBottom = "1"
  canCoverEast = "0"
  canCoverNorth = "0"
  canCoverSouth = "0"
  canCoverTop = "0"
  canCoverWest = "0"
  category = "Special"
  eastArea = "99"
  hasPrint = "0"
  iconName = "base/client/ui/brickIcons/Spawn Point"
  indestructable = "1"
  isWaterBrick = "0"
  northArea = "99"
  southArea = "99"
  subCategory = "Interactive"
  topArea = "9"
  uiName = "Spawn Point"
  westArea = "99"

Doing what Scriode said would make your datablock inherit those properties. You don't have to do it manually. You can also define specific changes to that datablock in yours.

Doing what Scriode said would make your datablock inherit those properties. You don't have to do it manually. You can also define specific changes to that datablock in yours.
Yes, I did and tested, they are not working. I can PM to you want to test it on my mod or not?

EDIT: Sent to you
« Last Edit: June 20, 2013, 03:38:55 PM by Furling² »

Scriode almost had it, but he overwrote some necessary stuff. Try this:

Code: [Select]
datablock fxDtsBrickData (brick4xOctagonSpawnData : brickSpawnPointData)
{
   brickFile = "./4xOctagonSpawn.blb";

   category = "Your Category";
   subCategory = "your sub-category..";
   uiName = "4 x Octagon";
   iconName = "./4xOctagon";
};

Scriode almost had it, but he overwrote some necessary stuff. Try this:

Code: [Select]
datablock fxDtsBrickData (brick4xOctagonSpawnData : brickSpawnPointData)
{
   brickFile = "./4xOctagonSpawn.blb";

   category = "Your Category";
   subCategory = "your sub-category..";
   uiName = "4 x Octagon";
   iconName = "./4xOctagon";
};
Nope, does not work. then I have going PM to you.

...Guys, spawnpoints are just bricks. The only thing that makes them spawn players is the code in their onPlant and onLoadPlant functions. You're going to have to call that if you want new spawnpoint bricks to work robustly.

Code: [Select]
function brickNewSpawnData::onPlant(%data, %brick)
{
    brickSpawnpointData::onPlant(%data, %brick);
}

function brickNewSpawnData::onLoadPlant(%data, %brick)
{
    brickSpawnpointData::onLoadPlant(%data, %brick);
}

...Guys, spawnpoints are just bricks. The only thing that makes them spawn players is the code in their onPlant and onLoadPlant functions. You're going to have to call that if you want new spawnpoint bricks to work robustly.

I always thought that they were defined by the specialBrickType field being set in the datablock.

...Guys, spawnpoints are just bricks. The only thing that makes them spawn players is the code in their onPlant and onLoadPlant functions. You're going to have to call that if you want new spawnpoint bricks to work robustly.

Code: [Select]
function brickNewSpawnData::onPlant(%data, %brick)
{
    brickSpawnpointData::onPlant(%data, %brick);
}

function brickNewSpawnData::onLoadPlant(%data, %brick)
{
    brickSpawnpointData::onLoadPlant(%data, %brick);
}
I have add these lines something like this?

Code: [Select]
datablock fxDTSBrickData (brick4xOctagonSpawnData : brickSpawnPointData)
{
   brickFile = "Add-Ons/Brick_Revloution_Spawn/4xOctagonSpawn.blb";

   specialBrickType = "Brick Spawn";

   orientationFix = 1;

   canCover = false;

   category = "Special";
   subCategory = "Revloution Spawn";
   uiName = "4 x Octagon";
   iconName = "Add-Ons/Brick_Revloution_Spawn/4xOctagon";

   indestructable = true;
};

function brick4xOctagonSpawnData::onPlant(%data, %brick)
{
    brickSpawnpointData::onPlant(%data, %brick);
}

function brick4xOctagonSpawnData::onLoadPlant(%data, %brick)
{
    brickSpawnpointData::onLoadPlant(%data, %brick);
}
I am correct or wrong?

I have add these lines something like this?

Code: [Select]
datablock fxDTSBrickData (brick4xOctagonSpawnData : brickSpawnPointData)
{
   brickFile = "Add-Ons/Brick_Revloution_Spawn/4xOctagonSpawn.blb";

   specialBrickType = "Brick Spawn";

   orientationFix = 1;

   canCover = false;

   category = "Special";
   subCategory = "Revloution Spawn";
   uiName = "4 x Octagon";
   iconName = "Add-Ons/Brick_Revloution_Spawn/4xOctagon";

   indestructable = true;
};

function brick4xOctagonSpawnData::onPlant(%data, %brick)
{
    brickSpawnpointData::onPlant(%data, %brick);
}

function brick4xOctagonSpawnData::onLoadPlant(%data, %brick)
{
    brickSpawnpointData::onLoadPlant(%data, %brick);
}
I am correct or wrong?
That should work. Try it.