Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Thu Feb 21, 2019 5:02 pm

All times are UTC




Post new topic  Reply to topic  [ 30 posts ]  Go to page 1 2 Next
Author Message
PostPosted: Sun Jun 20, 2010 4:38 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5431
Location: Canada
Finally, newobjects are a reality. :D

UPDATE!!! Rubidium of OpenTTD Developer fame has completed OpenTTD implementation most admirably. :D

What are they? Eye-candy, pure and simple. They contribute absolutely nothing to game play other than costing money to build and occupying valuable real estate. They accept nothing and produce nothing. They are perfect for those who like to build good looking scenarios with an added touch of realism and grow those scenarios over time.

Newobjects can also be used to develop and preview structure sprites (aligning those pesky x-rels and y-rels) such as buildings, stations and industries before giving them properties and features and committing them to an appropriate set.

Credit must be given to Oskar for taking on my suggestion, to Lakie for furthering development and clearing up some bugs, to SAC for recognizing the potential, to Aegir for some early coding, to OzTrans for giving me the impetus to try my hand at some nfo coding and last but not least but more recently, Michael Blunck for inspiring some changes such as to the GUI (r2326 by eis_os). Thank you all. :D

To begin to use this feature, make sure that you have at least TTDPatch nightly r2360 and that newobjects is set to on in your ttdpatch configuration file. OpenTTD is supported as of v1.1.0-beta1 (aka nightly r21615).
The next post has some sample newobjects grf's to get you started, as well as links to some others in these forums.

The third post is a guide/tutorial should you wish to have a go at coding some of your own.

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018


Last edited by wallyweb on Tue Dec 28, 2010 10:19 am, edited 9 times in total.

Top
   
PostPosted: Sun Jun 20, 2010 4:38 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5431
Location: Canada
The impossibility of building TTDX's lighthouse and communications tower while playing a game has been an ongoing irritant to me. :x
Therefor, my first newobjects offering is a grf that features TTDX's lighthouse and communications tower. 8)
These files now include the TTDX rocks and feature the new GUI.

NOTE: Steep slopes are not supported.

I have produced a windows and a DOS version. Perhaps somebody with the DOS TTDPatch installed could kindly test the DOS version and report back. :wink:

Attachment:
File comment: The new GUI
newgui.png [31.77 KiB]
Downloaded 3 times

Attachment:
File comment: Windows version
TTD_landscapew.zip [17.94 KiB]
Downloaded 803 times

Attachment:
File comment: DOS version
ttdldscd.zip [17.69 KiB]
Downloaded 267 times

Links to other downloads:

Wallyweb's Objects
SAC's Objects


Last edited by wallyweb on Tue Dec 28, 2010 12:31 pm, edited 9 times in total.

Top
   
PostPosted: Sun Jun 20, 2010 4:38 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5431
Location: Canada
NOTE: Due to recent changes in the newobjects specifications and the addition of OpenTTD support, the coding guide WILL BE REVISED, just as soon as I get around to it.

NOTE: IT IS ASSUMED THAT THE CODER IS FAMILIAR WITH GRF NFO CODING.
THIS TUTORIAL IS MERELY A STRATEGY GUIDE FOR CODING NEWOBJECTS.
TTDPatch.cfg (minimum r2330) must have newobjects on

Rather than repeat a lot of information that is available elsewhere, I have extensively commented the nfo file which includes links to the appropriate TTDPatch wiki Action discussion ... simply copy and paste into your browser's address line.

Anybody familiar with house, industry and/or station coding should be comfortable with this presentation.

The Action0 property 08 is a special case and is discussed in the following post.

The sprites are coloured and numbered cubes which will aid in recognizing how it all goes together.

NOTE: The code below has benefited from a little revision suggested (with thanks :D ) by Michael Blunck and eis_os.
In the Action 0 properties 09 and 0A, D4 was changed to D0.
In the Action 4, "Ð[text]" was changed to D0 "[text]".

Code:
// Automatically generated by GRFCODEC. Do not modify!
// (Info version 7)
// Escapes: 2+ = 71 = D= = DR 2- = 70 = D+ = DF 2< = 7= = D- = DC 2> = 7! = Du* = DM 2u< = 7< = D* = DnF 2u> = 7> = Du<< = DnC 2/ = 7G = D<< = DO 2% = 7g = D& 2u/ = 7gG = D| 2u% = 7GG = Du/ 2* = 7gg = D/ 2& = 7c = Du% 2| = 7C = D% 2^ 2sto = 2s 2rst = 2r 2+ 2ror = 2rot
// Newobject Tutorial nfo file by Walter E. Bamberger
// With the assistance of Lakie who shall receive cookies
// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel
    0 * 4    47 00 00 00

//=====================================================================================
// NOTE: IT IS ASSUMED THAT THE CODER IS FAMILIAR WITH GRF NFO CODING.
// Link: http://wiki.ttdpatch.net/tiki-index.php?page=NewGraphicsSpecs
// THIS TUTORIAL IS MERELY A STRATEGY GUIDE FOR CODING NEWOBJECTS.
// TDPatch.cfg (r2321) must have newobjects on
//=====================================================================================

// Action 8 Define GRF ID, Name and Description
// Link: http://wiki.ttdpatch.net/tiki-index.php?page=Action8
// <sprite-number> * <length> 08 <version> <grf-id> <name> <description>
    1 * 63    08 07 "WB" 99 10 "Wally's Newobjects Tutorial v1.2" 00 "© 2010 Walter Bamberger" 00
//=====================================================================================
//All of the code in this file is freely available from the TTDPatch NewGraphicsSpecs pages and may be copied and/or modified at will.
//The cube graphics were created by me but they are very generic and the pcx file may be copied and/or modified at will.
//Credit would be nice but is not required.
//=====================================================================================
// Action 0 Defining new graphics feature properties
// Link: http://wiki.ttdpatch.net/tiki-index.php?page=Action0
// Properties link: http://wiki.ttdpatch.net/tiki-index.php?page=Action0Objects
// <Sprite-number> * <Length> 00 <Feature> <Num-props> <Num-info> <Id> (<Property <New-info>)...
    2 * 161    00 0F 09 07 00
      08 "CUBE" "CBX2" "CBX2" "CBX3" "CBX3" "CBXX" "CBXX"
      09 00 D0  02 D0  02 D0  05 D0  05 D0  08 D0  08 D0
      0A 01 D0  03 D0  04 D0  06 D0  07 D0  09 D0  0A D0
      0B 01     01     01     01     01     01     01
      0C 11     12     21     13     31     22     33
      0D 0C     0C     0C     0C     0C     0C     0C
      0E 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00
      0F 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00
      10 00 00  00 00  00 00  00 00  00 00  00 00  00 00

//=====================================================================================
// Object
// Action 1 Define a set of real sprites
// Link: http://wiki.ttdpatch.net/tiki-index.php?page=Action1
// <Sprite-number> * <Length> 01 <feature> <num-sets> <num-ent>
    3 * 4    01 0F 09 01
// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel
    4 C:\MPS\_tools\grfcodec\sprites/NewObjTutw.pcx 80 8 09 64 64 -31 -33 // 0 0
    5 C:\MPS\_tools\grfcodec\sprites/NewObjTutw.pcx 160 8 09 64 64 -31 -33 // 0 1
    6 C:\MPS\_tools\grfcodec\sprites/NewObjTutw.pcx 240 8 09 64 64 -31 -33 // 0 2
    7 C:\MPS\_tools\grfcodec\sprites/NewObjTutw.pcx 320 8 09 64 64 -31 -33 // 1 0
    8 C:\MPS\_tools\grfcodec\sprites/NewObjTutw.pcx 400 8 09 64 64 -31 -33 // 1 1
    9 C:\MPS\_tools\grfcodec\sprites/NewObjTutw.pcx 480 8 09 64 64 -31 -33 // 1 2
   10 C:\MPS\_tools\grfcodec\sprites/NewObjTutw.pcx 560 8 09 64 64 -31 -33 // 2 0
   11 C:\MPS\_tools\grfcodec\sprites/NewObjTutw.pcx 640 8 09 64 64 -31 -33 // 2 1
   12 C:\MPS\_tools\grfcodec\sprites/NewObjTutw.pcx 720 8 09 64 64 -31 -33 // 2 2

// Action 2 for object
// Link: http://wiki.ttdpatch.net/tiki-index.php?page=Action2HousesIndustryTiles
// <Sprite-number> * <Length> 02 <Feature> <set-id> 00 <groundsprite> <buildingsprite> <xoffset> <yoffset> <xextent> <yextent> <zextent>
   13 * 17    02 0F 00 00  8D 0F 00 00  00 80 00 80   00 00   0F 0F E5 // 0 0
   14 * 17    02 0F 01 00  8D 0F 00 00  01 80 00 80   00 00   0F 0F E5 // 0 1
   15 * 17    02 0F 02 00  8D 0F 00 00  02 80 00 80   00 00   0F 0F E5 // 0 2
   16 * 17    02 0F 03 00  8D 0F 00 00  03 80 00 80   00 00   0F 0F E5 // 1 0
   17 * 17    02 0F 04 00  8D 0F 00 00  04 80 00 80   00 00   0F 0F E5 // 1 1
   18 * 17    02 0F 05 00  8D 0F 00 00  05 80 00 80   00 00   0F 0F E5 // 1 2
   19 * 17    02 0F 06 00  8D 0F 00 00  06 80 00 80   00 00   0F 0F E5 // 2 0
   20 * 17    02 0F 07 00  8D 0F 00 00  07 80 00 80   00 00   0F 0F E5 // 2 1
   21 * 17    02 0F 08 00  8D 0F 00 00  08 80 00 80   00 00   0F 0F E5 // 2 2

//=====================================================================================
// Menu
// Action 1 Define a set of real sprites
   22 * 4    01 0F 07 01
   23 C:\MPS\_tools\grfcodec\sprites/NewObjTutw.pcx 80 96 09 64 64 -31 -33 // Single
   24 C:\MPS\_tools\grfcodec\sprites/NewObjTutw.pcx 160 96 09 64 64 -31 -33 // E-W x 2
   25 C:\MPS\_tools\grfcodec\sprites/NewObjTutw.pcx 240 96 09 64 64 -31 -33 // N-S x 2
   26 C:\MPS\_tools\grfcodec\sprites/NewObjTutw.pcx 320 96 09 64 64 -31 -33 // E-W x 3
   27 C:\MPS\_tools\grfcodec\sprites/NewObjTutw.pcx 400 96 09 64 64 -31 -33 // N-S x 3
   28 C:\MPS\_tools\grfcodec\sprites/NewObjTutw.pcx 480 96 09 64 64 -31 -33 // 2 x 2
   29 C:\MPS\_tools\grfcodec\sprites/NewObjTutw.pcx 560 96 09 64 64 -31 -33 // 3 x 3

// Action 2 for menu
// <Sprite-number> * <Length> 02 <Feature> <set-id> 00 <groundsprite> <buildingsprite> <xoffset> <yoffset> <xextent> <yextent> <zextent>
   30 * 17    02 0F 09 00   00 80 00 80   00 00 00 00   00 00   00 00 00 // Single
   31 * 17    02 0F 0A 00   01 80 00 80   00 00 00 00   00 00   00 00 00 // E-W x 2
   32 * 17    02 0F 0B 00   02 80 00 80   00 00 00 00   00 00   00 00 00 // N-S x 2
   33 * 17    02 0F 0C 00   03 80 00 80   00 00 00 00   00 00   00 00 00 // E-W x 3
   34 * 17    02 0F 0D 00   04 80 00 80   00 00 00 00   00 00   00 00 00 // N-S x 3
   35 * 17    02 0F 0E 00   05 80 00 80   00 00 00 00   00 00   00 00 00 // 2 x 2
   36 * 17    02 0F 0F 00   06 80 00 80   00 00 00 00   00 00   00 00 00 // 3 x 3

//=====================================================================================
// varAction2 - Assemble sprites
// Link: http://wiki.ttdpatch.net/tiki-index.php?page=VariationalAction2
// Variables link: http://wiki.ttdpatch.net/tiki-index.php?page=VarAction2Objects
// <Sprite-number> * <Length> 02 <feature> <set-id> <type> <variable> <varadjust> <nvar> (<set-id> <low-range> <high-range>){n} <default>
// The default sprite is always built first and is used for placing the object on the map.
// The numbers atop the cube sprites correspond to the coordinates listed below.
// Single
// Single cube - No assembly required
// E-W x 2
   37 * 14    02 0F 10 81 40 10 FF 01
     01 00  01 01
     00 00
// N-S x 2
   38 * 14    02 0F 11 81 40 10 FF 01
     03 00  10 10
     00 00
// E-W x 3
   39 * 18    02 0F 12 81 40 10 FF 02
     01 00  01 01
     02 00  02 02
     00 00
// N-S x 3
   40 * 18    02 0F 13 81 40 10 FF 02
     03 00  10 10
     06 00  20 20
     00 00
// 2 x 2
   41 * 22    02 0F 14 81 40 10 FF 03
              01 00  01 01
     03 00  10 10   04 00  11 11
     00 00
// 3 x 3
   42 * 42    02 0F 15 81 40 10 FF 08
              01 00  01 01   02 00  02 02
     03 00  10 10   04 00  11 11   05 00  12 12   
     06 00  20 20   07 00  21 21   08 00  22 22
     00 00

//=====================================================================================
// varAction 2 - Callback 149 returns
// Link: http://wiki.ttdpatch.net/tiki-index.php?page=Callbacks#Land_slope_check_149_
// <Sprite-number> * <Length> 02 <feature> <set-id> <type> <variable> <varadjust> <nvar> (<set-id> <low-range> <high-range>){n} <default>
   43 * 18    02 0F 16 81 10 00 FF 02 00 80 00 00 00 80 01 0E 09 80 // Single
   44 * 18    02 0F 17 81 10 00 FF 02 00 80 00 00 00 80 01 0E 0A 80 // N-S x 2
   45 * 18    02 0F 18 81 10 00 FF 02 00 80 00 00 00 80 01 0E 0B 80 // E-W x 2
   46 * 18    02 0F 19 81 10 00 FF 02 00 80 00 00 00 80 01 0E 0C 80 // N-S x 3
   47 * 18    02 0F 1A 81 10 00 FF 02 00 80 00 00 00 80 01 0E 0D 80 // E-W x 3
   48 * 18    02 0F 1B 81 10 00 FF 02 00 80 00 00 00 80 01 0E 0E 80 // 2 x 2
   49 * 18    02 0F 1C 81 10 00 FF 02 00 80 00 00 00 80 01 0E 0F 80 // 3 x 3

//=====================================================================================
// Action 2 - Return to graphics
// Link: http://wiki.ttdpatch.net/tiki-index.php?page=Action2
// <Sprite-number> * <Length> 02 <feature> <set-id> <num-ent1> <num-ent2> <entries...>
   50 * 17    02 0F 1D 85 0C 00 FF FF 01 16 00 49 01 49 01 09 00 // Single
   51 * 17    02 0F 1E 85 0C 00 FF FF 01 17 00 49 01 49 01 0A 00 // N-S x 2
   52 * 17    02 0F 1F 85 0C 00 FF FF 01 18 00 49 01 49 01 0B 00 // E-W x 2
   53 * 17    02 0F 20 85 0C 00 FF FF 01 19 00 49 01 49 01 0C 00 // N-S x 3
   54 * 17    02 0F 21 85 0C 00 FF FF 01 1A 00 49 01 49 01 0D 00 // E-W x 3
   55 * 17    02 0F 22 85 0C 00 FF FF 01 1B 00 49 01 49 01 0E 00 // 2 x 2
   56 * 17    02 0F 23 85 0C 00 FF FF 01 1C 00 49 01 49 01 0F 00 // 3 x 3

//=====================================================================================
// Action 3 Associate with graphics set IDs
// Link: http://wiki.ttdpatch.net/tiki-index.php?page=Action3
// <Sprite-number> * <Length> 03 <feature> <n-id> <ids...> <num-cid> (<cargo-type> <cid>)... <def-cid>
// THE FOLLOWING WARNING SHOULD BE IGNORED
//!!Warning (142): <num-cid> must be 0 for this feature.
   57 * 10    03 0F 01 00 01 FF 1D 00 00 00 // Single
   58 * 10    03 0F 01 01 01 FF 1E 00 10 00 // N-S x 2
   59 * 10    03 0F 01 02 01 FF 1F 00 11 00 // E-W x 2
   60 * 10    03 0F 01 03 01 FF 20 00 12 00 // N-S x 3
   61 * 10    03 0F 01 04 01 FF 21 00 13 00 // E-W x 3
   62 * 10    03 0F 01 05 01 FF 22 00 14 00 // 2 x 2
   63 * 10    03 0F 01 06 01 FF 23 00 15 00 // 3 x 3

//=====================================================================================
// Action 4 Define vehicle names or other texts
// Link: http://wiki.ttdpatch.net/tiki-index.php?page=Action4
// <Sprite-number> * <Length> 04 <feature> <language-id> <num-ent> <offset> <text>
   64 * 11    04 48 FF 01 00 D0 "Cube" 00
   65 * 18    04 48 FF 01 01 D0 "Single Cube" 00
   66 * 14    04 48 FF 01 02 D0 "2 Cubes" 00
   67 * 18    04 48 FF 02 03 D0 "E - W" 00 "N - S" 00
   68 * 14    04 48 FF 01 05 D0 "3 Cubes" 00
   69 * 18    04 48 FF 02 06 D0 "E - W" 00 "N - S" 00
   70 * 18    04 48 FF 01 08 DO "Multi Cubes" 00
   71 * 18    04 48 FF 02 09 D0 "2 x 2" 00 "3 x 3" 00


Here are the sprite sheet for the cubes and the grf for you to preview:


Attachments:
File comment: The Sprite Sheet
NewObjTutw.pcx [13.07 KiB]
Downloaded 497 times
File comment: The grf file - requires Windows
Rev 1.2 - July 26, 2010

NewObjTutw.grf [11.76 KiB]
Downloaded 494 times


Last edited by wallyweb on Fri Oct 08, 2010 1:21 pm, edited 9 times in total.
Top
   
PostPosted: Sun Jun 20, 2010 4:39 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5431
Location: Canada
From Action0 Property 08 Object Class:
Quote:
Unlike Station Classes there is currently no default yet, planed are TRNS for transmitters and LIGH for lighthouses. (For special replacement later). You have to set this before any other property. As with station you can define several objects. Allowed characters: A-Z, 0-9.

Until a fixed set of object classes has been determined, I will maintain a listing here for your reference. These should prove critical to maintaining a reasonably navigable menu. Please post your submissions in this thread.

Used/Proposed to date:
"COMM" - Communications Towers
"LTHS" - Lighthouses
"TRNS" - Power Transmission Towers
"LITE" - Lights (Poles etc.)
"ROCK" - Rocks


Top
   
PostPosted: Mon Jun 21, 2010 4:30 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Mar 06, 2007 7:32 pm
Posts: 1889
Location: In The Dark
Very nicely done and, as always, brilliantly presented.

If I take out my large two pronged barbecue fork who do I have to poke and/or jab in the ribs to get this fine feature into OpenTTD so we can all take advantage of that which has been wrought by wallyweb. And I mean "take advantage" in the nicest of ways.

_________________
Humor is the second most subjective thing on the planet
------------------------------------------------------------
Brevity is the soul of wit and obscenity is its downfall
--------------------------------------------------------
Good Night And Good Luck - Read You Soon


Top
   
PostPosted: Mon Jun 21, 2010 5:28 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9174
Location: Sol d
Very nice newgrf :-) and even more so a nice guide how to write these kind of newgf.

wallyweb wrote:
Used/Proposed to date:
"COMM" - Communications Towers
"LTHS" - Lighthouses
"TRNS" - Power Transmission Towers
"LITE" - Lights (Poles etc.)
"ROCK" - Rocks

Did you add those to the newgrf wiki? You being the first to actually use this feature allows you to set standards ;-) In case of doubt people who code might look at the wiki first.

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
PostPosted: Mon Jun 21, 2010 10:24 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5431
Location: Canada
Nite Owl wrote:
Very nicely done and, as always, brilliantly presented.
planetmaker wrote:
Very nice newgrf :-) and even more so a nice guide how to write these kind of newgf.
Thank you both. :bow:
Quote:
Did you add those to the newgrf wiki?
Not yet, but a good point indeed. I might provide a link to this thread for now, until a more comprehensive list is assembled. What do you think?
Quote:
You being the first to actually use this feature allows you to set standards ;-)
Does that make me a "standard bearer"? :lol:
Actually, Lakie is the dev of record (Oskar too as he did the original code) and he might want to take the lead. I'll chase him down and see what he suggests.

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018


Top
   
PostPosted: Tue Jun 29, 2010 7:30 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5431
Location: Canada
The download files have been updated to v1.1 here.

Rocky ground tiles have been added.

Attachment:
File comment: Oh look! Rocks!
newobjectville_8.png
newobjectville_8.png [ 28.95 KiB | Viewed 19119 times ]


These are slightly different from what is usually seen in the game.
They are, however, a part of the TTDX graphic set.
It would seem that nobody knows why they were never implemented into the game.
Now you have them.

NOTE: Steep slopes are not supported by newobjects.

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018


Top
   
PostPosted: Mon Jul 26, 2010 7:10 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5431
Location: Canada
There have been internal changes and we are now at TTDPatch nightly r2330 and the NewObjTutw.grf rev is now at 1.2 . The user will see some minor changes in the menu GUI. The coder should now refer to the sample code posted here.

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018


Top
   
PostPosted: Mon Aug 02, 2010 2:48 am 
Offline
Tycoon
Tycoon

Joined: Mon Jul 10, 2006 12:43 am
Posts: 1808
Location: Spain
I tryed to code the Lamoot radio tower as 8bpp graphic.

I have wrote the NFO code and converted the sprite to 8 bpp, but I can't load it in TTDPatch.
What I'm doing wrong? I have tried some combinations, but It doesn't work.

EDIT: I have fixed it, but I can't build one in game. I will find the problem tomorrow and I will as their author for permission. I have posted the new code:
Code:
// Automatically generated by GRFCODEC. Do not modify!
// (Info version 7)
// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel
    0 * 4    14 00 00 00
    1 * 142    08 06 32 "OBJ" "New 8 & 32 bpp objects" 00
"New 8 & 32 bpp houses for OpenTTD & TTDPatch.
Note: the latest version of OpenTTD doesn't support these objects." 00
    2 * 1    0C
    3 * 1    0C
    4 * 1    0C
    5 * 1    0C
    6 * 1    0C
    7 * 1    0C
    8 * 1    0C
    9 * 1    0C
   10 * 1    0C
   11 * 1    0C
   12 * 1    0C
   13 * 1    0C


   14 * 4    01 0F 01 01
   15 newobjects/Lamoot_radio_tower.pcx    0  0   09   163 52   -25 -132

   16 * 17    02 0F    00    00    8D 0F 00 00    00 00 00 80    02 02 0C 0C 20

// Sprite for purchase screen, disabled.
//   17 * 17    02 0F    01    00    8D 0F 00 00    00 00 00 80    02 02 0C 0C 20
   17 * 1    0C
//  Action 3 disabled, because I don't use a purchase screen sprite for the moment.
//   18 * 10    03 0F 01 00    01    FF 00 01    00 00
   18 * 7    03 0F 01 00    00    00 00


   19 * 32    00 0F    08 01    00
   08  "COMM" // Communications Towers
   0A  00 D4
   0B  0F // Climate availability (all)
   0C  11 // Size
   0D  02 // Build Cost
   0E  17 DE 0A 00
   0F  00 00 02 00
   10  02 00 // Anything Can Remove (2h)


   20 * 25    04 0F    FF    01 00 D4 "Lamoot radio tower" 00
//   20 * 25    04 48 FF 01 00 D0 "Lamoot radio tower" 00


Attachments:
File comment: PCX file used.
Lamoot_radio_tower.pcx [3.7 KiB]
Downloaded 277 times
File comment: PNG preview.
Lamoot_radio_tower.png
Lamoot_radio_tower.png [ 2.53 KiB | Viewed 18518 times ]

_________________
Sorry if my english is too poor, I want learn it, but it isn't too easy.


Last edited by maquinista on Mon Aug 02, 2010 3:22 am, edited 4 times in total.
Top
   
PostPosted: Mon Aug 02, 2010 2:52 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Thu Jun 25, 2009 4:42 pm
Posts: 2365
Location: Location, Location
like the tower!
damn!, OTTD devs, hurry up with newobjects please! :mrgreen:

_________________
AroAI - A really feeble attempt at an AI

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra


Top
   
PostPosted: Mon Aug 02, 2010 7:31 am 
Offline
Tycoon
Tycoon

Joined: Wed Apr 27, 2005 7:09 am
Posts: 5243
maquinista wrote:
[...] I can't build one in game

Your introduction date (prop0E) is later than the end-of-life date (prop0F).


In addition, your text-IDs have to be defined in the D000 range, i.e.:

- 20 * 25 04 0F FF 01 00 D0 "Lamoot radio tower" 00
- (-> action0, prop0A) "0A 00 D0"


Some more remarks:

- you should use a proper grf-ID,
- you should add a class name by prop09,
- flag for "anything can remove" is indeed bit2 (i.e. "4"). "2" (bit1) is "irremovable",
- text IDs should be defined before being referenced in action0.

HTH
regards
Michael

_________________
Image


Top
   
PostPosted: Tue Aug 03, 2010 3:13 am 
Offline
Tycoon
Tycoon

Joined: Mon Jul 10, 2006 12:43 am
Posts: 1808
Location: Spain
michael blunck wrote:
maquinista wrote:
[...] I can't build one in game

Your introduction date (prop0E) is later than the end-of-life date (prop0F).


In addition, your text-IDs have to be defined in the D000 range, i.e.:

- 20 * 25 04 0F FF 01 00 D0 "Lamoot radio tower" 00
- (-> action0, prop0A) "0A 00 D0"


Some more remarks:

- you should use a proper grf-ID,
- you should add a class name by prop09,
- flag for "anything can remove" is indeed bit2 (i.e. "4"). "2" (bit1) is "irremovable",
- text IDs should be defined before being referenced in action0.

HTH
regards
Michael
Thanks, It works now.

Some suggestions: a vulcano (10×10), a waterfall, a windmill... These elements could help to avoid the overladnscaping made by the AI.


Attachments:
File comment: Preview. I'm waiting if their author allows me to release it.
radio_tower.png
radio_tower.png [ 31.87 KiB | Viewed 18327 times ]

_________________
Sorry if my english is too poor, I want learn it, but it isn't too easy.
Top
   
PostPosted: Tue Aug 03, 2010 3:28 am 
Offline
TTDPatch Developer
TTDPatch Developer
User avatar

Joined: Wed May 26, 2004 4:37 pm
Posts: 1804
Location: Britain
Actually, the Action0 properties can be either 0xD000+x (same as action4) or 0xD400+x, (preferably the latter).
This said, the Action4 must use 0xD000+x to set the string (regardless of which of the above you use).

~ Lakie

_________________
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."


Top
   
PostPosted: Tue Aug 03, 2010 7:17 pm 
Offline
Tycoon
Tycoon

Joined: Mon Jul 10, 2006 12:43 am
Posts: 1808
Location: Spain
This is the Lamoot radio tower (Its author allowed me to release it). I will make some changes, like CC colours in the base or a red blinking light.


Attachments:
File comment: GRF file.
newobjects_mq.grf [3.06 KiB]
Downloaded 538 times

_________________
Sorry if my english is too poor, I want learn it, but it isn't too easy.
Top
   
PostPosted: Tue Aug 03, 2010 7:58 pm 
Offline
Tycoon
Tycoon

Joined: Wed Apr 27, 2005 7:09 am
Posts: 5243
maquinista wrote:
This is the Lamoot radio tower

It´s not useful to have only one object (building, train, ...) per newgrf, with the exception of a "taster" from a work in progress.

I expect this is the case with yours. 8)

regards
Michael

_________________
Image


Top
   
PostPosted: Wed Aug 04, 2010 7:22 pm 
Offline
Tycoon
Tycoon

Joined: Mon Jul 10, 2006 12:43 am
Posts: 1808
Location: Spain
michael blunck wrote:
maquinista wrote:
This is the Lamoot radio tower

It´s not useful to have only one object (building, train, ...) per newgrf, with the exception of a "taster" from a work in progress.

I expect this is the case with yours. 8)

regards
Michael

For the moment, I'm adding the preview graphics in the same file, with the permission of the authors.


I have updated the file with the antenna:
viewtopic.php?p=894199#p894199

Maybe I could try to add this famous add used in Spanish roads:
http://commons.wikimedia.org/wiki/File:Imagen_Autov%C3%ADa_A-48.jpg

Also, some motorway signals (most of countries have green or blue signals) would be interesting.

_________________
Sorry if my english is too poor, I want learn it, but it isn't too easy.


Top
   
PostPosted: Mon Aug 23, 2010 4:35 am 
Offline
Moderator
Moderator
User avatar

Joined: Sat Apr 02, 2005 7:01 am
Posts: 3679
Location: Sydney NSW Antipodea
WallyWeb, I suggest you rename the DOS grf to fit the 8.3 filename limit.

_________________
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/


Top
   
PostPosted: Mon Aug 23, 2010 2:28 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5431
Location: Canada
robotboy wrote:
WallyWeb, I suggest you rename the DOS grf to fit the 8.3 filename limit.
:oops: I forgot about that. I'm away from my home PC but I should have it done in a day or two. Thanks for the heads up.

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018


Top
   
PostPosted: Tue Sep 21, 2010 2:20 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5431
Location: Canada
Samples updated to work with new newgrf specifications.

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 30 posts ]  Go to page 1 2 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2019 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2019.
Hosted by Zernebok Hosting.