Newgrf : Action 00 for Houses v.0.2.5 (SourceForge Submit)

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

OK, how did I miss the fact that Patchman had posted?
EDITed out stuff to which Patchman had responded.
belugas wrote:I think I read somewhere that [OTTD] only uses WinPalette.
It seems that this is true. I tested with the DOS grf files and NightTTD. The Win version of NightTTD worked; the DOS version did not.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
Celestar
Director
Director
Posts: 574
Joined: 02 Jul 2004 10:56
Contact:

Post by Celestar »

You needa run openttd with -i to force it to the DOS palette

Celestar
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Post by belugas »

belugas wrote:
Patchman wrote:This should really be a new variable that's 0 for patch and 1 for OTTD.
belugas wrote:Indeed, it would be the best solution. BUt who am I to ask for the Patch to change? :oops:
Is it hard to implement a new one?
Not at all.

[5 seconds later.]

Done.

(Sorry, just a bit too late to make it into alpha 65 :mrgreen:)
Thanks Patchman, you're very kind.
And as a bonus, you even updated the wiki Action 07/09 page ! That is nice!

So for everyone who might be interested :
Action 7/9 has a new variable :

Code: Select all

Var   : 9D
Size  : D
Value : TTD Platform, 0=TTDPatch, 1=OpenTTD
I think I have made myself a new patch opportunity!
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Post by belugas »

Celestar wrote:You needa run openttd with -i to force it to the DOS palette
Celestar
Question about that :

I have searched the code and found that this coomand line parameter sets thwe variable _use_dos_palette (declared in gfx.h, as VARDEF bool _use_dos_palette;)to true. But nowhere have I found an initialization of the variable (or so I think). In gfxinit.c, function CheckExternalFiles, I do see what could be seen as an init, but the first test is already checking for _use_dos_palette value...

Code: Select all

	if (_use_dos_palette) {
		return;
	} else if (win == 5) {
		_use_dos_palette = false;
	} else if (dos == 5 || (win == 0 && dos > 0)) {
		_use_dos_palette = true;
	} else {
		_use_dos_palette = false;
	}
Am I right? Is it required?

If i'm right, what about putting it in openttd.c, function ttd_main, along with

Code: Select all

	_game_mode = GM_MENU;
	_switch_mode = SM_MENU;
	_switch_mode_errorstr = INVALID_STRING_ID;
	_dedicated_forks = false;
	dedicated = false;
	_config_file = NULL;
	---->  _use_dos_palette = false;
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Post by belugas »

Here the fun really kicks in!

What about a grf that enable ALL TYPES of churches in temperate climate?
Attachments
AllChurchesInTemp.grf
(76 Bytes) Downloaded 163 times
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
User avatar
Born Acorn
Tycoon
Tycoon
Posts: 7595
Joined: 10 Dec 2002 20:36
Skype: bornacorn
Location: Wrexham, Wales
Contact:

Post by Born Acorn »

I hope this can slowly expand to be able to support Zimmlocks TTRS :wink:
Image
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Post by belugas »

That is the secondary goal. Ttrs(x) is so inspiring... :bow:
First one is a promise I made to dmh_mac. And i'm so far from fulfilling it...

In what kind of trouble have I stepped in..... :roll:
I like it so far, though.... :)
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Post by belugas »

I have a bit of a problem understanding this piece of code, from town_cmd.c :

Code: Select all

static void MakeTownHouseBigger(TileIndex tile)
{
        uint flags = _housetypeInfos[_m[tile].m4].more_flags;
        if (flags & 8) MakeSingleHouseBigger(TILE_ADDXY(tile, 0, 0));
        if (flags & 4) MakeSingleHouseBigger(TILE_ADDXY(tile, 0, 1));
        if (flags & 2) MakeSingleHouseBigger(TILE_ADDXY(tile, 1, 0));
        if (flags & 1) MakeSingleHouseBigger(TILE_ADDXY(tile, 1, 1));
}
I understand the flags & 8,4,2,1 thing (checkng for a bit) but i'm puzzled about the TILE_ADDXY macro.
The point is : I think it is about coordinates, but I don't know where the tiles will be added.

Code: Select all

   /\         
  /  \        
 /\A /\     
/  \/  \    
\B /\C /  
 \/  \/      
  \D /      
   \/  
So, first of all, am I in A,B,C or D?
If flag = 8, what will it do? I'm in B and it will add in C?
Or else ?( :roll:
That is one of the last things I need to figure out before next release...
So please, any hint, pointer, suggestion, documentation will be more then welcome!
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Post by belugas »

I have just finished a new release of the patch.
This time, we are getting a bit more visual! We can now specify random colors to apply to buildings(or change current ones). Later this weekend, i will finish a little grf replacing a park into a full featured colored tall office, for all to see.

I would really appreciate if anyone could test it out.
The way houses are managed have somewhat been changed. Although I'm confident it works (after countless hours at watching towns growth), something might have eluded me.
With or without grfs, it is totally up to you.
Thanks in advance :D
Attachments
It is not the cutest building been showned here.  I'm no artist in drawing, but it will serve the purpose all right.
<br />If anyone wants to propose or modify it, go ahead!
<br />I have this building in front of me week long... inspiring...
It is not the cutest building been showned here. I'm no artist in drawing, but it will serve the purpose all right.
If anyone wants to propose or modify it, go ahead!
I have this building in front of me week long... inspiring...
VilleMarie.png (1.32 KiB) Viewed 3953 times
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1734
Joined: 30 Mar 2005 09:43

Post by peter1138 »

Belugas, please use a text editor that doesn't mess with tabs and spacing, and also have a look at the content of the diff you make.

If you have a look through your 460KB (!!) patch you'll see a *lot* of totally irrelevent changes that are just replacing tabs with spaces.
He's like, some kind of OpenTTD developer.
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Post by belugas »

You are right peter1138. Sorry I have to admit I did not saw how big the patch was... :oops:
I had the feeling tabs are not welcome in source code, mainly because not everyone uses the same spacing, meaning strange looking code.
That is why I reformated the files.
Now : in using tabs, what would be the proper settings? Is there a consensus on it? If so, I have not seen it in the Coding Style document.

Either way, i'm restoring now the files in a less intrusive way.
But you have to understand that town_land.h is almost a new file, thus a big part of the size of the patch. Tonight, I'll send the updated-unformated patch, along with another one, consisting only of town_land.h That way, it would be easier to see the changes.

Does it suits you better? By "you", I mean Peter1138 as well as all the others who showed interest in this patch

Ho.. I'm using delphi as an editor, at the office at least. At home, it is MSCV6
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1734
Joined: 30 Mar 2005 09:43

Post by peter1138 »

The deal with using tabs is that it means you can in fact use your own prefered tab depth... With spaces you're stuck with what the original coder used.

However, do use spaces for lining up columns in tables, etc.
He's like, some kind of OpenTTD developer.
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Post by belugas »

peter1138 wrote:The deal with using tabs is that it means you can in fact use your own prefered tab depth... With spaces you're stuck with what the original coder used.

However, do use spaces for lining up columns in tables, etc.
It is done and delivered. What a job... :shock:

Thanks for pointing it out. I hope you can now fully evaluate the work. Hoping the note will be good enough :D

My collegues and I are always using space, leaving an homogeonous look both on prints and on screen, when we have to help one another. I though it makes more sens. Other places, other cultures... :roll:
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Post by belugas »

Here is the test grf I've spoken about.
Included is a zip file, with all that is needed in order to get the think working, with commentaries in the NFO file too...

If you want to play with this building, of course, you'll need OR my binary (top post of the topic) OR the Patch. Current OpenTTD cannot do it.
The only thing you migh see, is the building instead of the statue it is replacing.
But it won't indicate Tall Office Block, nor will it generate a LOT of passenger/mail, nor does it will cost a BUNDLE to demolish...

Random colours seem to be "broken" or maybe it was ot compiled. I'l see it as soon as I can
Attachments
This one shows the properties of the building itself.  Not too bad for what used to be a statue...
This one shows the properties of the building itself. Not too bad for what used to be a statue...
screenshot #1.png (86.1 KiB) Viewed 3772 times
VilleMarie.zip
NFO (with comments) + PCX + GRF
(2.82 KiB) Downloaded 131 times
This screenie shows the random colors in action. I know the building sucks, don't need to remind me...
This screenie shows the random colors in action. I know the building sucks, don't need to remind me...
screenshot #3.png (80.87 KiB) Viewed 3691 times
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Post by belugas »

I have just posted version 0.2.5
Nothing spectacular has changed.
The code is better written, as are the comments.
I removed unecessary changes and so on.

I do have some good ideas for next release. I think I will make it a try as to add new graphics other then by simply replacing them.

Also, I think it is time to post that patch, as it is, on SourceForge.
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
dmh_mac
Transport Coordinator
Transport Coordinator
Posts: 278
Joined: 25 Apr 2005 18:18

Post by dmh_mac »

Will the shopping mall I made a while back have random colours with this?
MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

Great job Belugas. There is one thing I'm wondering about: on the first picture attached, there is no amount of passengers, mail and goods. Does it mean it is 8/8 (full) or it is a bug?
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Post by belugas »

dmh_mac : Yes, now it can be.
I did not told you so, because I have to make a new grf for it. I have two things to do before...

MeusH: Ain't a bug. If yuo do not see digits, it means full (8/8) Good observation. By the way, this is standard behaviour, not a new feature from my patch.
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
Jango
Traffic Manager
Traffic Manager
Posts: 189
Joined: 28 Aug 2004 12:13

Post by Jango »

did this patch ever make it into the trunk?
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Post by belugas »

It is not up to me to say :)
Either way, i'm quite buzy with something much bigger right now ;)
I will resume that work anyway, for sure !
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Amazon [Bot] and 3 guests