Official Fulqrum Publishing forum

Official Fulqrum Publishing forum (http://forum.fulqrumpublishing.com/index.php)
-   FMB, Mission & Campaign builder Discussions (http://forum.fulqrumpublishing.com/forumdisplay.php?f=203)
-   -   Some questions newbie scripter (http://forum.fulqrumpublishing.com/showthread.php?t=27845)

HR_Grainovich 11-14-2011 12:03 PM

Some questions newbie scripter
 
Hi scripters! ;)

I have a couple of question, i will try to explain myself, sorry by my awful english.

I don't want to specify the path to my submission folder like:

GamePlay.gpPostMissionLoad("missions/<directory_to_my_mission>/submision.mis");

It's possible to specify a relative path? always must to be absolute path?

Exist any function which can return the absolute path?, something like this: battleScriptFileName() , but doesn´t work , at least I can´t do it, my script GamePlay.battleScriptFileName() doesn´t work, any idea?

And another question... CoD have any "error.log" for debugging the scripting error?, like "you have an error in line 42" ??

Finally, where can I find an explanation about the parameter "int missionNumber" in some functions like OnTrigger(int missionNumber, string shortName, bool active) ?? , I don´t understand what mean this parameter and his use.

Thanks very much!!

FG28_Kodiak 11-14-2011 02:05 PM

Quote:

Originally Posted by HR_Grainovich (Post 361383)
Hi scripters! ;)

I have a couple of question, i will try to explain myself, sorry by my awful english.

I don't want to specify the path to my submission folder like:

GamePlay.gpPostMissionLoad("missions/<directory_to_my_mission>/submision.mis");

It's possible to specify a relative path? always must to be absolute path?

yes you can specify for example:
Code:

static string SubMissionsPath = @"missions\Multi\Dogfight\test\subs\";
static string RandomSubMissionsPath = @"missions\Multi\Dogfight\test\subs\random\";

Quote:

Exist any function which can return the absolute path?, something like this: battleScriptFileName() , but doesn´t work , at least I can´t do it, my script GamePlay.battleScriptFileName() doesn´t work, any idea?
the absolute path of the missions-folder is (using System.IO;):
Code:

static string docpath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
static string pathCoD = docpath + @"\1C SoftClub\il-2 sturmovik cliffs of dover\missions";

you can search then recursivly, if you like.

Quote:

And another question... CoD have any "error.log" for debugging the scripting error?, like "you have an error in line 42" ??
Yes you can use the Log-file, activate it in conf.ini (LOG=1, LOGFILE=log.txt, LOGKEEP=1)


Quote:

Finally, where can I find an explanation about the parameter "int missionNumber" in some functions like OnTrigger(int missionNumber, string shortName, bool active) ?? , I don´t understand what mean this parameter and his use.
Its possible to load missions in a "mainmission".
So your mainmission is number 0 and every mission you load in that mission, gets a missionnumber++.

HR_Grainovich 11-14-2011 02:08 PM

WOW!! :o

Thanks Kodiak !! all is clear!! thanks very much! :razz:

HR_Grainovich 11-14-2011 03:23 PM

And another question :grin:

Is possible that some functions are executed in singleplayer and anothers in multiplayer??

I think that OnAircraftTookOff, OnAircraftLanded or OnAircraftCrashLanded only is executed only in singleplayer, it's possible?

Thanks!!

FG28_Kodiak 11-14-2011 03:34 PM

You can check (bool)
GamePlay.gpIsServerDedicated();
GamePlay.gpIsServerSingle();

but by a SingleplayerGame GamePlay.gpIsServerSingle() is also true.

So you should check if
GamePlay.gpRemotePlayers()
contains Players, if so its a MultiplayerGame if not its a SinglePlayer.

HR_Grainovich 11-15-2011 07:00 AM

Thanks again Kodiak!

So, I'm right!?, some events only works in singleplayer and others in multiplayer, it's ok?

FG28_Kodiak 11-15-2011 07:59 AM

Yes but it's depens on the patch version. So if the events dont work in multiplayer call them bugs ;), may be they work again in later patch versions.

HR_Grainovich 11-15-2011 02:00 PM

Quote:

Originally Posted by FG28_Kodiak (Post 361719)
Yes but it's depens on the patch version. So if the events dont work in multiplayer call them bugs ;), may be they work again in later patch versions.

oh! :lol::lol: ok ok, I understand! ;), thanks Kodiak!!


All times are GMT. The time now is 11:44 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.