Jump to content

code34

Member
  • Content count

    1255
  • Joined

  • Last visited

  • Medals

  • Medals

Community Reputation

102 Excellent

About code34

  • Rank
    Master Gunnery Sergeant

Contact Methods

  • Steam url id
    code34
  1. Hi Just create the develop branch. The last update concerned only some issue. But, this old object will be considerably improve in the next release. If you need some features about it, it s time :)
  2. hi just release a new version 0.4 - upgrade with last version of oo_queue :)
  3. Hi I just release the new version 0.3 - optimise performance around Killzone kid suggestions - add unit tests https://github.com/code34/oo_queue.vr
  4. Hi Working currently, on the next version. I believe i will unsupport the procedural code, except if anyone have the usage of it. Most of the code was develop for oo way, it will be more clear and easiest to support.
  5. Hi pierremgi KK executed a SQF script from an SQS script to run it in an unscheduled context. You can do the same thing by this way from anywhere in your SQF script isnil { _this call Your_sqfFunction; }; SQS is deprecated and should not be used anymore. The code in unscheduled context should be very short, simple and without heavy or long loop. Concening the KK code //ingame debug console [] spawn { while {true} do { allMissionObjects ""; }; }; player addAction ["VM", "vm.sqf"]; player addAction ["nonVM", "nonvm.sqs"]; //vm.sqf _frameNo = diag_frameNo; _tickTime = diag_tickTime; for "_i" from 1 to 100 do { allMissionObjects ""; }; hint str [diag_frameNo - _frameNo, diag_tickTime - _tickTime]; //nonvm.sqs _frameNo = diag_frameNo _tickTime = diag_tickTime for "_i" from 1 to 100 do {allMissionObjects ""} hint str [diag_frameNo - _frameNo, diag_tickTime - _tickTime] Like you can notice he created a spawn loop first which had effect to overloading the scheduler. That s why he had so poor perfomance in schedule context. The unschedule context is always prior to schedule context. So the spawn loop was just delay after the execution of sqs script.
  6. Sparker i confirm, it works like this. indeed, you will have to create a tool to calculate the consumption of each scripts during executions. This will, however, have a very limited effect, because there is no suspend command to pause a thread (only terminate). In the end, you will have to reopen the script yourself and add sleep commands, and optimize code with little scope. In alternative solution, you can do as I did with the OO_UNITTEST class and executed the code in unschedule environment to evaluate its execution time but it will remain relative to the power of the machine on which the code is executed. We can not really complain because it's still a very interesting feature that needs to evolve. The problem was the part of developpers that still think that we must used non schedule code (because they prior their code against other), and they cause problems of even greater performance on frame rate. For who are in interested by, i wrote a full fr article on scheduler http://nestheat.eu/2017/12/25/scheduler/
  7. OO UNITTEST Lastest version: 0.1 by Code34 Description OO UNITTEST is a class (object oriented) that permits to do unit test with procedural and object code. Unit tests make the code more reliable and automatically run tests to check that all the functions of a program work as expected. This is a first version, it is not optimized but can lay the foundation to start doing things. Like to Donate ? Donate with paypal Github: https://github.com/code34/oo_unittest.vr Reference: http://forums.bistudio.com/showthread.php?167980-Object-Oriented-SQF-Scripting-and-Compiling Features: - 2 set of methods to check method results: assert_equal & assert_not_equal - check time of execution for each methods / types - global results Licence: Under Gpl, you can share, modify, distribute this script but don't remove the licence and the name of the original author Code Exemple (with 2 functions, and one object) /* Author: code34 nicolas_boiteux@yahoo.fr Copyright (C) 2018 Nicolas BOITEUX CLASS OO_UNITTEST This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "oop.h" call compile preprocessFileLineNumbers "oo_unittest.sqf"; call compile preprocessFileLineNumbers "oo_helloworld.sqf"; sleep 2; _unittest = "new" call OO_UNITTEST; _hellworld = "new" call OO_HELLOWORLD; helloworld = { "hello world"; }; cheatfunction = { for "_i" from 0 to 9999 step 1 do { hint "blabla"; }; "hello world"; }; _result = ["assert_equal", [helloworld, "ho world", ""]] call _unittest; _result = ["assert_equal", [toto, "hello world", ""]] call _unittest; _result = ["assert_equal", ["helpjdfq", "hello world", ""]] call _unittest; _result = ["assert_equal", ["helloworld", "hello world", ""]] call _unittest; _result = ["assert_equal", ["cheatfunction", "hello world", ""]] call _unittest; _result = ["assert_equal", ["helloworld", "hello robert", ""]] call _unittest; _result = ["assert_not_equal", ["helloworld", "hello jojo la frite", ""]] call _unittest; _result = ["assert_equal", ["helloworld", "hello renaud et sa grosse bécane", ""]] call _unittest; _result = ["assert_equal", [_helloworld, "helloworld", "i got it", ""]] call _unittest; "dump" call _unittest; Results of Dump ==> Function: { "hello world"; } Params: Condition: assert_equal Return expected: STRING (ho world) Return: (any) Time: 0 ms Result: PASSED Error Message: Exception: function name is not string <== ==> Function: any Params: Condition: assert_equal Return expected: STRING (hello world) Return: (any) Time: 0 ms Result: PASSED Error Message: Exception: function name is not string <== ==> Function: helpjdfq Params: Condition: assert_equal Return expected: STRING (hello world) Return: (any) Time: 0 ms Result: PASSED Error Message: Exception: function is not declared <== ==> Function: helloworld Params: Condition: assert_equal Return expected: STRING (hello world) Return: STRING (hello world) Time: 0 ms Result: SUCCESSED Error Message: <== ==> Function: cheatfunction Params: Condition: assert_equal Return expected: STRING (hello world) Return: STRING (hello world) Time: 0.0879974 ms Result: SUCCESSED Error Message: <== ==> Function: helloworld Params: Condition: assert_equal Return expected: STRING (hello robert) Return: STRING (hello world) Time: 0 ms Result: FAILED Error Message: Exception: result is not the one expected <== ==> Function: helloworld Params: Condition: assert_not_equal Return expected: STRING (hello jojo la frite) Return: STRING (hello world) Time: 0 ms Result: SUCCESSED Error Message: <== ==> Function: helloworld Params: Condition: assert_equal Return expected: STRING (hello renaud et sa grosse bécane) Return: STRING (hello world) Time: 0 ms Result: FAILED Error Message: Exception: result is not the one expected <== ==> Function: helloworld Params: Condition: assert_equal Return expected: STRING (i got it) Return: (any) Time: 0 ms Result: PASSED Error Message: Exception: object was not define <== Global Results: ============ Successed: 3 Passed: 4 Failed: 2
  8. you can use it directly in SQF without dll, with oo_cipher:
  9. You should now use this forum thread with the new OOP version :) cause this one is no longer maintain since few years
  10. hi Just a simple modification, the type of oop object is code not object :) #include "..\..\lib\OOP\oop.h" CLASS("ItemList") PRIVATE VARIABLE("array", "items"); PUBLIC FUNCTION("", "constructor") { MEMBER("items", []); }; PUBLIC FUNCTION("nil", "deconstructor"){ DELETE_VARIABLE("items"); }; PUBLIC FUNCTION("code", "addItem"){ // Object: Item MEMBER("items", nil) pushBack _this; }; PUBLIC FUNCTION("", "getItems") FUNC_GETVAR("items"); ENDCLASS;
  11. hi, refactoring this project on vr map and create develop branch https://github.com/code34/oo_queue.vr as much sense.
  12. so big that i didn't see it :) thanks you.
  13. Hi :) Just update the library lists concerning OOP https://github.com/code34/oop.h/wiki/9.-OOP-LIBRARY
×