IRC logs for #openttd on OFTC at 2018-02-08
            
00:07:41 *** ZexaronS has quit IRC
00:08:56 *** ZexaronS has joined #openttd
00:38:04 *** Biolunar has quit IRC
00:58:27 *** Flygon has joined #openttd
01:18:44 *** FLHerne has quit IRC
01:34:02 *** Samu has quit IRC
01:43:39 *** Flygon_ has joined #openttd
01:51:00 *** Flygon has quit IRC
02:26:47 *** supermop has joined #openttd
02:40:14 *** Gja has quit IRC
02:43:02 *** efess has quit IRC
02:44:53 *** supermop has quit IRC
02:46:26 *** Supercheese has quit IRC
03:26:49 *** supermop has joined #openttd
03:34:51 *** supermop has quit IRC
04:02:13 *** ToffeeYogurtPots_ has quit IRC
04:02:31 *** ToffeeYogurtPots_ has joined #openttd
04:08:17 *** sim-al2 has joined #openttd
04:21:49 *** supermop has joined #openttd
05:08:32 *** supermop has quit IRC
05:12:24 *** glx has quit IRC
05:15:53 *** sla_ro|master has joined #openttd
05:17:56 *** Snail has quit IRC
06:35:47 *** michi_cc has quit IRC
06:44:09 *** cHawk has quit IRC
06:48:30 *** Ttech has quit IRC
06:50:52 *** Cubey has quit IRC
06:58:04 *** Ttech has joined #openttd
07:02:13 *** sla_ro|master has quit IRC
07:07:16 *** Supercheese has joined #openttd
07:08:12 *** cHawk has joined #openttd
07:12:56 *** cHawk has quit IRC
08:08:33 *** Supercheese has quit IRC
08:23:19 *** andythenorth has joined #openttd
08:30:22 *** sim-al2 has quit IRC
08:32:28 *** john-aj has joined #openttd
08:33:21 *** Biolunar has joined #openttd
09:00:15 *** andythenorth has quit IRC
09:02:53 *** michi_cc has joined #openttd
09:02:53 *** ChanServ sets mode: +v michi_cc
09:25:41 *** andythenorth has joined #openttd
09:27:43 *** john-aj has quit IRC
10:11:21 *** stefino has joined #openttd
10:12:51 <stefino> hi, problem about socket what I had yesterday was due my internet connection. I sent files to my friend and upload was succesfuly done :) so thanks again for help with writing .ini etc :)
10:15:03 *** andythenorth has quit IRC
10:17:26 <stefino> and one graphics question now. My friend try to code bridges and we dont know if it is possible to make own graphics for road and train bridge. Because in basic ottd or in Total Bridge Replacement, bridges has the same front bridges sprites and only background was changed (sprites with road/rails/..). But we want to make two different graphics for road/train bridge
10:21:50 <stefino> NFO manual said "Property 0D sets the sprite layout for bridges. Each part of a bridge has eight sprites for each of the four types (rail, road, monorail, maglev), making 32 sprites in total. Each bridge has 7 parts, though not all of them have different graphics." First part said that it is possible or not? And the same foregrounds for road/train bridges in current GRFs are only due simplification?
10:23:57 *** andythenorth has joined #openttd
10:24:56 *** Samu has joined #openttd
10:24:59 <Samu> hi
10:35:45 *** ToffeeYogurtPots_ has quit IRC
10:48:48 *** andythenorth has left #openttd
10:52:51 *** stefino has quit IRC
11:00:50 *** FLHerne has joined #openttd
11:08:04 *** tokai|noir has joined #openttd
11:08:04 *** ChanServ sets mode: +v tokai|noir
11:13:08 *** michi_cc has quit IRC
11:15:02 *** tokai has quit IRC
11:23:08 *** michi_cc has joined #openttd
11:23:08 *** ChanServ sets mode: +v michi_cc
11:29:42 <Samu> i fail at these constructors
11:32:05 <Samu> what do I need to save and what do I need to load?... in a first look, nothing
11:32:21 <Samu> but apparently I need to keep track of goal_ids
11:32:45 <Samu> only need to know if the goal was already assigned
11:33:23 <Samu> I can reconstruct the goal at any time
11:36:54 <Samu> I don't need to monitorize cargoes, busybeee code here is confusing me, i need help
11:36:59 <Samu> st2 halp
11:49:48 <Samu> who's online now?
12:00:57 *** Biolunar has quit IRC
12:24:52 *** FLHerne has quit IRC
12:52:07 *** FLHerne has joined #openttd
12:52:22 <Samu> i need to understand constructors and i just can't visualize it in my mind
13:08:05 *** roidal has joined #openttd
13:13:12 *** FLHerne has quit IRC
13:43:54 *** roidal has quit IRC
13:49:07 *** roidal has joined #openttd
13:57:39 *** Gja has joined #openttd
14:13:30 *** Snail has joined #openttd
14:41:14 *** Flygon_ has quit IRC
14:44:23 *** sim-al2 has joined #openttd
14:44:24 *** Snail has quit IRC
15:13:55 <Samu> i found a bug in busybee
15:14:11 <Samu> it collects 16 companies, while there's only 15
15:16:36 <Samu> for (local comp_id = GSCompany.COMPANY_FIRST; comp_id <= GSCompany.COMPANY_LAST; comp_id++) {
15:16:38 <Samu> line 113
15:16:42 <Samu> main.nut
15:17:11 <Samu> <= should be <
15:18:06 <Samu> also in line 426
15:20:01 <Samu> ST2: can u report this for me?
15:20:10 <Samu> i dont have openttdcoop acount
15:20:20 <ST2> me neither
15:20:38 <Samu> someone else then?
15:20:55 <ST2> try BB thread at tt-forums
15:21:09 <Samu> oh right, i forgot it has a topic
15:21:34 <ST2> https://www.tt-forums.net/viewtopic.php?t=72498
15:23:50 <Samu> copy pasted
15:24:08 <Samu> too lazy atm
15:51:39 *** supermop_work has quit IRC
15:53:39 *** supermop_work has joined #openttd
15:54:27 *** sim-al2 has quit IRC
16:02:03 *** supermop_work_ has joined #openttd
16:03:42 *** supermop_work has quit IRC
16:05:16 *** nielsm has joined #openttd
16:09:32 *** Alberth has joined #openttd
16:09:32 *** ChanServ sets mode: +o Alberth
16:36:32 *** Speedy has quit IRC
16:57:11 <Samu> Alberth: hi
17:01:42 <Samu> i'm studying busy bee code and trying to adapt it to deal with company value :(
17:02:09 <Samu> first thing I wanted to do is remove all that cargo from the code, and I can't manage to separate things
17:03:03 <Samu> I'm stuck in here function CompanyGoal::AddMonitorElement(mon)
17:04:13 <Samu> i don't have a cargo table
17:04:46 <Samu> I don't think i need to monitorize anything of that kind either, town or industry
17:06:10 <Samu> what I need to monitorize is the current company value and the target goal value
17:07:26 <Samu> target goal value can change at any time, it is a user defined value that can be configured at will
17:32:33 *** Thedarkb has joined #openttd
17:32:35 <Alberth> you're correct wrt cargo stuff
17:32:45 *** Wormnest has joined #openttd
17:33:01 <Alberth> most likely you can remove most of the bee, as it's completely aimed at cargo
17:33:29 <Alberth> as for companies, no idea, I have no interest in them, so I never studied their properties
17:34:49 <Samu> i think i better start this from fresh again
17:35:34 <Alberth> bee won't give you much I think, except some ideas about global structure perhaps
17:40:34 *** Stimrol has joined #openttd
17:41:28 *** Cubey has joined #openttd
17:43:28 *** Thedarkb has quit IRC
17:54:42 *** TheMask96 has quit IRC
17:56:45 *** TheMask96 has joined #openttd
18:01:16 *** Thedarkb has joined #openttd
18:20:10 *** Stimrol has quit IRC
18:21:48 *** Thedarkb has quit IRC
18:23:40 *** Thedarkb has joined #openttd
18:26:55 *** HerzogDeXtEr has joined #openttd
18:30:33 *** Stimrol has joined #openttd
18:40:36 <Samu> ok i gave up on bee
18:46:14 <Alberth> seems ok, as it doesn't seem to fit your goals anyway
18:52:28 *** Gustavo6046 has joined #openttd
18:54:20 <Samu> speaking of goals
18:54:26 <Samu> how do i save a goal!
18:54:44 <Samu> gonna try with the global goal first
18:55:59 <Samu> GSGoal.New(GSCompany.COMPANY_INVALID, GSText(GSText.STR_GOAL_CV, GSController.GetSetting("value")), GSGoal.GT_NONE, 0)
18:56:28 <Samu> this.global_goal = that?
18:56:35 <Alberth> seems long enough for you :)
18:56:51 <Samu> what is that 0 as destination for
18:57:10 <Samu> is it goal_id?
18:57:16 <Samu> unused?
18:57:20 <Alberth> have a look at GSGoal.New
18:57:26 <Samu> ok
18:57:36 <Alberth> in the GS api docs
18:57:46 <Samu> yes i have it here
18:57:47 <Samu> https://nogo.openttd.org/api/1.7.2/classGSCompany.html#09ddb9c516f2f82254eedb44ad1ce98b
18:58:20 <Samu> https://nogo.openttd.org/api/1.7.2/classGSGoal.html#8cfd4e97008202b4f9e8e7d61297d54f
18:58:22 <Samu> nevermind
18:59:16 <Samu> The destination of the type type.
18:59:20 <Samu> :(
18:59:47 <Alberth> if the destination is an industry, the index number of the industry
19:00:02 <Alberth> if the destination is a town, the index number of the town
19:00:03 <Alberth> etc
19:00:15 <Samu> it is a GT_NONE
19:00:47 <Alberth> no goal thus, any number will do
19:01:21 <Samu> i see
19:02:10 *** glx has joined #openttd
19:02:10 *** ChanServ sets mode: +v glx
19:02:18 <Alberth> hola
19:02:26 <Samu> hi
19:03:20 <Samu> i still dont know what's a constructor supposed to do
19:03:31 <Samu> the examples i've seen aren't clear enough
19:04:33 <LordAro> Samu: have you considered searching the internet?
19:07:32 *** sla_ro|master has joined #openttd
19:07:49 <Alberth> constructor seems like a bad word to search :)
19:12:20 <glx> oh there are way worse words to search
19:12:22 <Alberth> Samu: you understand that class and object are two different things?
19:14:08 <Samu> i don't know
19:14:36 <LordAro> glx: "go" is always fun
19:17:45 <Wormnest> internet provider called ¨online¨ is really wonderful too
19:19:49 <Samu> dbg: [script] [18] [S] Your script made an error: class instances do not support the new slot operator
19:19:55 <Samu> i'm terrible
19:20:15 <Samu> i get never seen before errors
19:20:31 <Alberth> false, I have had that one too :)
19:20:47 <Alberth> define all variables in the class
19:21:01 <Alberth> you can't make new variables in an object
19:21:23 <Samu> the main class is
19:21:29 <Samu> class CompanyValue extends GSController
19:21:41 <Samu> { companies = null global_goal = null loaded = false function Start() function Save() function Load(version, data); }
19:21:43 <Samu> got these
19:21:53 <Samu> not sure if i need more, or ...
19:22:07 <Alberth> needs some semicolons I assume
19:22:13 <Samu> ok
19:22:56 <Alberth> but "companies = null;" declares a varaible "companies" with initial value null
19:23:15 <Alberth> so you can just assign to it after making an object from the class
19:23:30 *** john-aj has joined #openttd
19:23:32 <Alberth> rather than obj.companies <- ...
19:28:57 <Samu> make an object from the class?
19:30:05 <Alberth> a class is like a template, a general shape
19:30:34 <Alberth> an object is a copy of it, and then further filled, eg values for all variables, etc
19:31:02 <Alberth> you can have several such objects, each with different values
19:31:20 *** andythenorth has joined #openttd
19:31:23 <Alberth> making a copy and further adding values is done by the constructor
19:34:01 *** frosch123 has joined #openttd
19:34:25 <andythenorth> lo
19:35:20 <glx> constructor constructs an object from the class
19:35:44 <glx> and usually inits the default values
19:36:28 <Samu> // Construct empty companies. this.companies = {};
19:36:50 <glx> that's not a construction, it's an initialisation
19:37:41 <glx> to an empty array (or something similar, I don't remember the squirrel syntax)
19:37:54 <Samu> table?
19:38:03 <Samu> slots?
19:39:09 <Samu> trying to understand this this.companies[comp_id] <- null;
19:39:36 <Samu> this.companies is the same as companies?
19:40:33 <Samu> comp_id is a value from 0 to 14
19:40:42 <Samu> then <- null which i dont get it
19:43:27 <Samu> this.companies[0]m this.companies[1], this.companies[2]
19:43:38 <Samu> all <- null
19:43:48 <glx> ah yes it's a table so it stores stuff using a key/value relation
19:45:53 <glx> <- creates the slot for comp_id if it doesn't exist
19:46:02 <Samu> seems that the <- is like a piece of a whole
19:46:21 <glx> else it just works like =
19:46:25 <Samu> an arm, connected to a body
19:46:39 <glx> http://squirrel-lang.org/doc/squirrel2.html#d0e961
19:46:45 <Samu> can't yet visualize how it works
19:46:54 <glx> it's all in the docs :)
19:47:52 <glx> and http://squirrel-lang.org/doc/squirrel2.html#tables
19:48:04 *** Progman has joined #openttd
19:54:52 <frosch123> hoi
19:59:19 <Alberth> hola
20:04:47 <LordAro> Samu: just think of it as a weird "="
20:06:50 <Samu> so it's not a connector
20:13:08 <LordAro> ...a connector?
20:17:21 <Samu> i still don't know how to save and load a simple goal :(
20:19:37 *** cHawk has joined #openttd
20:19:39 *** Supercheese has joined #openttd
20:24:13 *** gelignite has joined #openttd
20:24:54 <Samu> https://paste.openttdcoop.org/pbi1mdbva
20:25:03 <Samu> I have this code
20:25:24 <Samu> how am I saving that goal and loading it back correctly as to not show as duplicated
20:28:17 *** Thedarkb has quit IRC
20:28:47 <Samu> https://imgur.com/a/zknjd
20:28:58 <Samu> that's what I get after loading
20:29:28 <Samu> changing the target value will change the value of the second goal now :( I wanted to re-link to the goal alredy there
20:31:07 <Alberth> you're not saving or loading anything
20:31:21 <Samu> all my attempts to save have failed me
20:33:10 <Alberth> you noticed the GoalID coming out of the New call?
20:34:03 <Alberth> a goal that already exists doesn't need to be created again, I'd think
20:34:04 <Samu> uh, yeah, i figured it had to keep track of something
20:34:16 <Samu> but how do i ... keep it in hand
20:34:40 <Alberth> you have it in global_goal?
20:35:15 <Alberth> if you want it between load and save, you need to store it in the save data, and load it back on loading
20:36:07 <Samu> ok, for saving, let me think
20:37:43 <Samu> return {gg = this.global_goal}
20:38:46 <Samu> hmm for loading...
20:39:59 *** ToffeeYogurtPots has joined #openttd
20:40:10 <Samu> this.global_goal = data.gg; ?
20:40:12 <Samu> gonna try
20:40:50 <Samu> nop
20:40:52 <Samu> :(
20:41:27 <Samu> still getting 2 goals :(
20:42:32 <Alberth> a New always makes a new goal
20:42:47 <Alberth> so don't do that if you already have enough goals
20:44:51 *** ToffeeYogurtPots has quit IRC
20:45:21 <glx> in Start() don't create a new goal if one has been loaded
20:45:25 *** ToffeeYogurtPots has joined #openttd
20:45:29 <glx> that's all
20:45:46 <Alberth> bee has two paths, one is for a new game, where you don't load anything, and one is for startup after loading from a savegame
20:46:08 <Alberth> so before you make a new goal, check if something got loaded
20:46:20 <glx> because Load() is called before Start()
20:47:31 <glx> with an has_goal value defaulting to false it should be easy
20:48:05 <glx> if (!has_goal) { create goal, set has_goal to true}
20:48:19 <glx> and you save and load both
20:48:28 <glx> goal and bool
20:50:00 <glx> it's also doable without an extra variable, just checking if goal is null before creating it
21:15:54 *** stefino has joined #openttd
21:16:53 <stefino> hello guys...I asked at morning but no answer here si I'll try it agains
21:17:11 <stefino> My friend try to code bridges and we dont know if it is possible to make own graphics for road and train bridge. Because in basic ottd or in Total Bridge Replacement, bridges has the same front bridges sprites and only background was changed (sprites with road/rails/..). But we want to make two different graphics for road/train bridge
21:17:27 <stefino> NFO manual said "Property 0D sets the sprite layout for bridges. Each part of a bridge has eight sprites for each of the four types (rail, road, monorail, maglev), making 32 sprites in total. Each bridge has 7 parts, though not all of them have different graphics." First part said that it is possible or not? And the same foregrounds for road/train bridges in current GRFs are only due simplification?
21:18:02 <stefino> Thanks :)
21:20:41 <Samu> if (this.global_goal == null)
21:20:55 <Samu> why the heck does this work now, when I tried, it failed :(
21:21:07 <Samu> well, thx
21:24:39 *** andythenorth has quit IRC
21:24:57 <frosch123> road and rail are different
21:25:17 <frosch123> bridge replacement is mostly replacing original graphics
21:25:31 <frosch123> so everything that looked different in original graphics, can look different
21:25:44 <frosch123> and original graphics contain the track graphics
21:26:17 <stefino> I looked that basic bridges and for example Total replacement bridges hase the same foreground so we were not sure if is only simplification or any rule :)
21:26:39 <frosch123> use the sprite alignment tool to check whether they are the same sprite number
21:29:55 <stefino> I thik so because there is one foreground sprite and 4 background(road/track include)
21:30:23 <frosch123> anyway, the bridge layouts are separate for the transport types
21:31:11 <frosch123> the bridge layout specifies 7*4*2*4 sprites
21:31:54 <frosch123> 7 positions along the bridge, 4 transport types (rail, road, mono, magl), 2 orientations, 4 layers (back, front, pillar, unused)
21:32:14 <frosch123> ok, "unused" is not really a sprite, so 7*4*2*3 sprites
21:32:17 *** andythenorth has joined #openttd
21:32:47 <stefino> ok ok :) this is what I need to know :) thanks :)
21:33:20 <frosch123> stefino: anyway, essentially it means you can provide different graphics for transport types, but it also means that you must provide graphics for them. you cannot just replace road sprites
21:34:01 <frosch123> you cannot have separate grfs providing rail and road bridges, they replace each other
21:34:14 <stefino> and about my problem from yestarday - socket error...it was somethink about my internet connection. I sent all program to my friend and he open it and load it succesfully.
21:34:34 <frosch123> nice, so at least we know that the server worked :)
21:34:44 <stefino> yes yes...we will make our new NFO code for bridges...not only replace :)
21:35:07 <stefino> but we didn't know if it is possible to do :)
21:35:11 <frosch123> well, don't get too excited :p there are only 7 bridge pieces
21:35:18 <frosch123> you cannot make arbitrary looking bridges
21:35:30 <frosch123> they have very specific patterns
21:37:08 *** gelignite has quit IRC
21:37:33 <Samu> wow, holy molly, it works, wow! omg thx
21:37:36 <Samu> for (local cid = GSCompany.COMPANY_FIRST; cid != GSCompany.COMPANY_LAST; cid++) { if (this.companies[cid] == null) this.companies[cid] = GSGoal.New(cid, GSText(GSText.STR_GOAL_CV, GSController.GetSetting("value")), GSGoal.GT_COMPANY, cid) }
21:39:45 <stefino> yes yes...we only want to make simple bridges for road and rails. because roads has for example sidewalks, bridges for trains are narrower etc :)
21:44:50 <andythenorth> I thought bridges is bridges?
21:58:53 *** Alberth has left #openttd
21:59:26 *** stefino has quit IRC
22:03:07 *** roidal has quit IRC
22:06:53 *** nielsm has quit IRC
22:35:20 *** Thedarkb has joined #openttd
22:38:24 *** sla_ro|master has quit IRC
22:48:09 *** frosch123 has quit IRC
22:55:48 *** andythenorth has quit IRC
23:32:01 *** FLHerne has joined #openttd
23:37:56 *** HerzogDeXtEr has quit IRC
23:38:48 *** john-aj has quit IRC
23:44:34 *** Wormnest has quit IRC
23:45:18 *** Stimrol has quit IRC
23:48:17 <Samu> st2 u there
23:48:38 <ST2> yes, but busy! short questions are fine ^^
23:49:00 <Samu> would you like to be the first beta tester :p
23:49:03 *** Progman has quit IRC
23:50:31 <ST2> I'm on the middle of setting a CB server with YETI, NUTS and some other crazy things I remembered xD
23:50:41 <ST2> (thx to newgrf makers :)
23:52:00 <Samu> t.t