Difference between revisions of "Selective GRF Loading"

From TTWiki
Jump to navigationJump to search
m (2 revisions)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  +
{{NFOTutorial}}
 
'''''Selectively loading GRF files'''''
 
 
=Loading your graphics only some circumstances=
 
   
 
Certain grf files should only be loaded in some climates, only if certain switches are on, or some other circumstances.
 
Certain grf files should only be loaded in some climates, only if certain switches are on, or some other circumstances.
   
To do this, the first entries in your .grf file must be [[Action7|action 7s]] which test that condition, and skip the rest of the file if true. To skip the rest of the file, remember to specify a <num-sprites> parameter of 00.
+
To do this, the first entries in your .grf file must be [[grfspecs:Action7|action 7s]] which test that condition, and skip the rest of the file if true. To skip the rest of the file, remember to specify a <num-sprites> parameter of 00.
   
Immediately *after* your initial action 7 entries, you place the [[Action8|action 8]] that defines your GRF ID.
+
Immediately *after* your initial action 7 entries, you place the [[grfspecs:Action8|action 8]] that defines your GRF ID.
   
 
This way, the .grf file is considered active or inactive in the right circumstances.
 
This way, the .grf file is considered active or inactive in the right circumstances.
  +
[[Category:Tutorials]][[Category:GRF Tutorial]]

Latest revision as of 11:59, 1 March 2012

Certain grf files should only be loaded in some climates, only if certain switches are on, or some other circumstances.

To do this, the first entries in your .grf file must be action 7s which test that condition, and skip the rest of the file if true. To skip the rest of the file, remember to specify a <num-sprites> parameter of 00.

Immediately *after* your initial action 7 entries, you place the action 8 that defines your GRF ID.

This way, the .grf file is considered active or inactive in the right circumstances.