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

Powered by YARRSTE version: svn-trunk