16
Technical forum / HOW to Create TEMPLATES...???
« on: March 03, 2004, 10:58:08 AM »
I'd wanted to know how to create SCRIPT/SCENES templates for Wintermute. What Parameters to use (like $$ACTOR$$). How to use them...
Forum rules - please read before posting, it can save you a lot of time.
Game.PlayMusic("music\musica.ogg");
#include <windows.h>
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
extern "C" __declspec(dllexport) void write_file(char* fileName, char* text)
{
string texto(text);
ofstream file(fileName);
file << texto << endl;
file.close();
}
extern "C" __declspec(dllexport) char* read_file(char* fileName)
{
string m, aux;
ifstream read(fileName);
if(!read.fail())
{
while(read)
{
getline(read, aux, '\n');
m = m + aux + "\n";
}
}
else cerr << "Error opening the file: Maybe the file doesn't exist or has a different name";
read.close();
char* k;
k = new char[m.length()];
strcpy(k, m.c_str());
return k;
}