Jump to content
Sign in to follow this  
giallustio

Server script

Recommended Posts

Hi guys!

Is there a way to execute a script stored in the server ftp at the beginning of a mission?

Any ideas? Is that possible?

Share this post


Link to post
Share on other sites

note that .\arma\scripts\* is no longer supported

you need to use a dummy addon and unpacked data instead, like

myAddon.pbo with an empty config.cpp should do, along with empty files you want to load like autoCall.sqf

now arma will try to load these files in .\arma\myAddon\* like .\arma\myAddon\autoCall.sqf

Share this post


Link to post
Share on other sites

mmm...Ok...

I think it's not my way :)

What i thought it's to save some datas in an array during a mission, write it in the rpt and then at the mission restart pass that array to the new mission...

Share this post


Link to post
Share on other sites

You need JayLib for that.

Share this post


Link to post
Share on other sites

Ok i tried with no results :)

This what i did:

I created a folder called MyAddon.

I wrote a config.cpp

class CfgPatches
{
class BTC_addon
{
	units[] = { };
	weapons[] = { };
	requiredVersion = 0.108000;
	requiredAddons[] = {};
};
};

Then i created a BTC_file.sqf

My_array = ["ciao"];

I created the pbo -> MyAddon.pbo

Put it into the @Myaddon\addons\Myaddon.pbo

In editor when i try to call the array what returns it's "any".

I did something wrong?

Share this post


Link to post
Share on other sites

Where is the unpacked data?

Share this post


Link to post
Share on other sites

What do u mean with "unpacked data"?

Anyway i got the error, wrong syntax in the script caller :)

Share this post


Link to post
Share on other sites

This:

now arma will try to load these files in .\arma\myAddon\* like .\arma\myAddon\autoCall.sqf

Share this post


Link to post
Share on other sites

Again where is the file located?

Share this post


Link to post
Share on other sites

lol sorry :)

it's inside the pbo with the config.cpp and it works...

So i have:

@MyAddon\addons\MyAddon.pbo\BTC_file.sqf

Share this post


Link to post
Share on other sites

See this is the problem.

Again you also needs it unpacked at:

arma\myaddon\BTC_file.sqf

At least if you want to use the server side scripting framework system.

To be honest though it seems you want to achieve more than you are understand at the moment.

Either you do more research, reading the BIKI etc to get better insights,

or you clarify/explain better what you are really up to.

Server side only addon with XEH preInit might be what you are actually after.

But on the other hand you also talked of mission to mission data transfer - as said: JayLib.

Share this post


Link to post
Share on other sites

I'm creating a mission and i want to add the feature to "save" the actual situation to "load" the mission later and start at the same point.

So i have a "radio alpha" trigger that execute the "save function". The "save function" write all the data i need in the RPT in array format.

I save the array in a sqf file and i put it in the pbo, i start the server with this pbo and i have the opportunity in the mission to recreate all the mission information stored in the array.

Obiusvly if i want to save again the situation i have to change the array in the pbo and restart the server with the new pbo.

It's a little bit hard to explane for me, i'm not very good at speaking english as you can see :p

Share this post


Link to post
Share on other sites

Your English is well enough. Don't worry. You only need to take your time to explain things. ;)

You cannot (really) read from files (except you use JayLib).

You can use loadFile to load files within the arma dir and you can put the rpt inside that dir with -profiles.

However you would have to parse the data yourself - ugly.

My advice read the data from the clipboard on mission start.

Like make a load function via radio (0-0-1) for a certain player / server admin,

and read the data from the clipboard.

http://community.bistudio.com/wiki/-profiles

http://community.bistudio.com/wiki/loadFile

http://community.bistudio.com/wiki/copyFromClipboard

Does that help?

Share this post


Link to post
Share on other sites

thanks - it looks complex and good

however i have no idea how i can help you with those scripts

in case data in and out i gave you the basic info about the three possibilities i know of

did you look into them yet? if so, whats the problem you face?

Share this post


Link to post
Share on other sites
thanks - it looks complex and good

Thank you :)

At the moment i'm using a similar command to loadfile.

I think it's the same concept of the BIS function's module only that i "call" an array instead of a code.

Not tested on a dedi yet but local works great. I start the game with "-mod=@BTC_load_game" and i load the mission with no errors. :)

It's interesting the "-profile way" but i don't know at all if i can load an array with this method and i've to study on it :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×