Zainstaluj Steam
zaloguj się
|
język
简体中文 (chiński uproszczony)
繁體中文 (chiński tradycyjny)
日本語 (japoński)
한국어 (koreański)
ไทย (tajski)
български (bułgarski)
Čeština (czeski)
Dansk (duński)
Deutsch (niemiecki)
English (angielski)
Español – España (hiszpański)
Español – Latinoamérica (hiszpański latynoamerykański)
Ελληνικά (grecki)
Français (francuski)
Italiano (włoski)
Bahasa Indonesia (indonezyjski)
Magyar (węgierski)
Nederlands (niderlandzki)
Norsk (norweski)
Português (portugalski – Portugalia)
Português – Brasil (portugalski brazylijski)
Română (rumuński)
Русский (rosyjski)
Suomi (fiński)
Svenska (szwedzki)
Türkçe (turecki)
Tiếng Việt (wietnamski)
Українська (ukraiński)
Zgłoś problem z tłumaczeniem
I don't know what sa-mp is, so I assume you aren't familiar with ArmA's scripting language, SQF. SQF provides more advanced control over your mission than the editor, but takes time and practice to learn. It is much like any other programming language (simpler than Python, Java, etc.). If you have programmed before you will be able to pick it up quickly, but it does have its quirks.
Your question is rather vague, so here are some links:
https://community.bistudio.com/wiki/6thSense.eu:EG
https://community.bistudio.com/wiki/Locality_in_Multiplayer
There are many more interesting pages on the wiki, try searching there or the official forums for more details.
It can be used with C++? I must to get all connected computers, yes?
Every machine connected to the server gets the mission (basically packaged data that directs how the game plays). All your SQF source code is defined in the mission, and any machine can run any SQF code that the mission designer wants.
To be exact, missions start with executing SQF code in a file called init.sqf; all clients and the server execute this code. Depending on how to design your mission, different code executes on different computers.
The issue with locality is this: some commands must be execute on certain machines. In singleplayer, every command just executes on one machine, which controls everything. In multiplayer, the server and clients share control of the mission.
Everything is under the control of the mission designer, it is up to them to give players any options in the mission (you could allow players to make decisions etc.). Large, flexible, and complex missions are basically gamemodes, like you want to create. They play out differently every time, by using randomization and giving players a lot of freedom.
I would recommend learning the basic editor first, then singleplayer scripting. If you have no experience making ArmA missions, you are not going to be able to implement a complex gamemode on your first try (it is difficult even for the experts).
Thank you, again for all information witch you give me.
https://community.bistudio.com/wiki/Extensions
Looks like the page was written for ArmA 2, but it probably works for ArmA 3. There are some limitations and issues with, and you will still have to call the dll with SQF.
All clients that connect to the server download the entire mission, that is how they get the data from the editor and are able to run SQF code. You can find downloaded missions on your hard drive somewhere (can't remember exactly where without looking).
SQF is a little strange compared to real programming languages. It was invented by BIS specifically for ArmA. The only other example of a similar situation that I can think of is UScript. If you are not familiar with Unreal, UnrealScript is a language is designed to work inside the engine. Of course, the languages themselves are very different, I am just comparing their purpose.
SQF is somewhat based on C syntax, without pointers or structures, and with dynamic typing. SQF abstracts variables much like any scripting language, Python, etc. There is no low-level work with the hardware. SQF is entirely functional, but the results of the ArmA engine itself being OO are obvious (the engine is probably C++). Things like Object being a type in SQF are odd.
For people new to ArmA, it seems ridiculous to learn SQF. Implementing Python, Lua, etc interpreting into the engine would have been easier from the start. I don't know what motivated BIS to create SQF.
The problem is that everything done in SQF uses the BIS engine API. This is about 1500 scripting commands that allow scripts to alter the game world. These commands are integral to the SQF language, like keywords.
For people that have worked for hundreds of hours in SQF (like me) building numerous functions, switching to another language would be useless. I would continue to use SQF function I have already written (unless there was some significant increase in efficiency).
Opening a mission in the editor loads the mission.sqm file at selected mission's directory. When you chose to export a mission to singleplayer or multiplayer, the mission's specific folder is compiled into a .pbo and placed in the correct folder at (default) C:\Program Files\Steam\steamapps\common\Arma 3 (either Missions or MPMissions).
When a server hosts a mission, it must select a .pbo file from the MPMissions folder. All clients then download the .pbo archive, so that their instance of the engine can open and read the necessary data.
A path to an SQF script can be relative to the mission directory (this is by default). This also applies to sound files, pictures, etc. You can also specify a path relative to ArmA's install directory (for example, to access a texture file). These paths can be in .pbo archives; however, I believe that the .pbo file must have been loaded by the engine (all .pbo's in the Addons folder are, plus any mods loaded).
I think that you can also give an absolute path (never tried it) to any directory to find SQF files. However, you must be able to guarantee that the correct files reside at that exact path. Using relative paths ensures that all files are where you expect.
For almost all cases, I would suggest placing all SQF files that you need into your mission directory. You can organize your mission folder in any way you want, so long as you access files with the correct paths. You could have hundreds of SQF files in any number of subfolders within the mission folder. As long your code interacts interally correctly, no one will ever notice.
For some unusual case, you could access SQF files from an addon (game assets are also addons), but if the .pbo was from a mod, all clients would need to have that mod loaded (and the correct version, etc.).
Btw: Thank you for explication of mission folder :)
For example, I can write function to do something, place the code in a file, then from the init call:
The path could be anything; you can put that file anywhere in the mission directory, so long as the relative path is correct. You can now access SomeFunction from all other code.
Technically, 'gamemode' is an abstraction to characterize certain missions. This includes things like Domination, Wasteland, etc (google these, you can download the missions and open the files). The actual mission is what runs on the server. Missions like these are using SQF functions to set up what happens so that it follows a set pattern.
If you create a library of SQF functions where each SQF function achieves some part of the overall gamemode goal, you can create many missions that use the gamemode API. You might never release this API, that's your choice; however, it allows you to create the 'gamemode' as a separate entity from any mission.
Each time you want to implement the gamemode differently, you copy over your gamemode source code, make sure the mission compiles it, then use those functions to make the mission.
There are different types, and you need to be aware of what types your variables are. However, you can do something this:
See these pages for more info:
http://en.wikipedia.org/wiki/Type_system
https://community.bistudio.com/wiki/Data_Types
So, I have edited a mission with a x_load.sqf file (script), then I extracted the mission as a mpmission in .pbo format. I loaded that .pbo file into my clan's server and initialized the mission.
Everything loads fine but when the mission starts the server shows up a message saying that "x_load.sqf file is not found" and therefore the script doesn't works.
Any idea? thanks!
"I came for the action and fun and end up being a software engineer" :P