Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Littles questions & howtos
#1
Hello,

I will start by saying that the retrofitting of my missions is doing quite well, I only retrieve the last three partially (can't put my hands on the last backup I made) so the full release will to wait the time I redo all of it.
To do the retrofitting, i help myself with scripts and other software.

To help me put plants all around the place I did this :
I run arround, a bot scans me and when I stop for a few seconds the bot adds a line in a text file.
Code:
extern void object::Jardin()
{
file fic();     // temp text to write in
object me = radar(Me);
point p = me.position;
int n=0;        // seconds counter
   
string plante = "MegaStalk";    // type to add
int mn=0, mx=2;                 // range min max

// waiting for me to move so it can start
do wait(1); while(me.position.x == p.x);

fic.open("decors.txt", "w");

while(true)
{
wait(1);
n++;

       // reset timer if Me moves
if(me.position.x != p.x)
{
p = me.position;
n=0;
continue;
}

       // Display timer
if(n >= 3 && n < 6)
{
message("Writing in - " + (6-n));
continue;
}

       // at 6 seconds, add an object to the file
if(n == 6)
{
int ch = mn + rand()*(mx+1-mn);
string str = "CreateObject pos="+me.position.x+";"+me.position.y+" dir="+((me.orientation%360)/180)+" type="+plante+ch;

// templates :
//CreateObject pos=-149.6;297.5 dir=0.3 type=Greenery19
//CreateObject pos=-1.6; 85.5 cmdline=-1.6; 85.5; -2.8; 94.7 dir=0.0 type=AlienAnt script1="ant04.txt" run=1

fic.writeln(str);
message(str,DisplayInfo);
//break;
}

       // display timer
if(n >= 9 && n < 12)
{
message("Stopping in - "+(12-n));
continue;
}

       // application.terminate at 12 sec
if(n==12)
{
message("Assisting program stopped.",DisplayError);
break;
}

}

fic.close();
}
That worked on the original version, on C:GE the help for the open function tells me I have to find a "files/" folder in the installation diretory, which cannot be found. So here is my question :
Do I need to create it manually ? (and where ?) Or does writing in files isn't implemented yet ?

Also, it was impossible to make a custom ending scene (when winning) like in exercices for user levels. Will it be possible in C:GE ?

I noticed something a bit wierd, in my folder tree, here is how it is :
- mods/sample01/levels/custom/chapter001/level001
- mods/sample01/levels/custom/chapter001/level002
- mods/skycenter/levels/custom/chapter002/level001
- mods/skycenter/levels/custom/chapter002/level002
- mods/skycenter/levels/custom/chapter002/level003 ...
I had to name my chapter "002" or it would have fuse weirdly the two chapters together.
I am doing something wrong ?

And at last, does someone have the pdf with all the edition informations of user missions ? I can't find mine. I think it was in french only, but i speak french and english ^^

Thanks !

ps : love the "&lng&" tag, very useful !
#2
(01-08-2015, 10:58 AM)pakoskyfrog Wrote: That worked on the original version, on C:GE the help for the open function tells me I have to find a "files/" folder in the installation diretory, which cannot be found. So here is my question :
Do I need to create it manually ? (and where ?) Or does writing in files isn't implemented yet ?
I believe this might have been broken in official alpha-0.1.4 version. It was fixed recently, but the development version currently has some very annoying bugs in radar() and BotFactory (and possibly elsewhere), but this should be fixed soon.
Check in <game dir>/files or C:\Users\<username>\colobot\files (on Linux - ~/.local/share/colobot/files)

(01-08-2015, 10:58 AM)pakoskyfrog Wrote: I had to name my chapter "002" or it would have fuse weirdly the two chapters together.
I am doing something wrong ?
That's just how userlevels work. Imagine like all the "mods/*/levels/custom" directories are one "user/" directory from original Colobot. If you put some files with the same name into "skycenter" directory that you already have in "sample01" directory, you'll overwrite them. The "custom" directory is an exception to the chapterXXX naming scheme, so you can call the directory whatever you want (in your case I'd recommend renaming "chapter002" to "skycenter").
While this might look strange at first, this makes it possible to create mods for userlevels (at least in theory, I don't think anybody actually tried that).
I'm considering some kind of grouping for userlevels that add more than one chapter, but that'll come in the future.

(01-08-2015, 10:58 AM)pakoskyfrog Wrote: And at last, does someone have the pdf with all the edition informations of user missions ? I can't find mine. I think it was in french only, but i speak french and english ^^
http://colobot.info/download/Creating_Us...els_EN.pdf
We've also started working on an updated version for Gold recently. See the document here http://krzysh.pl:3000/project/545e90d99e8bceed2284797e (copy of the source also at https://github.com/colobot/colobot-misc/tree/master/gdd), or the compiled document here - http://compiled.colobot.info/gdd/output.pdf. Look at section VIII.2


Forum Jump:


Users browsing this thread: 1 Guest(s)