IRC logs for #openttd on OFTC at 2016-09-22
            
00:06:07 <Samu> i don't know the operator needed
00:07:33 <Samu> SLOPE_SW (insert operator) SLOPE_STEEP_W = SLOPE_S
00:07:38 <Samu> what is the operator?
00:08:01 <Samu> that gives me that result
00:09:40 <Wolf01> I would suggest "minus", but it's not how it works, so try with XOR
00:11:13 <Samu> XOR is ^ ?
00:11:26 <Wolf01> Usually yes
00:12:28 <Samu> gonna get horribad result
00:13:10 <Wolf01> Oh, my bad, it's not a flag
00:13:24 <Samu> :( i got an assertion, :(
00:14:06 <Wolf01> Give a look ad the "RemoveHalfSlopes" function or what its name
00:21:02 <Samu> i see
00:21:04 <Samu> testing ComplementSlope(tileh_start) & ~(tileh_end_aqueduct & ~SLOPE_STEEP)
00:22:15 <Samu> nope, i got a SLOPE_FLAT as result :(
00:22:26 <Wolf01> You could make a separate patch with some utility functions
00:25:06 <Samu> SLOPE_STEEP_W & ~SLOPE_STEEP = SLOPE_NWS :(
00:25:30 <Samu> the result I was expecting was SLOPE_W
00:28:36 <Samu> tileh_start is SLOPE_NE
00:28:42 <Samu> the complement is SLOPE_SW
00:29:04 <Samu> SLOPE_SW & ~SLOPE_W = SLOPE_S
00:29:20 <Samu> SLOPE_S is the final result I want
00:29:33 <Samu> but i got to calculate SLOPE_W
00:30:22 <Wolf01> You should ask frosch for this
00:31:17 <Samu> he's the slope master?
00:31:44 <Wolf01> Maybe
00:31:48 *** Gja has quit IRC
00:48:21 *** Biolunar has quit IRC
00:51:42 <Wolf01> 'night
00:51:44 *** Wolf01 has quit IRC
00:58:18 *** FLHerne has quit IRC
00:58:20 *** FLHerne_ has joined #openttd
01:17:37 *** NoShlomo has quit IRC
01:26:37 <Samu> and this is why i failed to be a programmer
01:26:38 <Samu> https://paste.openttdcoop.org/p6z7gacvt
01:27:37 <Samu> lol, i'm still failing
01:27:43 <Samu> code doesn't work, i'm horrible
01:37:41 <Samu> ah, i needed more breaks
01:43:31 *** Samu has quit IRC
01:54:26 *** supermop_ has joined #openttd
02:05:39 *** Alkel_U3 has quit IRC
02:09:58 *** Alkel_U3 has joined #openttd
02:17:53 *** HerzogDeXtEr has quit IRC
02:24:57 *** Alkel_U3 has quit IRC
02:31:51 *** Alkel_U3 has joined #openttd
02:44:39 *** glx has quit IRC
02:45:32 *** Supercheese has quit IRC
03:21:04 *** sim-al2 is now known as Guest1167
03:21:05 *** sim-al2 has joined #openttd
03:25:37 *** Guest1167 has quit IRC
03:26:30 *** kais58 is now known as kais58|AFK
03:26:50 *** kais58|AFK is now known as kais58
03:35:00 *** JezK_ has joined #openttd
03:39:04 *** FLHerne_ has quit IRC
04:23:34 *** smoke_fumus has joined #openttd
05:16:48 *** supermop_ has quit IRC
06:03:13 *** Supercheese has joined #openttd
06:07:30 *** Tharbakim has quit IRC
06:08:38 *** Tharbakim has joined #openttd
06:18:52 *** JezK_ has quit IRC
06:26:41 *** JezK_ has joined #openttd
06:41:40 *** JezK_ has quit IRC
06:49:41 *** JezK_ has joined #openttd
07:02:37 *** smoke_fumus has quit IRC
07:02:47 *** smoke_fumus has joined #openttd
07:26:50 *** _dp_ has quit IRC
07:28:20 *** dP has joined #openttd
07:28:23 *** dP is now known as _dp_
08:03:30 *** _dp_ has quit IRC
08:06:04 *** dP has joined #openttd
08:06:06 *** dP is now known as _dp_
08:08:19 *** sla_ro|master has joined #openttd
09:30:39 *** andythenorth has joined #openttd
09:42:05 *** Extrems has quit IRC
09:48:08 *** sim-al2 has quit IRC
10:00:14 *** Extrems has joined #openttd
10:06:41 *** JezK_ has quit IRC
10:11:41 *** andythenorth has left #openttd
10:16:01 *** Biolunar has joined #openttd
10:44:39 *** Wolf01 has joined #openttd
10:45:18 <Wolf01> o/
10:52:56 *** tokai has joined #openttd
10:52:56 *** ChanServ sets mode: +v tokai
10:59:41 *** tokai|noir has quit IRC
11:18:52 *** Supercheese has quit IRC
11:23:49 *** sla_ro|master has quit IRC
12:14:58 *** nilez has quit IRC
12:17:48 *** NoShlomo has joined #openttd
12:33:22 *** nilez has joined #openttd
12:49:32 *** FLHerne_ has joined #openttd
13:07:14 *** FLHerne_ has quit IRC
13:42:17 *** Gja has joined #openttd
13:58:25 *** Samu has joined #openttd
14:05:19 <Samu> is frosch here?
14:10:07 <Samu> who's a slope master? how can i simplify this? https://paste.openttdcoop.org/pwme4lx6r
14:10:41 <Samu> i'd like to avoid a case by case check, and do some math operations on the slopes
14:10:51 <Samu> pls someone answer :o
14:30:30 *** sim-al2 has joined #openttd
14:54:37 <Samu> aww nobody answered
15:04:40 <Samu> I got a SLOPE_STEEP_W, and I want to transform it into the highest corner as a slope
15:04:51 <Samu> SLOPE_STEEP_W into SLOPE_W
15:04:58 <Samu> what is the math involved to achieve this?
15:05:34 <Samu> SLOPE_STEEP_W has these bits: 0001 1011
15:05:44 <Samu> SLOPE_W has these bits: 0000 0001
15:07:11 <Samu> is there a Highest corner to slope conversion?
15:10:02 *** tarpl has joined #openttd
15:10:19 <tarpl> hello
15:10:30 <tarpl> any body her me?
15:10:55 <ST2> hello tarpl
15:10:55 <tarpl> hey
15:10:59 <tarpl> hi
15:11:19 <tarpl> i have a qations
15:11:28 <ST2> it's about your ban?
15:11:28 <tarpl> sory for my english
15:11:34 <tarpl> yes
15:11:39 <tarpl> iam sorry
15:11:41 <ST2> enter our channel, please
15:11:45 <ST2> http://openttd.btpro.nl/contact-us
15:11:54 <tarpl> i dont do again
15:11:58 <ST2> this is not the place to chat about it ^^
15:12:31 <tarpl> how do you no about my ban?
15:13:03 <tarpl> what is "channel"?
15:13:36 <ST2> click the link in http://openttd.btpro.nl/contact-us
15:14:31 *** tarpl has quit IRC
15:29:22 <Wolf01> Samu, what about making the tile flat and then raise the corners you need?
15:31:22 <Samu> i don't know what the corner is
15:31:43 <Wolf01> You know the direction of the dock
15:31:44 <Samu> Slope tileh_north_aqueduct = GetTileSlope(tile_start);
15:33:15 <Samu> Slope tileh_north_result = tileh_north_aqueduct (incredible bitmath operations) SLOPE_WITH_ONE_CORNER
15:33:45 <Samu> it's an aqueduct
15:34:13 <Wolf01> Doesn't matter, you have a direction
15:36:39 <Wolf01> Did you try with CmdLevelLand()?
15:37:13 <Samu> nope
15:37:34 <Samu> not sure what that one does
15:37:42 <Wolf01> It levels land
15:39:44 <Samu> let me check
15:42:20 *** Mavy has quit IRC
15:44:33 *** sim-al2 has quit IRC
15:44:37 <Samu> hmm there is no area drag :(
15:50:00 <peter1138> hmm, new red dwarf tonight
15:56:53 *** sla_ro|master has joined #openttd
16:11:16 <Flygon_> It isn't out in Australia yet :(
16:11:19 *** Flygon_ is now known as Flygon
16:13:24 <Samu> i got something
16:14:01 <Samu> SLOPE_STEEP_N ^(SLOPE_ELEVATED | SLOPE_STEEP) = SLOPE_S
16:14:16 <Samu> i want the opposite corner of SLOPE_S now
16:14:28 <Samu> SLOPE_N
16:18:06 <Samu> the other side of the aqueduct got SLOPE_SW, the complement of this one is SLOPE_NE
16:27:36 <Samu> what's the operator that makes this: 10 (op) 11 = 01
16:29:06 <Samu> gonna try ^
16:35:32 <peter1138> ^
16:35:40 <peter1138> aka xor
16:37:43 *** JacobD88 has joined #openttd
16:39:10 <Samu> think i made it!
16:39:14 <Samu> Slope tileh_north_result = IsSteepSlope(tileh_north_aqueduct) ? (tileh_north_aqueduct ^(SLOPE_ELEVATED | SLOPE_STEEP)) ^ tileh_end : ComplementSlope(tileh_end) & ~tileh_north_aqueduct;
16:39:50 <Samu> tileh_north_result is what the terraform command will do, and raise
16:42:51 <Samu> think i can safely remove the switch/case now
16:42:58 <Samu> not needed anymore
16:47:33 <Samu> and the same for the south
16:47:53 <Samu> Slope tileh_south_result = IsSteepSlope(tileh_south_aqueduct) ? (tileh_south_aqueduct ^ (SLOPE_ELEVATED | SLOPE_STEEP)) ^ tileh_start : ComplementSlope(tileh_start) & ~tileh_south_aqueduct;
16:50:28 *** JacobD88 has quit IRC
16:50:46 <Samu> nop, im wrong, still crash, grrr i suck
16:53:59 <Samu> oh right, it's not SLOPE_W that I want, it's SLOPE_E :(
16:54:07 <Samu> why am i so stupid
17:10:45 <Samu> how do i transform a corner into a slope?
17:10:48 <Samu> convert
17:11:00 <Samu> CornerToSlope
17:18:19 *** Alberth has joined #openttd
17:18:19 *** ChanServ sets mode: +o Alberth
17:18:34 <Alberth> moin
17:23:38 <Samu> ugly math testing
17:23:40 <Samu> SlopeWithOneCornerRaised(OppositeCorner(GetHighestSlopeCorner((tileh_north_aqueduct ^(SLOPE_ELEVATED | SLOPE_STEEP)) ^ tileh_end)))
17:25:14 <Samu> alright, i think i got it this time, :o
17:25:24 <Samu> (in before crash)
17:29:04 <Samu> it's working
17:29:21 <Samu> Slope tileh_north_result = IsSteepSlope(tileh_north_aqueduct) ? SlopeWithOneCornerRaised(OppositeCorner(GetHighestSlopeCorner((tileh_north_aqueduct ^(SLOPE_ELEVATED | SLOPE_STEEP)) ^ tileh_end))) : ComplementSlope(tileh_end) & ~tileh_north_aqueduct;
17:29:37 <Samu> Slope tileh_south_result = IsSteepSlope(tileh_south_aqueduct) ? SlopeWithOneCornerRaised(OppositeCorner(GetHighestSlopeCorner((tileh_south_aqueduct ^ (SLOPE_ELEVATED | SLOPE_STEEP)) ^ tileh_start))) : ComplementSlope(tileh_start) & ~tileh_south_aqueduct;
17:29:52 <Samu> do yousee any means to simplify this?
17:33:08 <Samu> trying with real values
17:35:01 <Samu> SlopeWithOneCornerRaised(OppositeCorner(GetHighestSlopeCorner((SLOPE_STEEP_N ^ (SLOPE_ELEVATED | SLOPE_STEEP)) ^ SLOPE_SW)))
17:37:10 <Samu> (SLOPE_STEEP_N ^ (SLOPE_ELEVATED | SLOPE_STEEP)) = SLOPE_S
17:37:31 <Samu> SLOPE_S ^ SLOPE_SW = SLOPE_W
17:38:36 <Samu> SlopeWithOneCornerRaised(OppositeCorner(GetHighestSlopeCorner(SLOPE_W))) = SLOPE_E
17:38:57 <Samu> that's the result I wanted
17:41:42 <Samu> can this expression/code be simplified? more readable?
17:43:46 <Alberth> don't use ? : , but an if statement
17:44:27 <Alberth> or you have 2 results, one north and one south?
17:44:40 <Alberth> looks like an awful lot of duplication in there
17:47:37 *** TheMask96 has quit IRC
17:52:26 *** TheMask96 has joined #openttd
18:00:04 <Wolf01> Also if possible, make a generic function
18:01:45 <Wolf01> https://www.thelocal.de/20160920/first-alstom-hydrogen-train-at-berlin-innotrans-tradeshow uh, nice
18:02:05 <Wolf01> Do we have that on some trainset?
18:05:05 *** NoShlomo has quit IRC
18:05:21 <Samu> i'm still getting crashes... sorry :(
18:07:13 *** Biolunar has quit IRC
18:14:20 <Samu> there is a swap in the middle of somewhere ruining the coordinates of the tile I'm about to terraform, arg!!! :(
18:15:14 <Samu> tile_end is sometimes tile_start and vice versa
18:16:06 <Samu> if (tile_end < tile_start) Swap(tile_start, tile_end);
18:16:20 <Samu> :)
18:22:54 <Eddi|zuHause> i would have assumed 2ccset already has every one-off prototype ever
18:23:04 <Eddi|zuHause> including future ones
18:25:34 <Eddi|zuHause> anyway, i'm sure LINT train sets were already part of some NewGRFs, and the propulsion method has no pracital impact on the game mechanics
18:29:07 <Wolf01> They could be even atomic ones, just use diesel-behavior :P
18:30:03 <supermop> Eddi|zuHause: small chance of train exploding?
18:30:29 <supermop> every train in game looks like it has a huge hydrogen tank on the roof when it crashes
18:30:50 <Wolf01> They should have run it with helium, zellepins teaches :P
18:32:42 <supermop> Wolf01: might be a bit harder to get that to burn in the fuel cell though
18:32:58 <Wolf01> :D
18:33:01 <Samu> it's not the tile swap, it's me
18:34:43 <supermop> i wonder, is building out the infrastructure for hydrogen fuel cell MUs really cheaper than using batteries or diesel hybrids?
18:35:21 <Eddi|zuHause> supermop: the article says the trains are probably more expensive than diesel
18:35:25 <Samu> i suck at bit operations
18:35:35 <supermop> seems battery technology would be at the point now where a train could easily lug around 1000kg or batteries and be set for even a long journey
18:35:42 <Eddi|zuHause> i can't imagine this being different for the infrastructure
18:35:46 <supermop> *of batteries
18:36:06 <Eddi|zuHause> well, we had battery powered trains since like 100 years ago
18:36:19 <Samu> 1100 (operation) 1000 = 0100, what's the operation?
18:36:30 <Alberth> you need a lot of power for trains, much more than cars
18:36:34 <Eddi|zuHause> until they got phased out about 20 years ago
18:37:07 <supermop> yeah, seems like they would be even better today, with tesla and nissan and bmw selling significant numbers
18:37:40 <Alberth> Samu: that depends on what 100 (operation) 1000 should do
18:37:47 <supermop> Alberth: but a train on steel wheels is less penalized by carrying very heavy batteries around with it
18:37:59 <Samu> 1100 ^ 1000 = 0100 ?
18:38:09 <Alberth> yep
18:38:26 <Samu> hmm 1100 ^ 0100 = 1000 ?
18:38:50 <Wolf01> Isn't 1100^0100=1011?
18:39:07 <Alberth> 0^0 -> 0 1^0 -> 1 0^1 -> 1 1^1 -> 0
18:39:34 <Wolf01> Right
18:39:37 <Eddi|zuHause> 1100^0100=1000
18:39:49 <Samu> I was using & ~
18:40:03 <Samu> 1100 &~0100 = some ugly result that i do not want
18:40:19 <Alberth> 1000 ? :)
18:40:35 <Samu> i got a negative number somehow
18:40:55 <Samu> there are no negative slopes
18:40:57 <Alberth> yep, the sign bit is also a bit :)
18:41:50 <Alberth> doing bit operations on signed values works, but the decoding to text makes a mess :)
18:42:09 <Alberth> it's more predictable to work with unsigned values
18:42:31 <Samu> operator~ returned -9 Slope
18:42:36 <Samu> slope -9
18:43:10 <Alberth> that's just how it gets printed
18:43:47 <Alberth> ie don't print it as a signed value
18:45:07 <Samu> ComplementSlope(tileh_start) ^ tileh_south_aqueduct
18:46:03 <Samu> i was having trouble with the non-steep slopes now, it's funny that i never get it right at the first try
18:46:30 <Samu> tileh_start SLOPE_NE (12) Slope
18:46:49 <Samu> tileh_south_aqueduct SLOPE_W (1) Slope
18:48:19 <Samu> ComplementSlope(SLOPE_NE) = SLOPE_SW
18:48:42 <Samu> SLOPE_SW ^ SLOPE_W = SLOPE_S, hopefully
18:49:21 <Samu> SLOPE_SW = 11, SLOPE_W = 1
18:49:32 <Samu> 11 ^ 1 = 10 ?
18:50:21 <Samu> SLOPE_S = 10
18:50:37 <Samu> if 11 ^ 1 = 10, then I got this right
18:55:47 *** Progman has joined #openttd
18:55:55 *** keoz has joined #openttd
19:01:34 *** frosch123 has joined #openttd
19:03:27 <Wolf01> Is there a function which does actions while dragging? I don't mean the VpStartPlaceSizing
19:03:34 *** glx has joined #openttd
19:03:34 *** ChanServ sets mode: +v glx
19:03:58 <Eddi|zuHause> Wolf01: updating the measurement tooltips?
19:04:12 <Wolf01> Nah, terrain paintbrush
19:04:28 <Eddi|zuHause> i mean, the functions that update the selection and stuff
19:13:13 <Wolf01> Not really
19:13:28 <Wolf01> Still bound to a rectangle in the map
19:23:32 *** mindlesstux has quit IRC
19:23:44 *** mindlesstux has joined #openttd
19:23:56 <Samu> i found another crash, managed to find out why it was happening
19:24:22 <Samu> if (!IsInclinedSlope(tileh_north_aqueduct)) return_cmd_error(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION);
19:25:45 <Samu> if (!IsInclinedSlope(tileh_south_aqueduct)) return_cmd_error(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION);
19:26:00 <Samu> this fixes it, before it starts doing the terraform
19:26:31 <Samu> i need a new string STR_ERROR_UNABLE_TO_EXCAVATE_LAND
19:26:48 <Samu> this says unable to excavate land at the other side of tunnel
19:27:04 <Samu> i want a unable to raise land at the other side of aqueduct
19:27:32 <Samu> or re-use another message that suits this
19:55:13 <Samu> what's the opposite of excavate
19:55:23 <Samu> elevate?
19:55:25 <Samu> level?
19:55:31 <Samu> raise?
19:56:25 <Samu> "Unable to 'abcde' at the other side of aqueduct"
19:56:32 <Samu> what fits better?
19:57:17 <Samu> "Unable to 'abcde' land at the other side of aqueduct" typo
19:59:40 <Samu> bury?
19:59:42 <Samu> fill?
20:00:01 <Samu> cover?
20:00:27 *** gelignite has joined #openttd
20:03:38 <Samu> smooth?
20:05:35 <Wolf01> frosch123, could I ask some questions?
20:06:04 <Wolf01> *ask you
20:08:40 <supermop> Samu: alter is probably easiest word
20:09:11 <Wolf01> Terraform
20:09:28 <Eddi|zuHause> Wolf01: have you ever read the topic?
20:10:37 <Wolf01> I'm asking directly to frosch, maybe he has other things to do, but if you want to help me instead...
20:11:37 <Wolf01> I'm trying to make a continuous level land tool with gui resizable brush like the raise/lower land
20:12:37 <Wolf01> And I have a little problem calculating the right mode (0 = lower; 1 = raise) to use
20:15:20 <Eddi|zuHause> yo mean, like, compare the current height to the desired height?
20:15:29 <Eddi|zuHause> +u
20:15:34 <Wolf01> Yes, but for eachh tile
20:16:32 <Eddi|zuHause> isn't there like a TILE_LOOP macro?
20:17:03 <Wolf01> Yes it is, I copied the CommonRaiseLowerBigLand
20:17:43 <Wolf01> But I removed the part which calculates "h" as I have no mode (raise or lower)
20:17:52 <Wolf01> Because I'm leveling
20:18:41 <Eddi|zuHause> can you give a link to the code? because i'm having difficulty understanding what your actual problem is
20:18:50 <Wolf01> And if I just put a TileHeight(tile2) > TileHeight(tile) ? 0 : 1 it doesn't work right in most situations
20:19:03 <frosch123> https://www.tt-forums.net/viewtopic.php?f=33&t=35627 <- Wolf01: something like that?
20:19:28 <Wolf01> Mmmh, yes
20:20:01 <Wolf01> I think I could just update that patch
20:20:13 <Wolf01> But for scenario editor only
20:24:00 <Wolf01> The nice part is that I started with the VpStart*(), but I ended up doing another function like the one for the raise/lower
20:33:07 *** aard has joined #openttd
20:35:32 <Wolf01> And I just noticed I'm trying to do the suggestions I posted on that topic... I think those things were printed with fire in my subconscious
20:37:46 <Samu> STR_ERROR_UNABLE_TO_SMOOTH_LAND_AQUEDUCT :{WHITE}Unable to smooth land for other end of aqueduct
20:38:49 <Samu> seems to be good
20:41:59 *** Arveen has joined #openttd
20:43:07 *** andythenorth has joined #openttd
20:43:12 *** smoke_fumus has quit IRC
20:43:15 <Wolf01> Mmmh, roujin used WindowEvent, which counterpart has it now?
20:43:17 <Wolf01> o/
20:44:06 <andythenorth> o/
20:47:21 <Wolf01> Samu, I like the bridge over locks patch, but I think the min bridge height should be 2
20:48:50 <Samu> oki
20:49:19 <Samu> first time someone likes something i do
20:49:48 <Samu> i'm still getting trouble with the darn terraform command
20:49:52 <Samu> on aqueduct
20:49:57 <Samu> incredible... :(
20:51:08 <Wolf01> Would like to help, but I'm already confused with my stuff about terraform... and mine should be easy, it's only the interface process which need to change
20:52:06 <Alberth> what does WindowEvent do?
20:52:14 <Wolf01> Don't know
20:52:23 <Samu> there is a swap happening and i still didn't get the correct handling of this swap
20:52:24 <Alberth> we don't have that one :p
20:52:33 <Wolf01> We had that one
20:53:19 <Wolf01> In the patch seem to be used to get the coordinates of the tile under the mouse
20:53:47 <Wolf01> Or to set them
20:54:43 <Alberth> OnMouseLoop?
20:56:04 <Wolf01> No, but looks like the HandlePlacePresize()
20:57:24 <Wolf01> https://paste.openttdcoop.org/ptvuv4bkz
20:57:28 <Wolf01> This part
20:57:39 <Alberth> sounds better than OnMouseLoop :)
20:58:22 <Wolf01> Window shouldn't be a problem, the problem is WindowEvent
21:00:44 <Alberth> maybe it is some sort of mouse mode now
21:01:14 <Wolf01> Probably OnMouseDrag or such
21:01:21 <Alberth> ie WindowEvent sounds like a very low level DIY
21:02:36 <Wolf01> I'll try with your first suggestion, OnMouseLoop
21:03:10 <Alberth> tree_gui does dragging stuff, maybe steal that
21:03:35 <Wolf01> Yup
21:03:46 <Alberth> OnPlaceObject / OnPlaceDrag / OnPlaceMouseUp
21:09:53 <Samu> if (!IsInclinedSlope(tileh_south_aqueduct) && !IsInclinedSlope(GetTileSlope(tile_start))) return_cmd_error(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION);
21:10:01 <Samu> if (!IsInclinedSlope(tileh_north_aqueduct) && !IsInclinedSlope(GetTileSlope(tile_end))) return_cmd_error(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION);
21:10:10 <Samu> will this work?
21:11:25 <Alberth> I don't even know what it means :)
21:11:27 <Samu> there's a tile_start and tile_end swap happening and it is ruining my code
21:11:36 <Samu> sec, let me bring up the line
21:11:52 <Alberth> detect the swap?
21:11:58 <Alberth> or try both cases?
21:12:19 <Wolf01> Uh, nice, I did it, 3 lines of code...
21:12:28 <Alberth> \o/
21:12:33 <Samu> https://hg.openttd.org/trunk.hg/file/d1ee3e5330e5/src/tunnelbridge_cmd.cpp#l228
21:12:40 <Wolf01> Now I just need to make it work as intended
21:12:40 <Samu> line 301 is ruining me
21:12:52 <Alberth> lol W :)
21:13:16 <Wolf01> OnMouseLoop is too fast
21:13:22 <Wolf01> It triggers 4253465436 times
21:13:29 <Wolf01> I'm trying with OnHundredthTick
21:14:01 <Wolf01> Which is too slow
21:14:03 <Wolf01> XD
21:14:05 *** sla_ro|master has quit IRC
21:14:26 <Samu> i'm adding the terraform code between lines 392, 393 and lines 401, 402
21:14:55 <Samu> the swap ruins it :(
21:15:01 <Samu> i hate that swap
21:16:13 *** aard has quit IRC
21:16:48 <Alberth> OnTick? :)
21:17:53 <Alberth> wow, that bridge code can update an existing bridge
21:18:02 <Alberth> never knew that
21:20:27 <frosch123> it even works on town-owned bridges
21:20:39 <frosch123> when you increase the speed limit
21:20:50 <Alberth> ah :)
21:21:28 <Alberth> line 301 sorts the bridge ends, so how does it ever get swapped?
21:31:16 <Samu> let me copy paste my code
21:32:12 <Samu> https://paste.openttdcoop.org/pawn8ypdk
21:33:36 <Samu> lines 165 to 195, then lines 203 to 233
21:34:19 <Samu> the swap is at line 74
21:37:56 <Samu> i think my code isn't 100% ready to deal with the swap happening or not happening
21:43:03 *** nilez has quit IRC
21:43:27 *** nilez has joined #openttd
21:43:51 <Alberth> so what variable do you use from before the swap? I don't see it
21:44:29 <Samu> tile_end and tile_start
21:45:02 <Alberth> they're swapped if needed at line 74 in your code
21:45:18 <Alberth> so they are always in the same order
21:46:15 <Alberth> if you start modifying after that, and not use variables from before, you can't have a wrong order, as there is only one
21:46:58 *** sim-al2 has joined #openttd
21:47:16 <Samu> sometimes tile_start is the tile that is on the cursor, sometimes it is the tile at the other side of the aqueduct
21:47:38 <Samu> and yet they're still called tile_start
21:50:41 <Samu> i need to create an error depending on the current slope configuration of the tile that is on the cursor
21:51:20 <Samu> if (!IsInclinedSlope(tileh_north_aqueduct) && !IsInclinedSlope(GetTileSlope(tile_end))) return_cmd_error(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION);
21:51:44 <Samu> i hope this is enough
21:52:37 *** HerzogDeXtEr has joined #openttd
21:52:37 <Alberth> no
21:53:12 <Alberth> where you started building a bridge is lost after line 74
21:53:38 <Alberth> tile_start is the smallest tile, always after line 74
21:54:32 <Alberth> if you want to preserve that information, you need to introduce new variables for the sorted tiles
21:55:16 *** andythenorth has quit IRC
21:56:26 <Alberth> but losing where you started building seems like a good thing to me, it means it makes no difference how you lay down the bridge, you'll always get the same result
21:57:18 <Samu> it makes for the error
21:57:47 <Samu> there is a weird behaviour happening when clicking on non-inclined slope
21:57:56 <Samu> it builds the aqueduct
21:59:09 <Samu> sometimes with an assert
22:01:21 <Samu> * @param p1 packed start tile coords (~ dx)
22:01:53 <Samu> * @param end_tile end tile
22:02:38 <Samu> which one is the cursor?
22:03:40 *** Arveen has quit IRC
22:04:08 <Wolf01> https://1drv.ms/u/s!AgUFeOGLNNfVhb9ZJPHngM3G3LY0Lg any chance to avoid the continuous trigger whan moving the mouse? I get the terrain to max height in less than 1 second :(
22:05:18 <Wolf01> (also it raises only, I want it to get the height of the tile under the mouse and apply that)
22:07:45 <Samu> GetTileZ or GetTileMaxZ
22:09:20 <Samu> there's a end_tile and a tile_end
22:09:25 <Wolf01> Eh, I have only "direction" -> up/down
22:10:07 <Wolf01> I should use the TerraformTileHeight directly, but I don't want to reinvent the wheel
22:10:45 <Alberth> there is no cursor any more
22:13:42 <Samu> end_tile is always the same, doesn't swap
22:14:02 <Samu> tile_end can swap with tile_start
22:14:11 <Samu> tile_start can swap with tile_end
22:15:14 <Samu> end_tile is the tile where the cursor clicked
22:15:17 <Samu> apparently
22:15:37 <Samu> p1 is the other side of the aqueduct
22:15:51 <Samu> let's see if this is always true in every case
22:23:38 <Wolf01> Would it be possible to change the _multi_terraform_coords array to put in the center the tile under the mouse?
22:41:47 <Samu> DC_AUTO | DC_NO_WATER (10) - grrr, how do i remove the DC_NO_WATER
22:42:22 <Samu> ret = DoCommand(tile_start, tileh_north_aqueduct, 1, flags, CMD_TERRAFORM_LAND);
22:43:25 <Samu> bridges can't be built on water, that's fine, but for the terraform command, i might think it's a good idea that water can be altere
22:43:33 <Wolf01> How did you remove slopes before
22:43:55 <Samu> flags ^ DC_NO_WATER ?
22:43:58 <Wolf01> Or you can prepare the terrain before building the bridge
22:44:34 <Wolf01> (checking for ret.Error() to be false before building the bridge)
22:44:34 <Samu> i want to keep DC_AUTO
22:46:19 <Samu> m1 DC_EXEC | DC_AUTO | DC_QUERY_COST | DC_BANKRUPT | DC_NO_CARGO_CAP_CHECK | 8192 (8519) DoCommandFlag
22:46:22 <Samu> oops...
22:48:06 <Samu> flags DC_QUERY_COST | DC_NO_WATER | DC_BANKRUPT | DC_AUTOREPLACE | DC_NO_MODIFY_TOWN_RATING | DC_FORCE_CLEAR_TILE | -858996736 (-858993460) DoCommandFlag
22:48:24 <Samu> flags DC_AUTO | DC_NO_WATER (10) DoCommandFlag
22:48:38 <Samu> darn it, i want to get rid of DC_NO_WATER
22:48:58 *** Alberth has left #openttd
22:49:22 <Samu> flags DC_AUTO (2) DoCommandFlag
22:49:25 <Samu> ah, i did it!
22:49:43 <Samu> ret = DoCommand(tile_start, tileh_north_aqueduct, 1, flags & ~DC_NO_WATER, CMD_TERRAFORM_LAND);
22:50:25 *** frosch123 has quit IRC
22:50:59 *** Keridos has joined #openttd
23:12:19 *** Biolunar has joined #openttd
23:28:36 <Samu> I think i'm done with aqueducts
23:28:43 <Samu> i'm not getting any errors now
23:28:59 <Samu> "I did it!", cough
23:29:28 <Samu> aqueduct pricing is still ridiculously high
23:29:39 <Samu> but that's another matter
23:29:56 <Wolf01> Nah, I think an aqueduct costs way more than a bridge also for real
23:32:12 <Samu> ridiculous price of aqueduct + price of leveling land on water
23:32:19 <Samu> = mucho price
23:36:47 <Samu> moving on to ship depot
23:36:55 <Wolf01> 'night
23:37:02 *** Wolf01 has quit IRC
23:41:42 *** Supercheese has joined #openttd
23:42:58 *** keoz has quit IRC
23:56:13 *** Biolunar has quit IRC