| Blockland Forums > Modification Help |
| Trigger positioning help |
| (1/1) |
| Jasa1:
I have this code here --- Code: ---function fxDTSBrick::handleBrickPlant(%brick, %data) { if(!isObject(%brick.trigger)) { %datablock = %brick.getDatablock(); %trigX = getWord(%datablock.triggerSize, 0); %trigY = getWord(%datablock.triggerSize, 1); %trigZ = getWord(%datablock.triggerSize, 2); if(mFloor(getWord(%brick.rotation, 3)) == 90) %scale = (%trigY / 2) SPC (%trigX / 2) SPC (%trigZ / 2); else %scale = (%trigX / 2) SPC (%trigY / 2) SPC (%trigZ / 2); %brick.trigger = new trigger() { datablock = %datablock.triggerDatablock; position = getWords(%brick.getWorldBoxCenter(), 0, 1) SPC getWord(%brick.getWorldBoxCenter(), 2) + ((getWord(%datablock.triggerSize, 2) / 4) + (%datablock.brickSizeZ * 0.1)); rotation = "1 0 0 0"; scale = %scale; polyhedron = "-0.5 -0.5 -0.5 1 0 0 0 1 0 0 0 1"; parent = %brick; }; %boxSize = getWord(%scale, 0) / 2.5 SPC getWord(%scale, 1) / 2.5 SPC getWord(%scale, 2) / 2.5; initContainerBoxSearch(%brick.trigger.getWorldBoxCenter(), %boxSize, $typeMasks::playerObjectType); while(isObject(%player = containerSearchNext())) %brick.trigger.getDatablock().onEnterTrigger(%brick.trigger, %player); } } } --- End code --- What this code does is it places the bottom of the trigger at the top of the brick. How do I get it so it places the bottom of the trigger at the bottom of the brick? |
| MegaScientifical:
I used to have an event I put together that did this, but Trader got it failed for extending outside the brick. He told me to put it inside a brick, but then you couldn't build there. I gave up, left the game for a while, and came back. "ZoneBricks!" loving ripoff of what Trader told me to do... Sorry, got a bit off track... Just pisses me off, but my point is that if I can find my code, I can help you. Want it? |
| Jasa1:
--- Quote from: MegaScientifical on November 06, 2011, 04:19:08 PM ---I used to have an event I put together that did this, but Trader got it failed for extending outside the brick. He told me to put it inside a brick, but then you couldn't build there. I gave up, left the game for a while, and came back. "ZoneBricks!" loving ripoff of what Trader told me to do... Sorry, got a bit off track... Just pisses me off, but my point is that if I can find my code, I can help you. Want it? --- End quote --- Sure |
| Jasa1:
I really need to use my brain more. It took my an hour and all I had to do was change + (%datablock.brickSizeZ * 0.1)); to - (%datablock.brickSizeZ * 0.1)); |
| Navigation |
| Message Index |