The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.15 (Linux)
File Line Function
/showthread.php 906 errorHandler->error




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 !


Messages In This Thread
Littles questions & howtos - by pakoskyfrog - 01-08-2015, 10:58 AM
RE: Littles questions & howtos - by krzys_h - 01-08-2015, 05:54 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)