writable access to object 'view' variable

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

Post Reply
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

writable access to object 'view' variable

Post by Wahazar »

Is it possible to change 'view' variable for object itself?
Especially in nml?
For example, to adjust view according to nearby tiles variables?
Or it can be done only during object placement?

I want to place 'fake rivers' (streams objects) and adjust their views automatically according to the neighbouring stream tiles (their existence and view),
to get chain of properly oriented stream tiles.
Formerly known as: McZapkie
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: writable access to object 'view' variable

Post by planetmaker »

The view variable is a choice the player makes.

Evaluate the neighbouring tiles type and object grfid to an integer value and select the appropriate sprite(s) in a switch according to the number you got in your evaluation.

Or do that more simple and draw four riverbank sprites on top of a plain water, depending on the adjacent tile. you then could basically copy the code from the fence placement in OpenGFX+Landscape for the 'company land': http://dev.openttdcoop.org/projects/ogf ... _land.pnml

cheers,
pm
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 10 guests