Author Topic: New Duplicator 1.6.2 | Now on BL Glass  (Read 194286 times)

I'm sure there's a good use for it, something like when you make a house and you somehow forget to put a door frame.

I'm sure there's a good use for it, something like when you make a house and you somehow forget to put a door frame.

I'm more thinking you just make the house and don't waste time building a frame in the first place, then just cut a hole exactly where you need.


I don't know how to use most of the features. All I know are the stuff that appear between cube and stack selection and multi-select.
Help me with everything else the topic says, please.

What exactly do you need help on


I didn't found anyone mention this, but I came to note that you're doing onRelay[direction] manually in classes/server/selection.cs:2358, but there was nothing that handles direction in event output parameters: setItemDirection, setEmitterDirection, spawnProjectile and my own fireRelayNum, to name a few. It shouldn't be that hard to add. In fact, in a short time I made my own version for fireRelayNum which should be quite easy to add for default add-ons at least and then each modder will do their own addition for their mods:
Code: [Select]
// Handle New Duplicator
function ND_Selection::plantBrick(%this, %i, %position, %angleID, %brickGroup, %client, %bl_id)
{
%brick = Parent::plantBrick(%this, %i, %position, %angleID, %brickGroup, %client, %bl_id);

// Handle error
if (%brick <= 0)
return %brick;

// Locate our event
for (%n = 0; %n < %brick.numEvents; %n++)
{
if (%brick.eventOutput[%n] !$= "fireRelayNum")
continue;

// Get direction and normalize it
%dir = %brick.eventOutputParameter[%n, 2] - 1;

if (%dir >= 0)
{
if (%dir >= 2)
{
if (%this.ghostMirrorX && %dir % 2 == 1 || %this.ghostMirrorY && %dir % 2 == 0)
%dir += 2;

%dir = (%dir + %angleID - 2) % 4 + 2;
}
else if (%this.ghostMirrorZ)
%dir = !%dir;

// Put direction back as it was
%brick.eventOutputParameter[%n, 2] = %dir + 1;
}
}

return %brick;
}



I also found out that if you've a named brick as target and if that brick is not in the duplication, it will still change direction. In some cases this is not a desired feature.

I like this new tool. Just came around recently to test it.

Missed this post somehow.

Having add-ons implement their own rotation is a bad idea, as everyone would have to make a seperate loop over all events and it simply stops working when someone does it wrong.

I guess I can add a generic solution that will detect directions in drop downs (up, down, north, east, south, west?) and attempt to rotate them. Maybe use a lookup table aswell to not lose performance with many rotated events.



I'm not sure about the named brick that's not in the selection. I can disable rotation for those, but won't it get confusing if you have one named brick in the selection and another with the same name out of it?
« Last Edit: August 11, 2016, 05:44:15 PM by Zeblote »

Missed this post somehow.
Pewh... You almost got me worried there.

Having add-ons implement their own rotation is a bad idea, as everyone would have to make a seperate loop over all events and it simply stops working when someone does it wrong.

I guess I can add a generic solution that will detect directions in drop downs (up, down, north, east, south, west?) and attempt to rotate them. Maybe use a lookup table aswell to not lose performance with many rotated events.
Yes, it is bad and that's why I asked if you could somehow implement it. You could just read the current list of names ($OutputEvent_parameterList) and use that as the rotation.

I think it's good that you try to do it correctly from the start so there wont be popping up versions that will just make things worse and then people blame you for it.

Also, take note about spawnProjectile, as that does not handle cardinal directions, but instead a vector. I currently have no idea of how you're going to fix that one, but checking for three float fields and try to determine if they are a compound for a vector or not.

I'm not sure about the named brick that's not in the selection. I can disable rotation for those, but won't it get confusing if you have one named brick in the selection and another with the same name out of it?
No matter how you do it, it would break anyway. Just set a standard and people are obliged to follow it. In this case, don't do a thing. The problem is way too big to handle and you would require som sort of list to be displayed to the user to take certain actions for these kind of issues, and that would just make it way too complicated.
« Last Edit: August 12, 2016, 04:15:14 AM by mctwist »

There's actually a vector parameter type, those are already handled.

Ok, I've added something here if you want to test it: https://github.com/Zeblote/Tool_NewDuplicator/commit/7562957d839c19a2c3abbc4063f6c9a28ad2f4a5?ts=4
Seems to work fine with the default events.
« Last Edit: August 12, 2016, 05:41:58 AM by Zeblote »

There's actually a vector parameter type, those are already handled.
Oh, I saw that you did rotation for fireRelay[direction], but might have missed the vector part. Good that was already done.

Ok, I've added something here if you want to test it: https://github.com/Zeblote/Tool_NewDuplicator/commit/7562957d839c19a2c3abbc4063f6c9a28ad2f4a5?ts=4
Seems to work fine with the default events.
I've tested it and it works perfectly. Great job there. Thank you.

What exactly do you need help on
I didn't mention that I need keybinds.
I don't see them in the options menu, and the topic doesn't show the keybinds to use the features requiring a keybind to use.
binds
^ this is exactly what I need. this also led to this post.
EDIT2: Binds aren't the only thing I need, but I also need the commands for the other features. Luckily, I found more of the commands you can do.

Here are the binds that I know:
Control-X - Cut
Left Control - Multi-Select
Control-C - Copy
and all the other things you can do w/o holding a key, just pressing it (ex: Light to switch modes)

Here are the commands and other features I know. Tell me if I am missing anything.
/fillWrench - Self-Explanitory.
/forceplant and /toggleForcePlant - Place bricks without any supporting blocks below it, and toggle the constant use of this.
Equipping paint can while in selection mode lets you fill the selection with a color or FX.
/mirrorX, mirrorY, mirrorZ, etc. - mirror the selection, while in plant mode, in the respective direction from the place your player is facing.

EDIT to known commands:
I found this when sifting through the pages. [thanks Zeblote for not helping at all by putting all the commands (alias) on a random page =c]
Here's a list of all the commands found in the files
==> is an alias

/DupVersion 
/DupClients
/DV ==> /DupVersion
/DC ==> /DupClients

/OldDup

/NewDuplicator
/Duplicator ==> /NewDuplicator
/Duplicato  ==> /NewDuplicator
/Duplicat   ==> /NewDuplicator
/Duplica    ==> /NewDuplicator
/Duplic     ==> /NewDuplicator
/Dupli      ==> /NewDuplicator
/Dupl       ==> /NewDuplicator
/Dup        ==> /NewDuplicator
/Du         ==> /NewDuplicator
/D          ==> /NewDuplicator

/Light
/NextSeat
/PrevSeat

/ShiftBrick [x] [y] [z]
/SuperShiftBrick [x] [y] [z]
/RotateBrick [direction]

/UndoBrick
/PlantBrick
/CancelBrick

/NdCopy
/NdPaste
/NdCut
/Cut

/NdMultiSelect [bool]

/MirrorX
/MirrorY
/MirrorZ
/Mirror [a]
/MirX ==> /MirrorX
/MirY ==> /MirrorY
/MirZ ==> /MirrorZ
/Mir [a] ==> /Mirror [a]
/MX ==> /MirrorX
/MY ==> /MirrorY
/MZ ==> /MirrorZ
/M [a] ==> /Mirror [a]
/MirErrors

/ForcePlant
/FP ==> /ForcePlant
/ToggleForcePlant
/TFP ==> /ToggleForcePlant

/UseSprayCan [index]
/UseFxCan [index]

/FillWrench
/FW  ==> /FillWrench

/NdStartFillWrench [data]

/SaveDup [f0] [f1] [f2] [f3] [f4] [f5] [f6] [f7]
/LoadDup [f0] [f1] [f2] [f3] [f4] [f5] [f6] [f7]
/SD [f0] [f1] [f2] [f3] [f4] [f5] [f6] [f7] ==> /SaveDup [f0] [f1] [f2] [f3] [f4] [f5] [f6] [f7]
/LD [f0] [f1] [f2] [f3] [f4] [f5] [f6] [f7] ==> /LoadDup [f0] [f1] [f2] [f3] [f4] [f5] [f6] [f7]

/AllDups [pattern]
/AD [pattern]  ==> /AllDups [pattern]

/ClearDups

some of them aren't supposed to be called manually so beware
« Last Edit: August 13, 2016, 02:48:31 PM by Mr. Noobalot »

although, I hadn't have proof about my crashes the first time, I decided to bring it back with the console on the moment it crashed.

Is there a fix for the duplicator?

I don't see anything that could indicate a crash in your log.
Paste trace(1);setLogMode(1); in your console and reproduce the crash again, the log file should be a little more detailed then.

However, as a lot of people are using new dup without getting any crash, it's most likely an issue with another add-on.

I don't see anything that could indicate a crash in your log.
Paste trace(1);setLogMode(1); in your console and reproduce the crash again, the log file should be a little more detailed then.

However, as a lot of people are using new dup without getting any crash, it's most likely an issue with another add-on.
Did just that and here is the results back.

EDIT: I cannot attach the console.log because, Blockland Forums freezes. I don't know why it is doing that but, I will find some way to show them
« Last Edit: August 16, 2016, 11:25:17 PM by Daffytitanic »