• Welcome to World Machine Community. Please login or sign up.
 
May 20, 2019, 06:24:44 pm

News:

Read the Development Diary for an inside look at World Machine's progress!


How to find a tiles name?

Started by dagri, November 24, 2010, 06:34:27 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dagri

Hello,

I wonder how to find a tiles name in the doOutput function?

Where has a tiles name info?

Stephen

Good question.

The current method is very hack-y and is quite likely to change soon.

At the moment, a tiled data packet carries its tile name in its nametag, retrievable by WMPacket::GetNameTag().

Thus during a tiled build, you can follow the current user-specified tile naming convention by creating your output filename with a printf-style formatting string as follows:

const char *filetitle = "myfiletitle"; // filename without extension
const char *fileext = ".hf";
const char *tilename = hf->GetNameTag();
sprintf( final_name,  "%s%s.%s", filetitle , tilename , fileext );

The tilename specified in GetNameTag() has already been filled out with the proper information (X,Y location, resolution, etc)

-- Stephen Schmitt
- Creator of World Machine

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.

Name:
Email:
Verification:
Please leave this box empty:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:

Shortcuts: ALT+S save/post or ALT+P preview