Jump to content

jaynic

Member
  • Content Count

    43
  • Joined

  • Last visited

  • Medals

Posts posted by jaynic


  1. Yeah, I've figured out that I can construct inline functions. But my question is more along the lines of how I can call the inline functions externally after instantiation of the parent class.

    So as per my example above

    //pseudo-code 
    //filename: someOtherScript.sqf; 
    
    myUnit0 = [_myPredefinedSoldier_0] call ohtc_fnc_unitExtension; 
    myUnit1 = [_myPredefinedSoldier_1] call ohtc_fnc_unitExtension; 
    
    //proceed to call functions within the specific unit: 
    //How could I call something like myUnit0.getType ??  
    
    

    How could I call one of the functions inside myUnit0, and myUnit1?


  2. Thanks guys. I totally derped and didn't see that I failed to wrap it in the CfgFunctions class... Sometimes you just need another pair of eyes to see what's right in front of you.

    What JShock means is that in your Description.ext' date=' your functions stuff has to look like this:

    ... you're probably better off putting that code into an external "functions.hpp" file and referencing that inside your Description.ext like that:

    class CfgFunctions
    {
       #include "functions.hpp"; 
    };
    

    [/quote']

    So - if I understand what #including an hpp file is - it basically writes the contents of that hpp file in to the body of the containing document at run time? Basically, it will keep the character limits down and permit better organization. Cool.

    An architecture question followup:

    I come from an object oriented background - so I really prefer the ability to load classes with internal methods. Is there a way to mimic this in the arma scripting language? For example:

    //pseudo-code
    //filename unitExtension.sqf
    
    //the initial unit that constructed the class
    private ["_unit"];
    _unit = _this select 0;
    
    getType = {
    //return the type
    };
    
    isMan = {
     //return a boolean of whether or not this is a man
    };
    
    isPlayer = {
     //return Whether or not this is a player unit
    };
    
    //presumably this would pass back the whole script?
    this;
    

    And then comsume that in some way in another part of the mission say:

    //pseudo-code
    //filename: someOtherScript.sqf;
    
    myUnit0 = [_myPredefinedSoldier_0] call ohtc_fnc_unitExtension;
    myUnit1 = [_myPredefinedSoldier_1] call ohtc_fnc_unitExtension;
    
    //proceed to call functions within the specific unit:
    //How could I call something like myUnit0.getType ??
    
    

    thanks!


  3. Hi all,

    I'm attempting to re-structure and organize my code - but I am having problems registering my external functions inside the missions description.ext > CfgFunctions class.

    I have the following inside the description.ext:

    class ohtc
    {
    tag = "ohtc";
    
    class testCategory
    {
    	file = "ohtc\f\testCategory";
    	class testFunction	{
    		description = "This is a test function that returns a silly string";
    	};
    };
    };
    

    I then create the corresponding folder inside the mission root (right next to the description.ext):

    ohtc/f/testCategory
    

    Inside there - I have a file called: "fn_testFunction.sqf"

    The contents of that file are as follows:

    //Return the string with a prependix;
    private ["_a"];
    _b = _this select 0;
    _a = 'passed in: ';
    
    _a + _b;
    

    When I go in game, and enter the following in to the debugger:

    hint format ['called my function: %1' , (['asdasd'] call ohtc_fnc_testFunction)];
    

    all I get is a hint that says "called my function: any"

    I feel like this is a silly syntax error oversite on my part.. can anyone please assist?


  4. Yeah... I can see how that would be very taxing - considering I'm looping through everything placed each time something is placed...

    Maybe if I mention more about what I'm doing you'd be able to offer me a solution I'm not even close to.

    Basically - we've got the CSE Mod: The medical system in there has a whole bunch of new items that we need to carry around. These are things like bandages, morphine, etc...

    All of these items replace the default FAKs that come with Arma - sp the FAK is now deprecated for us.

    The good thing about FAKs is that once you killed some enemies - you went to their corpses and could take their FAKs and replenish your own. The problem with this mod, is that the loadouts for all the AI, and the vehicles with stuff in the inventory do not (of course) have any of the newly required medical goods. Ad don top of that - we have another mod that adds more custom units and factions - and of course, those have no notion of our medical system requirements either.

    Therefore - I thought to myself that I would need to add these items to all classes default loadouts so that the mod feels truly integrated. When I do any search for "customize loadout" all I get is a bunch of scripts to add to the init line of units placed in the editor. But in MCC and or Zeus - units are not placed in the editor - they are placed dynamically during the mission.

    So then I thought - like in any modern application - I could just add an event to some event handler when a unit is spawned - then do a dynamic check for a type eg: if(typeOf _unit == "B_Soldier_F") { doThis; } else {doThat;}

    And that's what lead me to asking the question...

    Thanks for your assistance.


  5. Thanks for the reply. Hmm - so there is no eventHandler for "createVehicle" - that's silly.

    So is there any other way to tell when an object is created, or initialized WITHOUT attaching a script directly to the unit? The notion being that: I do not know what unit is spawning - until it is spawned: therefore I must manipulate said unit after it spawns - or ideally as it is spawning.


  6. Hi all,

    I currently use MCC, and zeus, and some content mods (RHS Escalation etc...)

    What I'd like to do is write custom loadouts for all units and vehicles - but it would not be good practice for me to manually edit the mods - as that will require the same effort when the mod updates. Rather: I need to write a wrapper class around the spawning of units both in the init line of any manually placed unit in the mission file (this process I understand) but have the ability to call the same functions when the units are spawned via zeus, or mcc.

    I'm hoping there is an event handler for when ANY unit or vehicle or object is spawned in the game that I can attach a script call to via my mission.

    pseudo code:

    addEventHandler ["onObjectSpawn", [_theObject], "pathTo/myScript.sqf"]
    

    I'm pretty new to arma scripting - but I can kinda tell what needs to get done - but I don't know the syntax or where to find out what to do.

    Thanks


  7. RE: I am still being put in to the "unconscous state" despite it being removed.

    Well maybe you are playing the mission version and running some old MCC mission that had Psycho ArmA3 wounding system? As for now MCC doesn't have any medic system. :j:

    I know we are not using the mission version of MCC. We had that issue before and I corrected it. I'm using the MCC Template Mission...

    The one at this url: https://www.dropbox.com/s/436ndcbiepq820u/sample%20missions.rar

    Which I got from armaholic here: http://www.armaholic.com/page.php?id=19580

    Is there a new template mission?

    ---------- Post added at 16:32 ---------- Previous post was at 16:25 ----------

    Also - for the record: I wholeheartedly support the push for more than one Mission Maker. It would make things really fun. But yes, I understand that if the code was not meant to understand multiple users - you will have a surgical job of adding this feature - but I really, really think it would be an awesome addition.


  8. Dedicated server issues when using RHS Escalation.

    Hi all,

    I'm trying to get RHS set up on my dedi-box. I can get everything running, and the server starts: but as soon as a player connects - he get's kicked right away.

    In the RPT file - I get the following errors at the bottom:

    20:49:23 Initializing Steam server - Game Port: 2302, Steam Query Port: 2303

    20:49:24 Connected to Steam servers

    20:49:35 Server error: Player without identity JayNic (id 1801630457)

    20:49:35 Server error: Player without identity JayNic (id 1801630457)

    20:49:36 Server error: Player without identity JayNic (id 1801630457)

    20:49:36 Server error: Player without identity JayNic (id 1801630457)

    20:49:36 Server error: Player without identity JayNic (id 1801630457)

    20:49:36 Server error: Player without identity JayNic (id 1801630457)

    20:49:36 Server error: Player without identity JayNic (id 1801630457)

    20:49:36 Server error: Player without identity JayNic (id 1801630457)

    20:49:36 Server error: Player without identity JayNic (id 1801630457)

    20:49:36 Server error: Player without identity JayNic (id 1801630457)

    20:49:36 Server error: Player without identity JayNic (id 1801630457)

    20:49:36 Server error: Player without identity JayNic (id 1801630457)

    20:49:36 Server error: Player without identity JayNic (id 1801630457)

    20:49:36 Server error: Player without identity JayNic (id 1801630457)

    20:51:03 Array index out of range

    20:51:03 c:\w\stable\futura\lib\network\networkserver.cpp ClearNetServer:NOT IMPLEMENTED - briefing!

    I am not running more than 1 server.

    Any ideas?

    I can run mcc, and RHS Escalation on my pc when hosting, but the dedicated is not working for anyone.


  9. A couple of questions. I'm not sure if I've encountered bugs or not with these...

    1) Squad Dialogue

    I am only able to open the squad dialogue when I am in the process of respawning. When I press my bound key to open it while in game: the menu shows up for a split second, then closes. Is this intended functionality? How can I keep it from closing itself like this?

    2) Spawn/Respawn locations

    When I create a spawn location - it places a pole. Is there any way I can delete it, and create a new one? I know I can simply create a new spawn location form the MCC console, but this leaves the pole on the ground.

    Also: when I create a, FOB respawn: can I later delete it, or move it?


  10. Hi all,

    I have this issue when I attempt to edit an item I place in zeus mode while running the latest (released today) version of mcc. I get a blank window as seen in the following screenshot.

    http://cloud-4.steampowered.com/ugc/36353839617355366/38D6F762BAE1F9247B668429AF6D4A835EF95D3C/1024x576.resizedimage (203 kB)

    Running the server on a dedicate box.

    I'll check the empty window - what item was it btw?

    This item in particular was a box of antibiotics - but it is with all objects including units, and vehicles. Sometimes I can restart the game (the whole exe) and get it back. But it's random. It happens to other mission makers in my group as well.

    Thanks for checking in to it!


  11. Hi all,

    I have this issue when I attempt to edit an item I place in zeus mode while running the latest (released today) version of mcc. I get a blank window as seen in the following screenshot.

    http://cloud-4.steampowered.com/ugc/36353839617355366/38D6F762BAE1F9247B668429AF6D4A835EF95D3C/1024x576.resizedimage (203 kB)

    Running the server on a dedicate box.

    Additional questions on the AI behaviour:

    1 When I place a unit in Zeus: it appears to not respect the mission settings AI skill variables in MCC - is this expected behaviour?

    2 When I place a unit in MCC, and then I change the MCC Mission Settings AI: do the ai on the battlefield get updated with the new settings? Or is it only new AI?

    3 If I place a unit in MCC, and then edit his skill settings in Zeus - does the ai skill change, or does MCC take it over?

    Thanks

    ---------- Post added at 16:52 ---------- Previous post was at 16:11 ----------

    OK, what is defining the MCC default AI skill profiles?

    Is it taking it from the difficulty profiles on the host (dedicated server) or is it something you have set the values for "rookie, moderate and veteran". In the MCC mission settings window you also have "Rookie, 20, 30, 40..." and in the new MCC modules, you have just three mentioned above to choose from.

    In particular im having a massive issue with MCC and Zeus spawned AI being controlled by GAIA, seem to have a high aim skill.

    Cheers,

    Walker

    My team and I conducted a pretty hefty set of tests with AI skills cause we kept getting blasted too... Here is what we found out:

    1) If you're playing on a dedicated server: the AI skill levels are multipled by the values that are set in your servers *.arma3profile file

    According to this post from BIS: http://dev.arma3.com/post/oprep-ai-configuration - The variables in the .arma3profile file listed as: skillFriendly; skillEnemy; precisionFriendly; precisionEnemy are now all obsolete and not used. They need to be replaced inside the .arma3profile file with the following variables:

    	aiLevelPreset=3;
    	skillAI=0.5;   
    	precisionAI=0.2;
    

    Where precision is their accuracy, and skill is an overall multiplier to other non-firing skills.

    NOTES:

    - Any precisionAI skill setting over 0.5 was found to be incredibly frustrating to play

    - The aiLevelPreset must be set to 3 in order to respect the other two values. Without this set to three: the skill and precision will be handled by the game internally.

    2) The AI skills [seem] to apply differently to Zeus placed units versus MCC placed units

    We conducted several tests of dropping a single rifleman in MCC, and then a single rifleman in Zeus: and waited for him to see and kill us.

    The Zeus ones seemed to always kill us MUCH faster - where MCC dropped units seemed to respect our .arma3profile settings on the server.

    3) The MCC mission setting AI skills only seem to apply to newly spawned AI

    When you place n number of units in MCC, their skills will be determined base don the current mission settings ai skills.

    If you alter those settings: the AI that are currently on the map do not seem to be updated with the new ai settings - so don't think you can just make things easier whenever you want.


  12. I've been wondering about this myself. I build webservices, and apis all day, but I couldn't wrap my head around Arma scripting, so I have never been able to figure out how to do this myself.

    I would love to see some simple webservice integration built in to an Arma3 script. You could pass basic JSON objects to a webservice, and get a response... It would be clean and simple and scaleable. Plus, for those who don't want to use an external server to host - they could just call their own hosted webservice on their own box.

    Some psuedocode:

    //A request to get player definition from a server
    request myArmaCloudRequest = {"getPlayer" : {
       "id" : 102102, //The player id to get
       "hostId" : "01PI0000003WYRP", //Pass a host id - the host id wouldl be pre-registered in the "cloud" database - this is a simple auth mechanism but you could do whatever
       "hiveId" : "myWastelandServers", //A user defined server id - each client would be able to register any number of hive ids that would essentially act as separate databases. This is for organizations that might have multiple servers - but where some share objects, and some do not. Each mission file/dedicated server would have this in a config file for easy use.
    }};
    
    
    //A response from the webservice
    //A successful response with player data
    response armaCloudResponse = {
       "success" : true, //Whether or not the operation completed successfully
       "code" : "GETPLAYER100", //A response code - codes would be stored in a documentation for reference
       "message" : "Player data retrieved", //A general response message tied to the code - just makes it easier to integrate with
       "player" : {
           "name" : "sn1perkill3r",
           "id" : 102102,
           "lastModifiedDateTime" : "2013-09-16 23:39:40" //The last time the player record was modified
           "inventory" : ...example inventory string...,
           "position" : ...example world coordinates string...
           ... additional properties
    }};
    
    //A response for an invalid host - what someone would get if they didn't register in the ArmaCloud
    response armaCloudResponse = {
       "success" : false,
       "code" : "GETPLAYER900"
       "message" : "Invalid Host Id"
    };
    
    //A response for a request that succeeds - but the player is not found (maybe he's new - maybe the db was wiped - whatever)
    response armaCloudResponse = {
       "success" : true,
       "code" : "GETPLAYER101"
       "message" : "New Player created"
    };
    

    You could do the same thing with vehicles, structures, maybe even mission states? I dunno - is that a thing in Arma?

    Anyways - I guess the first step would be to be able to call webservices, and the second step would be to decide where to host it. They're just separate things to do.

×