Jump to content

Sertica

Member
  • Content Count

    133
  • Joined

  • Last visited

  • Medals

Everything posted by Sertica

  1. The scenario continues the BIS tradition of portraying the Chinese and Russians, or any non-NATO state for that matter, as savages like early 20th century war posters and contemporary western MSM propaganda while Americans and Brits rush around saving cats from trees. Whatever. The economy is broken. You can just drive around collecting loot from bodies and sell it to rebels until you are rich and can buy the apocalyptic arsenals that somehow random civilian dealers in a poor country have laying around. Too much time is just junk collecting.
  2. Traits like medic and engineer are member values of the unit's class, so you check TypeOf on unit. Look the params before using function: https://github.com/acemod/ACE3/blob/master/addons/medical_treatment/functions/fnc_fullHeal.sqf You have player in the patient slot and no medic.
  3. There are tutorials about how to make "extensions", but I haven't seen any synopsis of what you can do with them that exceeds sqf and configs. There are some things that mods do where I don't see how it is possible. Example: ACE3 makes bullets fly in a curve according to some math. I've looked at some of the source for the calculations. But how does it replace what the base game tells the bullet to do with its own instructions?
  4. I presume count is a variable handle. The 16 assignment is the initialization of the variable. The configs are not exactly c++, but the syntax is similar. http://www.cplusplus.com/doc/tutorial/variables/ http://www.cplusplus.com/doc/tutorial/classes/ To change a variable in an instance of a class during runtime requires a setter method that writes to it, like the sqf command https://community.bistudio.com/wiki/setVehicleAmmoDef.
  5. Sertica

    addAction key change?

    Use the dialog widget library to create a menu, which is shown when a key is pressed if the item in inventory. https://community.bistudio.com/wiki/Arma:_GUI_Configuration#Controls But hard coded keys will make your mod unplayable to anyone that does not use your key binding scheme. Another option is to have a button display near the radio icon in the inventory, like how Invade and Annex has a lock backpack toggle button.
  6. Better replace it with a hint that door is locked.
  7. That is how programming works. The cpu only does exactly what you tell it to down to the smallest part. The way I would build compound structures is to loop through arrays that contain the class, coordinates and UpVector, passing them to createVehicle and setUpVector. I imagine it might be chaos physics unless you disable sim on each part. The real hassle is that the vanilla editor does not allow copying to clipboard this data from compositions.😡
  8. Similar to what I was trying to do, but didn't get to finishing yet. This is probably what I need.
  9. I'm trying to get a grasp on two matters to get a mission loop running properly. 1. What is the difference between call and spawn? According to https://community.bistudio.com/wiki/Scheduler#Scheduled_Environment I'm taking it to mean that the only difference is code running in spawn is limited to 3ms bursts. call compileFinal preprocessFile "main.sqf"; call main; main = { onEachFrame { hint "test"; // game engine loop going in parallel with this }; }; 2. Is calling only scripts compiled in init.sqf, as above, all you need to get best possible speed? Is there a way to compile all sqf files in the mission folder tree as opposed to adding all lines manually to init? What I am aiming for now as I start to gather my test missions into a real mission is having typical game loop for mission with frequency sections like this: main = { _frameCount = 1; // start on frame 1 onEachFrame { if (_frameCount > 500) then { _frameCount = 1; }; // reset after 500 frames /* High Frequency */ call highFreqMethod; // execute these every frame; ~0.02 interval /* Medium Frequency */ _remainder = _frameCount % 20; if (_remainder == 0) then { // execute these every 20 frames; ~0.4 second interval call medFreqMethod; }; /* Low Frequency */ _remainder = _frameCount % 500; if (_remainder == 0) then { // execute these every 500 frames; ~10 seconds interval call lowFreqMethod; }; _frameCount = _frameCount + 1; // }; }; A strategic decision making script would go in the low freq section for call at ~ 10 second interval. Scouts trying to spot enemies could go in medium or high depending on how much precision can be afforded with current frame rate.
  10. When I run the main code above it does not freeze the game, leading to the question of what thread it is in to begin with. It seems scripts are already running parallel to the game engine.
  11. Is there any serious reason to use function-as-file? https://community.bistudio.com/wiki/Function#Types_of_function I read a bit about inlining for general programming. Not sure whether there could be a problem arising from using variables instead. Then there is the question of which versions of existing ones to use. E.g., vectorDotProduct vs. BIS_fnc_dotProduct.
  12. To show my test mission debug info window I have code like this: infoInit = { waitUntil {!isNull findDisplay 46}; disableSerialization; _ctrl = ((findDisplay 46) displayCtrl 9999); if (!isNull ctrl) then {ctrlDelete ctrl}; _ctrl = (findDisplay 46) ctrlCreate ["RscStructuredText", 9999]; _ctrl ctrlSetPosition [0, 0, 0.25, 5]; _ctrl ctrlSetTextColor [0.5, 0, 0.5, 1]; _ctrl ctrlSetbackgroundColor [0.8, 0.8, 0.8, 0.1]; _ctrl ctrlCommit 0; _strings = []; info = { _strings pushBack ("Visible Quantity: "+(str uavVisEnemyCount)+"<br/>"); _strings pushback ("UAV Vision Distance: "+(str uavVisDistance)+"<br/>"); _ctrl ctrlSetStructuredText parsetext (_strings joinString ""); _ctrl ctrlSetPosition [-0.6, 0.0, ctrlTextWidth _ctrl, ctrlTextHeight _ctrl]; _ctrl ctrlCommit 0; _strings resize 0; }; }; info is supposed to be called to update the display just before uavVisEnemyCount is reset at the end of the cycle. But the local variable defs in infoInit are apparently invisible to info despite it being nested in that scope. On the other hand I get a pop-up complaining about serialization if I make them global even with disableSerialization in both. I don't understand this serialization issue with widgets. The way I was getting the info displayed before was checking the values constantly in a loop, which is a bad hack to get around this.
  13. That is just a typo from when I changed it back from global. They are still not visible where info is called. I moved info outside of infoInit, changed all variables to global again and now it is not giving the serialization error. I've never coded without class and interface, so I guess the general practice with sqf is to use global variable for everything except the temporary variables in functions. There is no encapsulation.
  14. https://community.bistudio.com/wiki/Arma_3_Characters_And_Gear_Encoding_Guide The wiki says to declare the class and parent class to override the members. But the config viewer shows multiple parent classes. So I can't see the logic of identifying which one class you need to declare extension from. E.g., I want to change the B_Caryall_oli backpack class to a "Tent Backpack" for script use in my mission. The wiki says to inherit from Bag_Base, but why that one? There are 7 parents according to config viewer. Here is the array: ["B_Carryall_Base","Bag_Base","ReammoBox","Strategic","Building","Static","All"] It looks like single inheritance from right to left. Would it not be B_Carryall_Base instead of Bag_Base? class cfgVehicles { class B_Carryall_Base; class B_Carryall_oli:B_Carryall_Base { displayName = "Tent Backpack"; maximumLoad = 0; mass = 320; }; };
  15. I found a way to make the bag assemble into a tent. The engine recognizes the AssembleInfo class copied from the vanilla weapon bags. class cfgVehicles { class B_Carryall_oli; class TentBackpack:B_Carryall_oli { class AssembleInfo { assembleTo = "Land_TentDome_F"; base = ""; displayName = "Small Tent"; dissasembleTo[] = {}; primary = 1; }; displayName = "Tent Backpack"; maximumLoad = 0; mass = 320; }; };
  16. There seems to be a way to edit configs in mission files without a mod. In Invade & Annex the CSAT troops do more missile damage to NATO tanks than vice versa.
  17. Sertica

    UAV Issues

    That locks on position, not direction.
  18. Sertica

    UAV Issues

    In tests it seems to work like a charm where buildings and trees are blocking view. The count of spotted units changes close to expected with 0.9 visibility requirement.
  19. Sertica

    UAV Issues

    I thought of a hack to use uav for automatic spotting. Using checkVisibility I should be able to do it. I'm assuming this works like regular soldier vision, affected by fog and foliage. highCommandWest = { [] spawn { while {true} do { _uavVisEnemyUnits = []; { if (side _x == independent) then { { _visibility = [uav, "VIEW", _x] checkVisibility [eyePos uav, eyePos _x]; if (_visibility > 0) then { _distance = (eyePos uav) distance (eyePos _x); if (_distance < 2000) then { _uavVisEnemyUnits pushback _x; } } } forEach (units _x); } } forEach allGroups; sleep 5; }; }; }; In the ignore parameters I put the uav and soldier so: (1) the uav turret does not need to be pointing in any particular direction (which I could not find a way to do in 3D) and (2) the soldier's body and stuff can't block the path to his eye. The question remaining is what value range returned from checkVisibility should be accepted. A wiki note says that blockAIVisibility 1 does not reduce it to 0. Otherwise I have no clue what affects that number.
  20. You are the one saying it does something, so I'll let you demonstrate what that is.
  21. It acts as move waypoint with no trigger zone. Unless there is a experiment with the difference being the waypoint type I see no reason to believe otherwise.
  22. BIS is reliant on randoms renting servers and running them for public benefit by kind admins or making mods and missions for free, aside from the one contest that awarded money. Otherwise you are only buying solo game with a campaign.
  23. I'm using the SQDev plugin for Eclipse IDE. So far it seems to have complete syntax error detection.
  24. Read the wiki on how the guard waypoint works and it will become clear that it has no relevance in Zeus.
×