Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×

Socrate

Member
  • Content Count

    34
  • Joined

  • Last visited

  • Medals

Everything posted by Socrate

  1. Yep i know that Java and C# use GC, however: - GC has its own cost - there're already GC implementation for C++ too - C++ offers already other way to manage memory: auto_ptr, shared_ptr and so on - aren't we talking about scripting?! ;) I'm not a security expert however, you have this kind of issue also with Java because: - safety depends on the code you wrote, so depends on the programmer skill - in Java for example you can download a class from "somewhere" and execute arbitrary code ( through ClassLoader). As far as i know this can't be done in C++. Correct me if i'm wrong, however we all agree that everything it's better than SQF/SQS, first for the automatic JavaDoc ( i dream a good documentation made by the developer..at least better than the one on the wiki) and,second,because we'll have a predictable language. :D
  2. Java?! C#? why not C++?! the config files were C++ headers... C++ is -fast -support OOP -portable -probably, it's already used by the engine ...it's really true that the ways of the Lord are infinite..
  3. Socrate

    -[TdC]- Convoy Script

    First thank you all! :bounce3: panda123 right now i think that in the next release we'll fix some bugs, clean up the code and improve the documentation. I cannot guarantee but maybe in future releases we can try to make it work in single player!
  4. Socrate

    -[TdC]- Convoy Script

    Me and Solo are planning to clean up the code and improve the documentation for the next release..there's still a lot of work to do. I'd like to document better the functions we wrote. For those interested in scripting take a look at how the path for the convoy are generated. Basically you can generate a mix between random and sequential paths. Furthermore this is done in a seperate function so you can use it also for other projects. This function is the file scr_fnc_rndPathPos.sqf and use internally the function in the scr_fnc_rndPath.sqf file. Some examples: path = ["seq", a]; this simply take all the marker you placed a,a_1,a_2 etc and generate an array of positions path = ["seq",a,b,c]; generate an array of positions made by all the a,b,c markers in that order path = ["seq",a, ["rnd",b,c],d] generate and array of positions composed by: all the marker of a all the markers of b OR c all the marks of d so the possible paths are abd or acd etc... i know it's not so simple but you can create very complex expressions like ["rnd",["seq",a,b],["seq",c,["rnd",d,e]]] where the possible paths are: ab,cd,ce!! Notice the random starting point!!! probably this function will be released standalone Edit: I forgot to underline that when writing "a" in ALL the markers named a,a_1,a_2... contribute to the path!!
  5. Is it possible to pass params to an sqf function by reference? Like arrays for examples? or are they already passed by reference? Thanks Socrate
  6. Hi all, here it's a small front-end for cpbo for Windows 7/Vista/Xp. Just put cpbo.exe in the same directory of my app and that's it. Download Here
  7. Socrate

    7Cpbo

    Thank you!! :D
  8. Socrate

    7Cpbo

    Sorry guys for the delay but i've been out of home this weekend! :( :( The good thing it's that i've updated the download link for the download :D for every bug or info just post here!! DON'T FORGET to put cpbo.exe in the same directory where you put 7cpbo.exe!! If you do 7cpbo ask you at each extraction the path to cpbo.exe ;)
  9. Right now i'm executing the rADDACTION by the server more or less like this //Init.sqf if(isServer) then { //Execute rADDACTION }; but seems like that only the player (on the server machine) gets the Action added..is it the right way of using this command? Cause i thought that every multiplayer command ( of the multiplayer framework) must be executed only by one host (in my example only by the server). Is it right? ---------- Post added at 04:48 PM ---------- Previous post was at 04:44 PM ---------- for sake of clarity here it is the code: if(isServer) then { waitUntil{!isnil("BIS_MPF_InitDone")}; waitUntil{BIS_MPF_InitDone}; diag_log text "Init.sqf: Function Module Activated"; //We add the action for the respawn _respawnWestActionID = [nil,flagWest,"loc" + "per",rADDACTION,"Respawn","respawn.sqf",[],1,false,true,"",""] call RE; };
  10. So what happen to the variable assigned in the editor to the player when he die? I mean : suppose i've named the player "p1", and my init.sqf i write variable = player; is p1 == variable true or false? Furthermore i don't understand if the p1 (so the name of the player object) is a variable or not... Another doubt is: suppose i've added a killed event handler to the player. In the killed.sqf i've the two variable _killed and _killer. What does contain the _killed variable? is it a reference to the respawned player or a reference to the dead body of the player?
  11. Nope, In my opinion EACH player has a variable called 'variable' that reference the player. 'variable' will be different for each player. the variable 'variable' it's global but in a multiplayer game the value of a variable isn't automatically broadcasted at every player .Interesting is what you say here _killed would be the name of the unit that was killed So you say that _killed contain the name of the unit, so a STRING variable! :bounce3: I'll check it out!! thank you man!
  12. wait wait : 1) This is the sintax of the player command from the scripting command reference: Object = player So using a variable (suppose we call it variable), like this: variable = player; variable contains the player object (so actually a reference to the player). Right? If we named in the editor the player p1 also p1 is a variable containing a reference to the player object. right? So actually: p1 == variable will return TRUE. Right? 2) Ok my problem is this: i'm working a revive script similar to norrin one. Suppose that EACH player add to himself a KILLED EVENT HANDLER. So when the player die in the killed.sqf i've the two variables: _killed = _this select 0 _killer = _this select 1 My question is: what does contain the _killed variable? The player in a MP mission obviusly after been killed respawn at the Respawn_West( East etc). So when the event handler fires up the _killed variable contains a reference to: 1) the previus player object ( so actually to the dead body) 2) to the respawned player object? Related to this 2 question is the name assigned to a player in the editor because if the _killed refence the dead body object how can i reference the new respawned player object ? ( probably with the variable used in the editor like p1,p2 etc right? ps: sorry for my bad english
  13. Is there a way to get the dead body object of a dead player? or is there a class name for a dead body so i create them? Basically i need to fill a variable with the dead player object after a player die.. So PLAYER "X" GET KILLED and in _corpse i've the dead body object..
  14. are you meaning that after that event fired, i've the dead body objet in the killed variable? I've already used killed event handler but i've always tought that the _killed variable had a reference to the respawned player object ( i mean the one that died and than respawned) not to the dead body object. So if i try this way it should work, right?
  15. Do you any suggestions for easy the job of developing multiplayer missions? cause the only way i found for testing my multiplayer mission is to run a arma2 server and then to lunch another arma2 process but each time i've to modify my mission i've to close the server process, edit the mission, export it to multiplayer and then re-run the server and reconnect the other arma2 process....damn! is there a better way to do this?!
  16. So the same as me except that i did all on a single pc...they should add something to speed up this kind of things!
  17. OK solved!!!! Thank you shk!! with a little of testing i came to it with this code:
  18. I'm sorry...seems like i've always something to learn! In my init T_INIT = false; T_Server = false; T_Client = false; T_JIP = false; if (playersNumber east + playersNumber west + playersNumber resistance + playersNumber civilian > 0) then { T_MP = true } else { T_MP = false }; if (isServer) then { T_Server = true; if (!(isNull player)) then { T_Client = true }; T_INIT = true; } else { T_Client = true; if (isNull player) then { T_JIP = true; [] spawn { waitUntil { !(isNull player) }; T_INIT = true }; } else { T_INIT = true; }; }; //Will wait for the player variabile to be initiliazed waitUntil { T_INIT }; while { true } do { _handle = [] execVM "games\CTF\ctf.sqf"; waitUntil {scriptDone _handle}; }; So both client and server execute the ctf.sqf and wait it to terminate...right? Here's the problem : ctf.sqf //We initialize some global variables for both player and server playerWithSuitcase = nil; objectCompleted = false; suitcase = nil; teleportWest = nil; teleportEast = nil; if(T_Server) then { suitcase = "Suitcase" createVehicle getMarkerPos (_objMarkerArray select _pos); publicVariable "suitcase"; teleportWest = "FlagCarrierUSA" createVehicle [getMarkerPos (_objMarkerArray select _nextPos) select 0, ((getMarkerPos (_objMarkerArray select _nextPos) select 1) - 100), getMarkerPos (_objMarkerArray select _nextPos) select 2 ]; teleportEast = "FlagCarrierRU" createVehicle [ getMarkerPos (_objMarkerArray select _nextPos) select 0, ((getMarkerPos (_objMarkerArray select _nextPos) select 1) + 100), getMarkerPos (_objMarkerArray select _nextPos) select 2 ]; publicVariable "teleportWest"; publicVariable "teleportEast"; }; if(T_Client && !T_Server) then { waitUntil {!isNil("suitcase")}; waitUntil {!isNil("teleportWest")}; waitUntil {!isNil("teleportEast")}; suitcase addAction ["Grab Suitcase", "games\CTF\suitcase\grab.sqf", [], 0, false, true, "Suitcase Grabbed", "true"]; }; if i try to display with an hint command the suitcase variable i get "any"!! the same happen with the teleportWest and East variables. From the wiki of the publicVariable command: Hwr the object created with the createVehicle is trasferred to all players in MP!!!! Infact thare's the local command createVehicleLocal... Can you help me? the only solution i found is to put these objects in the editor and not to create them by script...hwr i wanted to do everything with scripts...
  19. Hi all i've a little problem..i'm developing a ctf sort map. in my init.sqf i've: if(isServer) then { onPlayerDisconnected "[_id,_name] execVM ""disconnected.sqf"""; }; my problem is know which is the player that disconnected if w1,w2,w3...etc and maybe his last pos! have i to insert an array of players name like playersArray = [w1,w2,....w24,e1,e2.....e24] ?
  20. thanks xeno! in fact i do that! the playerWithSuitcase variable hold the player's with suitcase object! i use that in the server for displaying a marker of the suitcase! in a while loop like this : while(true) do { if(T_Server) then { _suitcaseMarker = createMarker ["suitcaseMarker", getPos suitcase ]; "suitcaseMarker" setMarkerType "Flag"; "suitcaseMarker" setMarkerText "Suitcase"; while {true} do { //If someone have the suitcase if(!(isnil("playerWithSuitcase"))) then { "suitcaseMarker" setMarkerPos getPos playerWithSuitcase; } else { "suitcaseMarker" setMarkerPos getPos suitcase; }; sleep 0.5; }; }; hwr your idea to check if the player is alive is great!! i didn't thought of doing that!! thank you man!! i also post here the code is executed when the player click the addaction of the suitcase! /the object which the action is assigned to _target = _this select 0; //the unit that activated the action _caller = _this select 1; //ID of the activated action _id = _this select 2; //Arguments given to the script if you are using the extended syntax _arguments = _this select 3; //Add the drop action for the suitcase dropActionID = _caller addAction ["Drop Suitcase", "suitcase\drop.sqf", [], 0, false, true, "Suitcase Dropped", "true"]; //Move the suitcase to a far away position suitcase setPos getMarkerPos "suitcaseHideZone"; //Set the player who has actualy the suitcase. It's usefull if the player get disconnected! playerWithSuitcase = _caller; publicVariable "playerWithSuitcase"; //Add Event handler for the actual unit cause if killed it drop the suitcase killedEventID = _caller addEventHandler ["killed", {_this execVM "suitcase\killed.sqf"}];
×