IRC logs for #openttd on OFTC at 2018-02-08
        
        
        
            ⏴ go to previous day
00:08:56  *** ZexaronS has joined #openttd
 
01:43:39  *** Flygon_ has joined #openttd
 
02:26:47  *** supermop has joined #openttd
 
03:26:49  *** supermop has joined #openttd
 
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:15:53  *** sla_ro|master has joined #openttd
 
07:07:16  *** Supercheese has joined #openttd
 
08:23:19  *** andythenorth has joined #openttd
 
08:32:28  *** john-aj has joined #openttd
 
08:33:21  *** Biolunar has joined #openttd
 
09:02:53  *** michi_cc has joined #openttd
 
09:02:53  *** ChanServ sets mode: +v michi_cc
 
09:25:41  *** andythenorth has joined #openttd
 
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: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:35:45  *** ToffeeYogurtPots_ has quit IRC
 
10:48:48  *** andythenorth has left #openttd
 
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: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
 
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
 
14:44:23  *** sim-al2 has joined #openttd
 
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:20:01  <Samu> ST2: can u report this for me?
 
15:20:10  <Samu> i dont have openttdcoop acount
 
15:20:55  <ST2> try BB thread at tt-forums
 
15:21:09  <Samu> oh right, i forgot it has a topic
 
15:53:39  *** supermop_work has joined #openttd
 
16:02:03  *** supermop_work_ has joined #openttd
 
16:09:32  *** Alberth has joined #openttd
 
16:09:32  *** ChanServ sets mode: +o Alberth
 
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:56:45  *** TheMask96 has joined #openttd
 
18:01:16  *** Thedarkb has joined #openttd
 
18:23:40  *** Thedarkb has joined #openttd
 
18:26:55  *** HerzogDeXtEr has joined #openttd
 
18:30:33  *** Stimrol has joined #openttd
 
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: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:20  <Alberth> have a look at GSGoal.New
 
18:59:16  <Samu> The destination of the type type.
 
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:47  <Alberth> no goal thus, any number will do
 
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: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: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: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:53  <Samu> not sure if i need more, or ...
 
19:22:07  <Alberth> needs some semicolons I assume
 
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: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: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: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:45  <Samu> can't yet visualize how it works
 
19:48:04  *** Progman has joined #openttd
 
20:04:47  <LordAro> Samu: just think of it as a weird "="
 
20:17:21  <Samu> i still don't know how to save and load a simple goal :(
 
20:19:39  *** Supercheese has joined #openttd
 
20:24:13  *** gelignite has joined #openttd
 
20:25:24  <Samu> how am I saving that goal and loading it back correctly as to not show as duplicated
 
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:39:59  *** ToffeeYogurtPots has joined #openttd
 
20:40:10  <Samu> this.global_goal = data.gg; ?
 
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: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: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: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: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: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?
 
22:35:20  *** Thedarkb has joined #openttd
 
23:32:01  *** FLHerne has joined #openttd
 
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:50:31  <ST2> I'm on the middle of setting a CB server with YETI, NUTS and some other crazy things I remembered xD
 
continue to next day ⏵